Jackie-Jiang commented on code in PR #13490:
URL: https://github.com/apache/pinot/pull/13490#discussion_r1659410652


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/recordtransformer/ComplexTypeTransformer.java:
##########
@@ -173,10 +173,20 @@ private static Map<String, String> 
parsePrefixesToRename(TableConfig tableConfig
   @Override
   public GenericRow transform(GenericRow record) {
     try {
+      GenericRow originalRow = _fieldsToUnnest.isEmpty() ? null : 
record.copy(_fieldsToUnnest);
       flattenMap(record, new 
ArrayList<>(record.getFieldToValueMap().keySet()));
-      for (String collection : _fieldsToUnnest) {
-        unnestCollection(record, collection);
+      for (String field : _fieldsToUnnest) {
+        unnestCollection(record, field);
       }
+      Object unnestedRows = record.getValue(GenericRow.MULTIPLE_RECORDS_KEY);
+      if (unnestedRows != null && unnestedRows instanceof Collection) {

Review Comment:
   You might also want to have a null check on `originalRow`



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to