Jackie-Jiang opened a new pull request, #19029:
URL: https://github.com/apache/pinot/pull/19029

   ## Summary
   
   `jsonPathString` (and its fast variants `jsonPathStringFast` / 
`jsonPathStringFirstMatch`) stringified any non-`String` resolved value via 
`JsonUtils.objectToString`. Jackson serializes several non-JSON-native Java 
types — notably `java.util.UUID` — as a *quoted* JSON string, so extracting 
such a value produced a double-quoted result. For example, an Avro `uuid` 
logical-type field extracted with `JSONPATHSTRING(after, '$.customer_id')` 
yielded `"657ae8f8-..."` (with literal quotes) instead of the bare UUID.
   
   These types never arise from parsing a JSON string (Jackson only yields 
`Boolean` / `Integer` / `Long` / `Double` / `String` / `null` / `List` / 
`Map`); they only appear when the function operates on an already-materialized 
record tree — e.g. an ingestion transform reading an extractor-produced value.
   
   ### Fix
   
   All entry points now route the resolved value through a shared 
`jsonValueToString` helper:
   
   - `String` → returned verbatim (unquoted).
   - `UUID` / `LocalDate` / `LocalTime` — the non-JSON-native scalars a record 
extractor can materialize, which `objectToString` would wrap in quotes — render 
via their natural canonical / ISO-8601 `toString`.
   - Everything else — `Number`, `Boolean`, `Timestamp` (portable epoch 
millis), `byte[]`, and `Map` / `Collection` / array containers — continues 
through `JsonUtils.objectToString`.
   
   This keeps `jsonPathString` consistent with the query-time 
`jsonExtractScalar` on every value the query path can produce; the only 
deliberate divergences are the three quote-stripping overrides for types 
`jsonExtractScalar` never encounters.
   
   ### Compatibility note
   
   This changes the observable output of the released `jsonPathString*` scalar 
functions for `UUID` / `LocalDate` / `LocalTime` leaves (old: JSON-quoted / 
Jackson-default form; new: unquoted canonical form). The window is narrow — 
these types only occur on already-materialized record trees, not JSON-string 
input — but during a rolling upgrade a mixed-version cluster can briefly return 
both forms, and previously-persisted derived-column values will differ from 
newly-ingested ones. The new form is the intended correctness fix, so no 
version gate is added.
   


-- 
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]

Reply via email to