You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "VojtechMucha (via GitHub)" <gi...@apache.org> on 2026/07/21 15:14:44 UTC
[PR] Jdbc driver support for map and string array column types [pinot]
VojtechMucha opened a new pull request, #19035:
URL: https://github.com/apache/pinot/pull/19035
Instructions:
1. The PR has to be tagged with at least one of the following labels (*):
1. `feature`
2. `bugfix`
3. `performance`
4. `ui`
5. `backward-incompat`
6. `release-notes` (**)
2. Remove these instructions before publishing the PR.
(*) Other labels to consider:
- `testing`
- `dependencies`
- `docker`
- `kubernetes`
- `observability`
- `security`
- `code-style`
- `extension-point`
- `refactor`
- `cleanup`
(**) Use `release-notes` label for scenarios like:
- New configuration options
- Deprecation of configurations
- Signature changes to public methods/interfaces
- New plugins added or old plugins removed
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5908921552
Documentation follow-up: https://github.com/pinot-contrib/pinot-docs/pull/1077 (merged). This describes the JDBC getObject() return types for MAP, arrays, and extended scalar columns.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 merged PR #19035:
URL: https://github.com/apache/pinot/pull/19035
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280648544
> **Major — HTTP vs gRPC MAP return different Java value types** (`PinotResultSet.getMap` vs `PinotGrpcResultSet.getMap`)
>
> HTTP parses with `MAP_READER` (`TypeReference<Map<?,?>>`), so Jackson infers `Integer`/`Long`/`Double`/`Boolean`/`String`. gRPC instead wraps the decoder's already-deserialized map (`new HashMap<>((Map<?,?>) value)`), whose values come from `JsonResponseEncoder.extractValue(JsonNode)` and can be `Short`/`BigInteger`/`Float`/`BigDecimal`. So `getObject` on the same MAP query returns transport-dependent Java types, breaking `equals()` and downstream numeric handling.
>
> This isn't caught by tests: the gRPC MAP test uses only `String`/`Integer` values, and there's no HTTP MAP test at all. Suggest normalizing both paths to the same element typing and adding a mixed-numeric MAP test to both suites.
Both HTTP and gRPC returns the same java Map now and is covered by tests. Note that the map can contain different values (types) than those which are stored in Pinot because the type metadata are not transferred. E.g. if the map contains UUID, we will see it as String on the client side.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5450910599
Thanks for review comments, I tried to address all of them.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230137017
Thanks for adding this — MAP and array support in the JDBC driver is a genuinely useful gap to close, and the implementation is clean: static thread-safe `ObjectReader` reuse, pre-sized lists with plain loops, correct `JAVA_OBJECT`/`List`/`Map` metadata, and `ClassCastException`→`SQLDataException` guards that I verified are safe against both the JSON and Arrow gRPC encoders. The gRPC `getString` refactor also incidentally fixes a latent NPE on null cells.
**Approve with changes** — no hard blockers, but I'd prioritize three correctness/contract items before merge (details inline):
### Major
1. **`UUID_ARRAY` throws a self-contradictory error.** `UUID_ARRAY.isArray()` is `true`, so `getObject` routes it to `getList`, which has no case for it and throws `"Data type is not an array: UUID_ARRAY"` — for a type that *is* an array. Meanwhile `DriverUtils.isArrayDataType("UUID_ARRAY")` returns `true`, so the metadata advertises `List`. Metadata and accessor disagree. Affects both paths.
2. **HTTP vs gRPC MAP return different Java value types.** HTTP binds via Jackson `TypeReference<Map<?,?>>` (→ `Integer`/`Long`/`Double`), while gRPC wraps the decoder's map whose values come from `JsonResponseEncoder.extractValue(JsonNode)` and can be `Short`/`BigInteger`/`Float`/`BigDecimal`. Same query, transport-dependent types — breaks `equals()` and downstream numeric handling.
3. **`getObject` still throws for scalar `BIG_DECIMAL`/`TIMESTAMP`/`JSON`** while `DriverUtils` advertises them. This is *pre-existing* (the old switch behaved the same), so not a regression — but the PR is rebuilding this exact switch and could close it cheaply.
4. **Conversion helpers are duplicated** across the two result sets (`getTimestampList`/`getBytesList` vs `toTimestampList`/`toBytesList`/`toBigDecimalList`) — risk of drift; worth extracting shared helpers.
5. **Test-coverage gaps:** MAP is untested on the HTTP path; there are no negative/error-path tests (bad hex/timestamp/decimal, malformed JSON, unknown type, gRPC non-Map value); and gRPC never tests a null array/map or asserts `wasNull()`.
6. **Nullable-returning helpers lack `@Nullable`** (`getMap`/`getList`/`parseJson`/`getValue` etc.) — project convention is `javax.annotation.Nullable`.
### Minor / nits
- `var stringVal` in `parseJson` is non-idiomatic for this module (use explicit `String`).
- Per-cell `ColumnDataType.valueOf(name)` re-parses an invariant on every `getObject` — could resolve `Map<Integer, ColumnDataType>` once at construction.
- `getList` default message should read `"Unsupported array data type: ..."`.
- The gRPC `getString`→`getValue` refactor is broader than the stated scope (and a good fix) — worth a note in the PR description plus a null-scalar gRPC test.
- Pre-existing, out of scope: `getShort()` in both classes NPEs on SQL NULL (unboxes a null `Integer`).
Nice work overall — happy to re-review once the correctness items are addressed.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5223338286
## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/19035?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:warning: Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`master@00d1c88`). [Learn more](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit) about missing BASE report.
:warning: Report is 131 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #19035 +/- ##
=========================================
Coverage ? 57.11%
Complexity ? 1
=========================================
Files ? 2626
Lines ? 156319
Branches ? 25535
=========================================
Hits ? 89283
Misses ? 59418
Partials ? 7618
```
| [Flag](https://app.codecov.io/gh/apache/pinot/pull/19035/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java-25](https://app.codecov.io/gh/apache/pinot/pull/19035/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.11% <ø> (?)` | |
| [temurin](https://app.codecov.io/gh/apache/pinot/pull/19035/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.11% <ø> (?)` | |
| [unittests](https://app.codecov.io/gh/apache/pinot/pull/19035/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.11% <ø> (?)` | |
| [unittests1](https://app.codecov.io/gh/apache/pinot/pull/19035/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.11% <ø> (?)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/pinot/pull/19035?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5043188682
Sure, done.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "mayankshriv (via GitHub)" <gi...@apache.org>.
mayankshriv commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5037188210
> Based on the Instructions, I should add `feature` label. But it looks like I don't have enough access rights.
Added label, can you update the PR description with actual details about the PR?
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230140259
**Major — duplicated conversion helpers + missing `@Nullable`** (`PinotResultSet` vs `PinotGrpcResultSet`)
`getTimestampList`/`getBytesList` (HTTP) and `toTimestampList`/`toBytesList`/`toBigDecimalList` (gRPC) are near-identical: same sizing, shared `Calendar`, same null guard, same exception wrapping/message. This risks the two drivers drifting. Consider extracting shared `parseTimestamps`/`parseBytes`/`parseBigDecimals(List<String>)` helpers (e.g. in `client/utils`, next to `DateTimeUtils`) with both result sets normalizing raw values to strings and delegating.
Separately: the new helpers (`getMap`/`getList`/`parseJson`/`getValue`, etc.) return `null` as a first-class outcome but carry no `@Nullable`. Please add `javax.annotation.Nullable` per project convention — `getValue` in particular has the `_wasNull` side effect worth documenting.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5833568531
1. gRPC getMap description fixed.
2. TIMESTAMP_ARRAY fixed. Note that this is more like a hot-fix. The problem is wider, query parameters are impacted too, any fractional seconds are truncated. Proper fix is out of scope of this task, I think.
3. pom.xml is fixed, my bad, sorry for that.
- getScalar maps JSON -> getString - yes, it's intended. Other options are:
-- throw SQLDataException as is done now
-- some parsed JsonNode
-- ...?
- getCalculatedScale - moved to `BigDecimalUtils`. Just changing the scope would not work as it was called from a different package (PinotResultSetTest)
- var value = getObject(...) fixed.
Thanks for your review and patience.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280256281
> **Major — `UUID_ARRAY` throws a self-contradictory error** (`PinotResultSet.java` `getList` default, and the same in `PinotGrpcResultSet.java` `getList`)
>
> `ColumnDataType.UUID_ARRAY` is in `ARRAY_TYPES`, so `isArray()` returns `true` and `getObject` dispatches it to `getList`, which has no `UUID_ARRAY` case → `default: throw new SQLDataException("Data type is not an array: UUID_ARRAY")`, which is factually wrong (it _is_ an array). Meanwhile `DriverUtils.isArrayDataType("UUID_ARRAY")` returns `true`, so metadata advertises `Types.JAVA_OBJECT`/`List` while the accessor throws.
>
> Fix: add a `case UUID_ARRAY:` (both decoders yield `String[]`, so treat like `STRING_ARRAY`), or exclude it from `isArrayDataType` so metadata and accessor agree. At minimum reword the default message to `"Unsupported array data type: " + dataType`.
`UUID` types are pretty new. I added both `UUID` and `UUID_ARRAY`.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5306576986
## Re-review of the updated PR
Thanks for the thorough revision — this addresses **all six** items from the previous round:
- ✅ `UUID_ARRAY` now handled (`getUuidList`/`toUuidList`) + tested, and `UUID` scalar added (`Types.OTHER`/`java.util.UUID`)
- ✅ HTTP↔gRPC MAP value-type divergence fixed — gRPC now re-binds through the same untyped `MAP_READER`, with mixed-numeric round-trip tests on both paths
- ✅ Scalar `BIG_DECIMAL`/`TIMESTAMP`/`JSON` now returned by `getObject` + tested
- ✅ Conversion helpers de-duplicated into `AbstractBaseResultSet` (`toTimestampList`/`toBytesList`/`toUuidList`)
- ✅ Negative/error-path, null/`wasNull`, and HTTP-MAP tests all added
- ✅ `@Nullable` applied throughout
Nice structural cleanup pulling the shared `getObject`/scalar/array logic into the base class. A few items from the refactor itself:
### Major
**1. New `abstract` methods widen the contract of a published class.** `AbstractBaseResultSet` is a bare `public abstract class` in the released `org.apache.pinot.client.base` package (no `@InterfaceStability.Internal` / internal-only Javadoc). Adding `getMap`, `getColumnType`, and `getList` as `abstract` is a source-incompatible change — any external subclass will fail to compile against this version. (Demoting `validateState()` from abstract to concrete is the compatible direction and is fine.)
*Options:* give the three new methods default implementations (`getColumnType` → `null`; `getMap`/`getList` → throw `SQLFeatureNotSupportedException`) so existing subclasses keep compiling; **or** mark the class `@InterfaceStability.Internal` / document it as not a supported extension point, and note the source-incompatibility in the PR description / release notes.
### Minor
- **gRPC empty result set regression** — `getColumnType` does `_dataSchema.getColumnDataType(columnIndex - 1)`, but the `empty()` constructor leaves `_dataSchema == null`, so `getObject(...)` now NPEs where the old code threw a descriptive `SQLDataException`. Guard `_dataSchema == null` (or call `validateState()` first).
- **`@Nullable` ordering** — KB C7.6 says `@Nullable` goes *above* `@Override`; the new annotations are ordered `@Override` then `@Nullable` (~12 sites across the three files). Mechanical fix.
- **`@Nullable` consistency** — the abstract `getColumnType(int)` and `getList(int, ColumnDataType)` lack `@Nullable`, while both overrides (and the sibling abstract `getMap`) have it and can return null.
- **`ColumnDataType.get(String)` naming** — the enum's existing static factories are `fromDataType*`; `get(String)` is generic and, unlike `valueOf`, returns `null` on unknown names (also differs from the existing `parseColumnDataType`, which throws a mixed-version-aware error). Consider `forName`/`getByName`. `isArray(String)` is fine.
- **gRPC `getMap` allocates a throwaway String** via `MAP_READER.readValue(JsonUtils.objectToString(value))`; `objectMapper.convertValue(value, ...)` avoids the string intermediate. Client-side, MAP-only.
- **Untested paths:** the moved `getShort(int)` → `(short) getInt(...)` truncation (add in-range + overflow cases), and `getObject(int, Class)` on a null cell (`assertNull`).
- **Pre-existing (not introduced here):** `getScalar` returns boxed `0`/`0L`/`false` for a SQL-NULL numeric/boolean scalar rather than `null` per the JDBC contract — now visibly inconsistent with the null-array path that correctly returns null; and `getAsciiStream`/`getUnicodeStream`/`getCharacterStream` call the now-`@Nullable` `getString(...)` with no null guard → NPE on a NULL cell. Worth a follow-up while this code is being touched.
Net: no blockers. The one item I'd resolve before merge is the widened abstract contract on the published `AbstractBaseResultSet` (default methods, or an explicit internal-only marker + release note). The rest are quick mechanical fixes. Looks close.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5208307370
@xiangfu0 @KKcorps Can you help review this?
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230138032
**Major — `UUID_ARRAY` throws a self-contradictory error** (`PinotResultSet.java` `getList` default, and the same in `PinotGrpcResultSet.java` `getList`)
`ColumnDataType.UUID_ARRAY` is in `ARRAY_TYPES`, so `isArray()` returns `true` and `getObject` dispatches it to `getList`, which has no `UUID_ARRAY` case → `default: throw new SQLDataException("Data type is not an array: UUID_ARRAY")`, which is factually wrong (it *is* an array). Meanwhile `DriverUtils.isArrayDataType("UUID_ARRAY")` returns `true`, so metadata advertises `Types.JAVA_OBJECT`/`List` while the accessor throws.
Fix: add a `case UUID_ARRAY:` (both decoders yield `String[]`, so treat like `STRING_ARRAY`), or exclude it from `isArrayDataType` so metadata and accessor agree. At minimum reword the default message to `"Unsupported array data type: " + dataType`.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280719650
> **Minor / nits**
>
> * `var stringVal = getString(columnIndex)` in `PinotResultSet.parseJson` — `var` is essentially unused in this module (and Pinot main source broadly); prefer explicit `String stringVal = ...`.
> * Per-cell `ColumnDataType.valueOf(name)` on every `getObject` re-parses an invariant — could resolve a `Map<Integer, ColumnDataType>` once at construction (small win, client path).
> * `DriverUtils.isArrayDataType` uses exception-as-control-flow (`valueOf` in try/catch); optional cleanup via a static lookup map.
> * The gRPC `getString` → `getValue` refactor is broader than the stated MAP/array scope — but it's a genuine improvement (old `.toString()` NPE'd on null cells). Worth a line in the PR description plus a null-scalar gRPC test.
> * Pre-existing, out of scope: `getShort()` in both classes autounboxes a possibly-null `Integer` to `short` → NPE on SQL NULL.
I addressed all the minors / nits.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280664959
> **Major (pre-existing gap, cheap to close here) — `getObject` throws for scalar `BIG_DECIMAL` / `TIMESTAMP` / `JSON`** (both `PinotResultSet` and `PinotGrpcResultSet` switches)
>
> The rewritten switch covers STRING/INT/LONG/FLOAT/DOUBLE/BOOLEAN/BYTES/MAP; all other enum constants hit `default: throw`. `DriverUtils.getSQLDataType`/`getJavaClassName` advertise these types (`Types.DECIMAL`/`BigDecimal`, `Types.TIMESTAMP`/`Timestamp`), so metadata promises a value the accessor refuses. The old switch had the same gap, so this is not a regression — but since you're rebuilding the switch it's a cheap fix:
>
> ```java
> case BIG_DECIMAL: return getBigDecimal(columnIndex);
> case TIMESTAMP: return getTimestamp(columnIndex);
> case JSON: return getString(columnIndex);
> ```
>
> If you'd rather keep scope tight, that's reasonable — just call it out explicitly rather than leaving it silent.
Sure, I added these types too.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280692071
> **Major — duplicated conversion helpers + missing `@Nullable`** (`PinotResultSet` vs `PinotGrpcResultSet`)
>
> `getTimestampList`/`getBytesList` (HTTP) and `toTimestampList`/`toBytesList`/`toBigDecimalList` (gRPC) are near-identical: same sizing, shared `Calendar`, same null guard, same exception wrapping/message. This risks the two drivers drifting. Consider extracting shared `parseTimestamps`/`parseBytes`/`parseBigDecimals(List<String>)` helpers (e.g. in `client/utils`, next to `DateTimeUtils`) with both result sets normalizing raw values to strings and delegating.
>
> Separately: the new helpers (`getMap`/`getList`/`parseJson`/`getValue`, etc.) return `null` as a first-class outcome but carry no `@Nullable`. Please add `javax.annotation.Nullable` per project convention — `getValue` in particular has the `_wasNull` side effect worth documenting.
I moved common logic to `AbstractBaseResultSet`.
`Nullable` annotation used now in `AbstractBaseResultSet`, `PinotResultSet`, `PinotGrpcResultSet`.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5280704516
> **Major — test-coverage gaps**
>
> * **MAP is untested on the HTTP path** — the `case MAP:` → `parseJson(MAP_READER)` branch in `PinotResultSet` is never exercised (gRPC covers MAP; HTTP does not).
> * **No negative/error-path tests** on either path: malformed JSON, bad hex (`DecoderException`), bad timestamp (`ParseException`), bad decimal (`NumberFormatException`), unknown type name, and gRPC non-Map value / `ClassCastException` are all vacuously green. Add `assertThrows(SQLDataException.class, ...)` for each.
> * **gRPC null/`wasNull` parity**: the HTTP suite has `testNullAndEmptyArrays` asserting a null array + `wasNull()`, but the gRPC suite only tests empty arrays — never a null array/map, and never asserts `wasNull()`, so gRPC's `getValue()` null bookkeeping is untested.
The test coverage is improved now.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5035802526
Based on the Instructions, I should add `feature` label. But it looks like I don't have enough access rights.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5035808717
Related issue: https://github.com/apache/pinot/issues/19034
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230139014
**Major (pre-existing gap, cheap to close here) — `getObject` throws for scalar `BIG_DECIMAL` / `TIMESTAMP` / `JSON`** (both `PinotResultSet` and `PinotGrpcResultSet` switches)
The rewritten switch covers STRING/INT/LONG/FLOAT/DOUBLE/BOOLEAN/BYTES/MAP; all other enum constants hit `default: throw`. `DriverUtils.getSQLDataType`/`getJavaClassName` advertise these types (`Types.DECIMAL`/`BigDecimal`, `Types.TIMESTAMP`/`Timestamp`), so metadata promises a value the accessor refuses. The old switch had the same gap, so this is not a regression — but since you're rebuilding the switch it's a cheap fix:
```java
case BIG_DECIMAL: return getBigDecimal(columnIndex);
case TIMESTAMP: return getTimestamp(columnIndex);
case JSON: return getString(columnIndex);
```
If you'd rather keep scope tight, that's reasonable — just call it out explicitly rather than leaving it silent.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230140365
**Minor / nits**
- `var stringVal = getString(columnIndex)` in `PinotResultSet.parseJson` — `var` is essentially unused in this module (and Pinot main source broadly); prefer explicit `String stringVal = ...`.
- Per-cell `ColumnDataType.valueOf(name)` on every `getObject` re-parses an invariant — could resolve a `Map<Integer, ColumnDataType>` once at construction (small win, client path).
- `DriverUtils.isArrayDataType` uses exception-as-control-flow (`valueOf` in try/catch); optional cleanup via a static lookup map.
- The gRPC `getString` → `getValue` refactor is broader than the stated MAP/array scope — but it's a genuine improvement (old `.toString()` NPE'd on null cells). Worth a line in the PR description plus a null-scalar gRPC test.
- Pre-existing, out of scope: `getShort()` in both classes autounboxes a possibly-null `Integer` to `short` → NPE on SQL NULL.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230138971
**Major — HTTP vs gRPC MAP return different Java value types** (`PinotResultSet.getMap` vs `PinotGrpcResultSet.getMap`)
HTTP parses with `MAP_READER` (`TypeReference<Map<?,?>>`), so Jackson infers `Integer`/`Long`/`Double`/`Boolean`/`String`. gRPC instead wraps the decoder's already-deserialized map (`new HashMap<>((Map<?,?>) value)`), whose values come from `JsonResponseEncoder.extractValue(JsonNode)` and can be `Short`/`BigInteger`/`Float`/`BigDecimal`. So `getObject` on the same MAP query returns transport-dependent Java types, breaking `equals()` and downstream numeric handling.
This isn't caught by tests: the gRPC MAP test uses only `String`/`Integer` values, and there's no HTTP MAP test at all. Suggest normalizing both paths to the same element typing and adding a mixed-numeric MAP test to both suites.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5230140317
**Major — test-coverage gaps**
- **MAP is untested on the HTTP path** — the `case MAP:` → `parseJson(MAP_READER)` branch in `PinotResultSet` is never exercised (gRPC covers MAP; HTTP does not).
- **No negative/error-path tests** on either path: malformed JSON, bad hex (`DecoderException`), bad timestamp (`ParseException`), bad decimal (`NumberFormatException`), unknown type name, and gRPC non-Map value / `ClassCastException` are all vacuously green. Add `assertThrows(SQLDataException.class, ...)` for each.
- **gRPC null/`wasNull` parity**: the HTTP suite has `testNullAndEmptyArrays` asserting a null array + `wasNull()`, but the gRPC suite only tests empty arrays — never a null array/map, and never asserts `wasNull()`, so gRPC's `getValue()` null bookkeeping is untested.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
Re: [PR] Jdbc driver support for map and string array column types [pinot]
Posted by "VojtechMucha (via GitHub)" <gi...@apache.org>.
VojtechMucha commented on PR #19035:
URL: https://github.com/apache/pinot/pull/19035#issuecomment-5679270787
@xiangfu0, by any chance, would you please be able to find some time to re-review it? I tried to address all of your comments.
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org