Github user liancheng commented on a diff in the pull request: https://github.com/apache/spark/pull/12703#discussion_r61185701 --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala --- @@ -247,4 +259,105 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto hiveContext.sessionState.hadoopConf.set("fs.default.name", originalFsName) } } + + test("show columns") { + checkAnswer( + sql("SHOW COLUMNS IN parquet_tab3"), + Row("col1") :: Row("col 2") :: Nil) + + checkAnswer( + sql("SHOW COLUMNS IN default.parquet_tab3"), + Row("col1") :: Row("col 2") :: Nil) + + checkAnswer( + sql("SHOW COLUMNS IN parquet_tab3 FROM default"), + Row("col1") :: Row("col 2") :: Nil) + + checkAnswer( + sql("SHOW COLUMNS IN parquet_tab4 IN default"), + Row("price") :: Row("qty") :: Row("year") :: Row("month") :: Nil) + + val message = intercept[NoSuchTableException] { + sql("SHOW COLUMNS IN badtable FROM default") + }.getMessage + assert(message.contains("badtable not found in database")) + } + + test("show partitions - show everything") { + checkAnswer( + sql("show partitions parquet_tab4"), + Row("year=2015/month=1") :: + Row("year=2015/month=2") :: + Row("year=2016/month=2") :: + Row("year=2016/month=3") :: Nil) + + checkAnswer( + sql("show partitions default.parquet_tab4"), + Row("year=2015/month=1") :: + Row("year=2015/month=2") :: + Row("year=2016/month=2") :: + Row("year=2016/month=3") :: Nil) + } + --- End diff -- Oh yea, I should add that. Thanks!
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org