LakshSingla commented on a change in pull request #12259:
URL: https://github.com/apache/druid/pull/12259#discussion_r811429743
##########
File path:
core/src/main/java/org/apache/druid/data/input/IntermediateRowParsingReader.java
##########
@@ -93,51 +111,126 @@ public InputRow next()
@Override
public void close() throws IOException
{
- intermediateRowIterator.close();
+ intermediateRowIteratorWithMetadata.close();
}
};
}
@Override
public CloseableIterator<InputRowListPlusRawValues> sample() throws
IOException
{
- return intermediateRowIterator().map(row -> {
- final List<Map<String, Object>> rawColumnsList;
- try {
- rawColumnsList = toMap(row);
- }
- catch (Exception e) {
- return InputRowListPlusRawValues.of(null,
- new
ParseException(String.valueOf(row), e, "Unable to parse row [%s] into JSON",
row));
- }
+ final CloseableIteratorWithMetadata<T> delegate =
intermediateRowIteratorWithMetadata();
+ final BiFunction<T, Map<String, Object>, InputRowListPlusRawValues>
samplingFunction =
+ (row, metadata) -> {
Review comment:
The function uses `toMap` which is overridden in the subclasses, so
creating a new non-static method
--
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]