-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49152][SQL][FOLLOWUP] DelegatingCatalogExtension should also use V1 commands #47995
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,4 +71,12 @@ class DataSourceV2SQLSessionCatalogSuite | |
| sql(s"CREATE EXTERNAL TABLE t (i INT) USING $v2Format TBLPROPERTIES($prop)") | ||
| } | ||
| } | ||
|
|
||
| test("SPARK-49152: partition columns should be put at the end") { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test case name sounds a little mismatched. Is this a correct reproducer for
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the Spark behavior with the built-in catalog. A Strictly speaking, this shouldn't be the only issue, as there might be other subtle differences between v1 and v2 CREATE TABLE command, or other commands.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah as @cloud-fan have mentioned, this verifies a specific case so we make sure the behavior is not changed. And there might be a list to verify though.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. It makes sense. Thank you for the explanation. |
||
| withTable("t") { | ||
| sql("CREATE TABLE t (c1 INT, c2 INT) USING json PARTITIONED BY (c1)") | ||
| // partition columns should be put at the end. | ||
| assert(getTableMetadata("default.t").columns().map(_.name()) === Seq("c2", "c1")) | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2125,10 +2125,18 @@ class DataSourceV2SQLSuiteV1Filter | |
| } | ||
|
|
||
| test("REPLACE TABLE: v1 table") { | ||
| sql(s"CREATE OR REPLACE TABLE tbl (a int) USING ${classOf[SimpleScanSource].getName}") | ||
| val v2Catalog = catalog("spark_catalog").asTableCatalog | ||
| val table = v2Catalog.loadTable(Identifier.of(Array("default"), "tbl")) | ||
| assert(table.properties().get(TableCatalog.PROP_PROVIDER) == classOf[SimpleScanSource].getName) | ||
| val e = intercept[AnalysisException] { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| sql(s"CREATE OR REPLACE TABLE tbl (a int) USING ${classOf[SimpleScanSource].getName}") | ||
| } | ||
| checkError( | ||
| exception = e, | ||
| errorClass = "UNSUPPORTED_FEATURE.TABLE_OPERATION", | ||
| sqlState = "0A000", | ||
| parameters = Map( | ||
| "tableName" -> "`spark_catalog`.`default`.`tbl`", | ||
| "operation" -> "REPLACE TABLE" | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| test("DeleteFrom: - delete with invalid predicate") { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.