[GitHub] [spark] HyukjinKwon commented on a change in pull request #31245: [SPARK-34157][SQL] Unify output of SHOW TABLES and pass output attributes properly

2021-02-08 Thread GitBox


HyukjinKwon commented on a change in pull request #31245:
URL: https://github.com/apache/spark/pull/31245#discussion_r572020314



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##
@@ -119,6 +101,32 @@ 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))
+assert(sql("show tables").schema.fieldNames.deep ==
+  Seq("namespace", "tableName", "isTemporary"))
+assert(sql("show table extended like 'tbl'").collect()(0).length == 4)
+assert(sql("show table extended like 'tbl'").schema.fieldNames.deep ==

Review comment:
   Seems like this broke Scala 2.13 build. I made a followup here

##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##
@@ -119,6 +101,32 @@ 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))
+assert(sql("show tables").schema.fieldNames.deep ==
+  Seq("namespace", "tableName", "isTemporary"))
+assert(sql("show table extended like 'tbl'").collect()(0).length == 4)
+assert(sql("show table extended like 'tbl'").schema.fieldNames.deep ==

Review comment:
   Seems like this broke Scala 2.13 build. I made a followup here 
https://github.com/apache/spark/pull/31526





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



[GitHub] [spark] HyukjinKwon commented on a change in pull request #31245: [SPARK-34157][SQL] Unify output of SHOW TABLES and pass output attributes properly

2021-02-08 Thread GitBox


HyukjinKwon commented on a change in pull request #31245:
URL: https://github.com/apache/spark/pull/31245#discussion_r572020055



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala
##
@@ -119,6 +101,32 @@ 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") {

Review comment:
   Let's keep the format consistent next time: `SPARK-34157 :`





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



[GitHub] [spark] HyukjinKwon commented on a change in pull request #31245: [SPARK-34157][SQL] Unify output of SHOW TABLES and pass output attributes properly

2021-01-19 Thread GitBox


HyukjinKwon commented on a change in pull request #31245:
URL: https://github.com/apache/spark/pull/31245#discussion_r560597194



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
##
@@ -33,6 +33,7 @@ import 
org.apache.spark.sql.catalyst.analysis.{FunctionRegistry, NoSuchDatabaseE
 import org.apache.spark.sql.catalyst.catalog._
 import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec
 import org.apache.spark.sql.connector.catalog.SupportsNamespaces.PROP_OWNER
+import org.apache.spark.sql.functions._

Review comment:
   Let's avoid wildcard import.





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



[GitHub] [spark] HyukjinKwon commented on a change in pull request #31245: [SPARK-34157][SQL] Unify output of SHOW TABLES and pass output attributes properly

2021-01-19 Thread GitBox


HyukjinKwon commented on a change in pull request #31245:
URL: https://github.com/apache/spark/pull/31245#discussion_r560596965



##
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
##
@@ -2013,6 +2014,19 @@ abstract class DDLSuite extends QueryTest with 
SQLTestUtils {
 }
   }
 
+  test("SPARK-34157 Unify output of SHOW TABLES and pass output attributes 
properly") {
+withTable("tbl") {
+  sql("CREATE TABLE tbl(col1 int, col2 string) USING parquet ")

Review comment:
   @beliefer, do you mind showing the output before after this PR in the PR 
description? it would be much easier to review and follow what change you're 
proposing.





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