j1wonpark commented on PR #56447: URL: https://github.com/apache/spark/pull/56447#issuecomment-4686873917
Thanks @pan3793! Surveyed Trino, pgjdbc, and Databricks (databricks-jdbc OSS) in addition to Hive. All current drivers map ARRAY to `Types.ARRAY`, and MAP to `Types.JAVA_OBJECT` since JDBC has no `Types.MAP` (Hive, Trino), so this PR follows that. The only divergence is STRUCT: Trino maps ROW to `JAVA_OBJECT`, arguably because `Types.STRUCT` was designed for named UDTs - which Spark's anonymous STRUCT isn't either. I still chose `Types.STRUCT` because with `JAVA_OBJECT`, MAP and STRUCT become indistinguishable by type code (in Trino, both report 2000 and clients must parse the type name string to tell them apart), and 2002 matches what Hive JDBC reports for struct columns, so type-code-based dispatch in existing clients keeps working. Also added nested type cases (`ARRAY<STRUCT>`, `MAP<STRING, ARRAY<INT>>`, `STRUCT` containing `MAP`) to the UT. -- 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]
