xiangfu0 commented on code in PR #9377:
URL: https://github.com/apache/pinot/pull/9377#discussion_r967902186
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/ComplexTypeTransformer.java:
##########
@@ -163,11 +172,20 @@ private static Map<String, String>
parsePrefixesToRename(TableConfig tableConfig
@Override
public GenericRow transform(GenericRow record) {
- flattenMap(record, new ArrayList<>(record.getFieldToValueMap().keySet()));
- for (String collection : _fieldsToUnnest) {
- unnestCollection(record, collection);
+ try {
Review Comment:
cc: @Jackie-Jiang I remember you mentioned that try-catch will impact the
performance? shall do if-else check first?
Codewise I think this is simpler.
```
if (_continueOnError) {
flattenMap(record, new
ArrayList<>(record.getFieldToValueMap().keySet()));
for (String collection : _fieldsToUnnest) {
unnestCollection(record, collection);
}
} else {
try {
flattenMap(record, new
ArrayList<>(record.getFieldToValueMap().keySet()));
for (String collection : _fieldsToUnnest) {
unnestCollection(record, collection);
}
} catch (Exception e) {
record.putValue(GenericRow.INCOMPLETE_RECORD_KEY, true);
LOGGER.debug("Caught exception while transforming complex types for
record: {}", record.toString(), e);
}
}
```
Or this try-catch?
--
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]