beliefer commented on a change in pull request #31245: URL: https://github.com/apache/spark/pull/31245#discussion_r570791022
########## File path: docs/sql-migration-guide.md ########## @@ -40,6 +40,10 @@ license: | - In Spark 3.2, script transform default FIELD DELIMIT is `\u0001` for no serde mode, serde property `field.delim` is `\t` for Hive serde mode when user specifies serde. In Spark 3.1 or earlier, the default FIELD DELIMIT is `\t`, serde property `field.delim` is `\u0001` for Hive serde mode when user specifies serde. - In Spark 3.2, the auto-generated `Cast` (such as those added by type coercion rules) will be stripped when generating column alias names. E.g., `sql("SELECT floor(1)").columns` will be `FLOOR(1)` instead of `FLOOR(CAST(1 AS DOUBLE))`. + + - In Spark 3.2, the output schema of `SHOW TABLES` becomes `namespace: string, tableName: string, isTemporary: boolean`. In Spark 3.1 or earlier, the `namespace` field was named `database` for the builtin catalog, and there is no `isTemporary` field for v2 catalogs. Since Spark 3.2, you can restore the old schema by setting `spark.sql.legacy.keepCommandOutputSchema` to `true`. Review comment: OK ########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala ########## @@ -119,6 +102,34 @@ trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase { assert(errMsg.contains("Database from v1 session catalog is not specified")) } } + + test("SPARK-34157 Unify output of SHOW TABLES and pass output attributes properly") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + sql(s"USE $catalog.ns") + withTable("tbl") { + sql("CREATE TABLE tbl(col1 int, col2 string) USING parquet") + checkAnswer(sql("show tables"), Row("ns", "tbl", false)) + checkAnswer(sql("show tables") + .select(col("namespace"), col("tableName"), col("isTemporary")), Review comment: OK ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org