ericyangliu commented on code in PR #7516:
URL: https://github.com/apache/kyuubi/pull/7516#discussion_r3418139329
##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/schema/SchemaHelper.scala:
##########
@@ -112,6 +118,7 @@ object SchemaHelper {
case DateType => java.sql.Types.DATE
case TimestampType => java.sql.Types.TIMESTAMP
case ntz if ntz.getClass.getSimpleName.equals(TIMESTAMP_NTZ) =>
java.sql.Types.TIMESTAMP
+ case variant if variant.getClass.getSimpleName.equals(VARIANT) =>
java.sql.Types.VARCHAR
Review Comment:
@pan3793 Thanks for the quick review!
I checked the JDBC metadata behavior against other implementations and
updated this path.
For `DatabaseMetaData.getColumns`, `VariantType` now reports
`java.sql.Types.OTHER`, which is
consistent with Databricks JDBC’s `VARIANT` mapping and avoids presenting
semi-structured data as
plain `VARCHAR`. Trino’s JSON-like types also use non-`VARCHAR` JDBC type
codes. Hive JDBC does not
have a native `VARIANT` mapping.
I kept `TTypeId.STRING_TYPE` for HiveServer2 result-set metadata because
the Thrift enum has no
native `VARIANT`/`OTHER` type, and Kyuubi still needs a concrete type that
clients can fetch/render.
Please let me know if you have other concerns.
--
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]