HyukjinKwon commented on a change in pull request #33393:
URL: https://github.com/apache/spark/pull/33393#discussion_r672725073
##########
File path:
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala
##########
@@ -660,4 +660,29 @@ class SparkMetadataOperationSuite extends
HiveThriftServer2TestBase {
assert(!metaData.supportsRefCursors)
}
}
+
+ test("SPARK-36179: get column operation support TIMESTAMP_[N|L]TZ") {
+ val t = "t_ltz_ntz"
+ // TODO: (SPARK-36180) add hive table here too
Review comment:
nit ..
```suggestion
// TODO(SPARK-36180): add hive table here too
```
##########
File path:
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala
##########
@@ -660,4 +660,29 @@ class SparkMetadataOperationSuite extends
HiveThriftServer2TestBase {
assert(!metaData.supportsRefCursors)
}
}
+
+ test("SPARK-36179: get column operation support TIMESTAMP_[N|L]TZ") {
+ val t = "t_ltz_ntz"
+ // TODO: (SPARK-36180) add hive table here too
+ val ddl = s"CREATE GLOBAL TEMP VIEW $t as SELECT TIMESTAMP_LTZ '2018-11-17
13:33:33.000'" +
+ s" as c0, TIMESTAMP_NTZ '2018-11-17 13:33:33.000' as c1"
Review comment:
```suggestion
" as c0, TIMESTAMP_NTZ '2018-11-17 13:33:33.000' as c1"
```
##########
File path:
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala
##########
@@ -660,4 +660,29 @@ class SparkMetadataOperationSuite extends
HiveThriftServer2TestBase {
assert(!metaData.supportsRefCursors)
}
}
+
+ test("SPARK-36179: get column operation support TIMESTAMP_[N|L]TZ") {
+ val t = "t_ltz_ntz"
+ // TODO: (SPARK-36180) add hive table here too
+ val ddl = s"CREATE GLOBAL TEMP VIEW $t as SELECT TIMESTAMP_LTZ '2018-11-17
13:33:33.000'" +
+ s" as c0, TIMESTAMP_NTZ '2018-11-17 13:33:33.000' as c1"
+ withJdbcStatement(t) { statement =>
+ statement.execute(ddl)
+ val md = statement.getConnection.getMetaData
+ val rowSet = md.getColumns(null, "global_temp", t, "%")
+
+ var idx = 0
+ while (rowSet.next()) {
+ assert(rowSet.getString("COLUMN_NAME") === "c" + idx)
+ assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.TIMESTAMP)
+ assert(rowSet.getString("TYPE_NAME") === "TIMESTAMP" + "_NTZ" * idx)
Review comment:
```suggestion
assert(rowSet.getString("TYPE_NAME") === "TIMESTAMP" + ("_NTZ" *
idx))
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]