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

   ## Summary
   
   Stacked on top of #18428 — review only the latest commit (`c6266a33`); the 
rest is from #18428.
   
   The MV transform methods in `JsonExtractScalarTransformFunction` 
(`transformToIntValuesMV` / `transformToLongValuesMV` / 
`transformToFloatValuesMV` / `transformToDoubleValuesMV` / 
`transformToStringValuesMV`) declared their result list as `List<Integer>` / 
`List<Long>` / etc., relying on a direct `result.get(j)` cast. When the 
underlying JSON path resolved to elements of a different runtime type (e.g. a 
`STRING_ARRAY` extraction over a JSON array of numbers, or a numeric array path 
that happens to contain string-form numbers), the cast threw a 
`ClassCastException`.
   
   ## Changes
   
   - **Per-element coercion in MV paths.** Switched each MV result list to 
`List<Object>` and coerced per element, mirroring the SV pattern:
     - `int` / `long` / `float` / `double`: `Number` → primitive narrowing; 
otherwise `parse*(toString())`.
     - `String`: `String` → cast; otherwise 
`JsonUtils.objectToJsonNode(...).toString()`.
   
   - **New `transformToBigDecimalValuesMV`.** `BIG_DECIMAL_ARRAY` result type 
previously fell through to the base class which can't extract from JSON. Uses 
the same coercion pattern with `JSON_PARSER_CONTEXT_WITH_BIG_DECIMAL` to 
preserve precision.
   
   - **`transformToStringValuesMV` switched to 
`JSON_PARSER_CONTEXT_WITH_BIG_DECIMAL`** to match SV-string semantics: `1.0E20` 
now stringifies via BigDecimal canonical form rather than the lossy `Double` 
form.
   
   - **Numeric MV methods stay on the default parser.** Narrowing to `int` / 
`long` / `float` / `double` yields equivalent results within double precision, 
and BigDecimal parsing is several times slower. Mirrors the SV pattern (only 
BigDecimal and String SV use the BigDecimal parser).


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