-
Notifications
You must be signed in to change notification settings - Fork 998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spark] Support show columns in spark #3888
Conversation
|
||
assertDoesNotThrow( | ||
() => { | ||
spark.sql("SHOW COLUMNS FROM T") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not check its result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UT had added for check its result and it like picture in discription. @JingsongLi
import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} | ||
import org.apache.spark.sql.types.{BinaryType, Metadata, StringType} | ||
|
||
case class PaimonShowColumnsCommand(v2Table: SparkTable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can extend PaimonLeafRunnableCommand
directly, then we don't need PaimonShowColumnsExec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks,had change it as your suggestion. @YannByron
|""".stripMargin | ||
) | ||
|
||
assertDoesNotThrow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if check its result below, we don't need this assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,had check result,I remove the assert @YannByron
case class PaimonShowColumnsCommand(v2Table: SparkTable) | ||
extends PaimonLeafRunnableCommand | ||
with WithFileStoreTable { | ||
override def table: FileStoreTable = v2Table.getTable.asInstanceOf[FileStoreTable] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this command can also apply to the system table, not just FileStoreTable
. if yes, modify here and add a UT for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for comments,I had a try but seems not find a way to compatible with system table and FileStoreTable due to their not use same interface. Maybe we can just support FileStoreTable firstly keep the same with other Command?
Purpose
Support show columns syntax in paimon,currently spark not support v2 in show columns(fix in spark apache/spark#47568 ) but paimon side not support yet,would error out like:
spark-sql> show COLUMNS from bdsp_test.paimon_mi_31;
Error in query: SHOW COLUMNS is not supported for v2 tables.
Add spark analyzer extensions to capture it,after fix:
Linked issue: #3889
Tests
API and Format
Documentation