Peng-Lei commented on a change in pull request #35131:
URL: https://github.com/apache/spark/pull/35131#discussion_r781193277
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
##########
@@ -2899,6 +2899,39 @@ class DataSourceV2SQLSuite
}
}
+ test("SPARK-37827: put build-in properties into V1Table.properties to adapt
v2 command") {
+ val t = "tbl"
+ withTable(t) {
+ sql(
+ s"""
+ |CREATE TABLE $t (
+ | a bigint,
+ | b bigint
+ |)
+ |using parquet
+ |OPTIONS (
+ | from = 0,
+ | to = 1)
+ |COMMENT 'This is a comment'
+ |TBLPROPERTIES ('prop1' = '1', 'prop2' = '2')
+ |PARTITIONED BY (a)
+ |LOCATION '/tmp'
+ """.stripMargin)
+
+ val table =
spark.sessionState.catalogManager.v2SessionCatalog.asTableCatalog
+ .loadTable(Identifier.of(Array("default"), t))
+ val properties = table.properties
+ assert(properties.get(TableCatalog.PROP_PROVIDER) == "parquet")
+ assert(properties.get(TableCatalog.PROP_COMMENT) == "This is a comment")
+ assert(properties.get(TableCatalog.PROP_LOCATION) == "file:/tmp")
+ assert(properties.get(TableCatalog.PROP_OWNER) ==
Utils.getCurrentUserName())
Review comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]