aboutsummaryrefslogtreecommitdiff
path: root/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala')
-rw-r--r--sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
index 78ccdc7adb..c82c7f6ca6 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
@@ -110,6 +110,22 @@ class HiveDDLSuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
}
}
+ test("create table and view with comment") {
+ val catalog = hiveContext.sessionState.catalog
+ val tabName = "tab1"
+ withTable(tabName) {
+ sql(s"CREATE TABLE $tabName(c1 int) COMMENT 'BLABLA'")
+ val viewName = "view1"
+ withView(viewName) {
+ sql(s"CREATE VIEW $viewName COMMENT 'no comment' AS SELECT * FROM $tabName")
+ val tableMetadata = catalog.getTableMetadata(TableIdentifier(tabName, Some("default")))
+ val viewMetadata = catalog.getTableMetadata(TableIdentifier(viewName, Some("default")))
+ assert(tableMetadata.properties.get("comment") == Option("BLABLA"))
+ assert(viewMetadata.properties.get("comment") == Option("no comment"))
+ }
+ }
+ }
+
test("drop views") {
withTable("tab1") {
val tabName = "tab1"