yaooqinn commented on a change in pull request #29539:
URL: https://github.com/apache/spark/pull/29539#discussion_r478243790



##########
File path: 
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala
##########
@@ -333,4 +333,31 @@ class SparkMetadataOperationSuite extends 
HiveThriftJdbcTest {
       assert(pos === 17, "all columns should have been verified")
     }
   }
+
+  test("get columns operation should handle interval column properly") {
+    val viewName = "view_interval"
+    val ddl = s"CREATE GLOBAL TEMP VIEW $viewName as select interval 1 day as 
i"
+
+    withJdbcStatement(viewName) { statement =>
+      statement.execute(ddl)
+      val data = statement.getConnection.getMetaData
+      val rowSet = data.getColumns("", "global_temp", viewName, null)
+      while (rowSet.next()) {
+        assert(rowSet.getString("TABLE_CAT") === null)
+        assert(rowSet.getString("TABLE_SCHEM") === "global_temp")
+        assert(rowSet.getString("TABLE_NAME") === viewName)
+        assert(rowSet.getString("COLUMN_NAME") === "i")
+        assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.OTHER)
+        
assert(rowSet.getString("TYPE_NAME").equalsIgnoreCase(CalendarIntervalType.sql))

Review comment:
       I guess that all the meta operations should do nothing else but 
specifically describe how all the objects(database/table /columns etc) stored 
in the Spark system.
   
   
![image](https://user-images.githubusercontent.com/8326978/91415230-50f65400-e880-11ea-9edd-dc26a2ed77cb.png)
   
   If we change the column meta here from INTERVAL to STRING, so the column 
here becomes orderable and comparable?(JDBC users may guess), they may have no 
idea about what they are dealing with and get a completely different awareness 
of the meta-information comparing to those users who use spark-sql 
self-contained applications. 




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to