xiangfu0 commented on code in PR #19996:
URL: https://github.com/apache/pinot/pull/19996#discussion_r4343154908
##########
pinot-spi/src/main/java/org/apache/pinot/spi/data/readers/ColumnReader.java:
##########
@@ -188,6 +189,23 @@ boolean isNull(int docId)
Object getValue(int docId)
throws IOException;
+ /// Applies the supplied deterministic JSON converter to the value at the
given document id. By default, returns
+ /// `jsonTransformer.transform(getValue(docId))`, passing null values to the
converter as well.
+ ///
+ /// Readers may override this method to avoid materializing repeated raw
values or to reuse immutable conversion
+ /// results. Overrides must preserve the conversion result, including nulls
and conversion failures; callers must not
+ /// depend on the converter's invocation count. This method does not change
[#getValue(int)] or the typed accessors.
+ /// Callers remain responsible for applying this conversion in the correct
order relative to other transformations.
+ ///
+ /// @param docId 0-based document id, from 0 (inclusive) to
[#getTotalDocs()] (exclusive)
+ /// @param jsonTransformer deterministic converter to the column's JSON
representation
+ /// @throws IOException if an I/O error occurs while reading
+ @Nullable
+ default Object getJsonValue(int docId, ColumnTransformer jsonTransformer)
Review Comment:
Renamed this to `getTransformedValue(int docId, ColumnTransformer
transformer)` in 6dee3f4005 and documented it as a generic deterministic
transformation hook. The existing test cases now include a non-JSON conversion
while retaining null and exception propagation coverage; all 9 tests pass.
--
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]