This is an automated email from the ASF dual-hosted git repository. wenchen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 7954a91 [SPARK-37031][SQL][TESTS][FOLLOWUP] Add a missing test to DescribeNamespaceSuite 7954a91 is described below commit 7954a91d76b5f60234b2f8628c0330a65653297a Author: Terry Kim <yumin...@gmail.com> AuthorDate: Wed Oct 27 15:28:19 2021 +0800 [SPARK-37031][SQL][TESTS][FOLLOWUP] Add a missing test to DescribeNamespaceSuite ### What changes were proposed in this pull request? This PR proposes to add a missing test on "keeping the legacy output schema" to `DescribeNamespaceSuite`. (#31705 didn't seem to add it). ### Why are the changes needed? To increase the test coverage. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added a new test. Closes #34399 from imback82/SPARK-37031-followup. Authored-by: Terry Kim <yumin...@gmail.com> Signed-off-by: Wenchen Fan <wenc...@databricks.com> --- .../execution/command/v1/DescribeNamespaceSuite.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala index a86e4a5..e97f0c5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeNamespaceSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.command.v1 import org.apache.spark.sql.Row import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf /** * This base suite contains unified tests for the `DESCRIBE NAMESPACE` command that checks V1 @@ -50,6 +51,23 @@ trait DescribeNamespaceSuiteBase extends command.DescribeNamespaceSuiteBase { assert(result(3) === Row("Properties", "")) } } + + test("Keep the legacy output schema") { + Seq(true, false).foreach { keepLegacySchema => + withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> keepLegacySchema.toString) { + val ns = "db1" + withNamespace(ns) { + sql(s"CREATE NAMESPACE $ns") + val schema = sql(s"DESCRIBE NAMESPACE $ns").schema.fieldNames.toSeq + if (keepLegacySchema) { + assert(schema === Seq("database_description_item", "database_description_value")) + } else { + assert(schema === Seq("info_name", "info_value")) + } + } + } + } + } } /** --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org