You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "j1wonpark (via GitHub)" <gi...@apache.org> on 2026/06/15 08:22:07 UTC
Re: [PR] [SPARK-57380][CONNECT] Support complex types (ARRAY, MAP, STRUCT) in the Connect JDBC driver [spark]
j1wonpark commented on PR #56447:
URL: https://github.com/apache/spark/pull/56447#issuecomment-4705954077
@pan3793 update on this — the `getString` framing above turned out to be the wrong layer for BI tools.
I traced the calls with a diagnostic build. DataGrip (2026.1.2) calls **both** `getObject` and `getString` for a complex-typed cell, but the value rendered in the grid is `getObject().toString()`: even with `getString` already returning JSON, the cell showed `[1,hello]` / `ArraySeq(1, 2, 3)` / `Map(k -> v)`. DBeaver (open source) confirms the same direction — it dispatches on the `java.sql.Types` code from `getColumnType`, calls `getObject`, and expands `java.sql.Array` / `java.sql.Struct` via `getArray()` / `Struct.getAttributes()`, falling back to `toString()` otherwise (`JDBCArrayValueHandler` / `JDBCStructValueHandler`).
So the fix belongs in `getObject`, not `getString`. Folded into this PR (no separate JIRA): `getObject` returns `java.sql.Array` / `java.sql.Struct` (MAP → `java.util.Map`), `getArray()` is implemented, and each value renders JSON from `toString` (because some tools display `getObject().toString()` directly). `getString` still renders JSON as a fallback. Description updated.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org