Jackie-Jiang opened a new pull request, #19591:
URL: https://github.com/apache/pinot/pull/19591
## Summary
`ArrowResponseEncoder` writes `BIG_DECIMAL`, `TIMESTAMP`, `STRING`, `JSON`,
`BYTES`, `UUID` and `OBJECT` columns into a Utf8 vector and casts every value
to `String` on the way in. That holds for the first six: the broker renders
them to `String` (`convertAndFormat` in the single-stage engine,
`format(toExternal(..))` in the multi-stage engine) before the result table
reaches the encoder. It does not hold for `OBJECT`. A single-stage
post-aggregation whose scalar implementation returns `Object` (`CASE`,
`COALESCE`, ...) is typed `OBJECT` by `PostAggregationFunction`, and its values
arrive as whatever the function returned, e.g. a `Long` for `CASE WHEN <cond>
THEN COUNT(*) ... ELSE <long literal> END`. The cast then fails:
```
java.lang.ClassCastException: class java.lang.Long cannot be cast to class
java.lang.String
at
org.apache.pinot.common.response.encoder.ArrowResponseEncoder.createVectorSchemaRoot(ArrowResponseEncoder.java:241)
at
org.apache.pinot.common.response.encoder.ArrowResponseEncoder.encodeResultTable(ArrowResponseEncoder.java:60)
at
org.apache.pinot.broker.grpc.BrokerGrpcServer.submit(BrokerGrpcServer.java:342)
```
`BrokerGrpcServer` passes the exception to `onError`, so the client sees
`io.grpc.StatusRuntimeException: UNKNOWN` with no detail. The same query
succeeds over HTTP and over gRPC with the JSON encoder.
The fix renders the value with `toString()`, which is the identity for the
six already-rendered types and produces the same text a JSON client sees for
numeric `OBJECT` values. The decoder side already reads the vector back as
`String`. A round-trip test for an `OBJECT` column holding a `Long` is added.
This surfaced as a flaky integration test: `ClusterTest.postQuery` picks the
gRPC endpoint and the response encoding from the current time, so queries with
`OBJECT` columns fail only on the runs that land on gRPC + Arrow.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]