You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/07/24 00:13:41 UTC

[GitHub] [incubator-pinot] snleee commented on a change in pull request #5746: Fix code to correctly extract value of multi-value column from avro file

snleee commented on a change in pull request #5746:
URL: https://github.com/apache/incubator-pinot/pull/5746#discussion_r459795372



##########
File path: pinot-plugins/pinot-input-format/pinot-avro-base/src/main/java/org/apache/pinot/plugin/inputformat/avro/AvroUtils.java
##########
@@ -353,16 +353,6 @@ public static Object handleMap(Map map) {
    * Handles the conversion of every field of the GenericRecord
    */
   private static Object handleGenericRecord(GenericData.Record record) {
-    List<Field> fields = record.getSchema().getFields();
-    if (fields.isEmpty()) {
-      return null;
-    }
-
-    Map<Object, Object> convertedMap = new HashMap<>();
-    for (Field field : fields) {
-      String fieldName = field.name();
-      convertedMap.put(fieldName, convert(record.get(fieldName)));
-    }
-    return convertedMap;
+    return record.get(0);

Review comment:
       I'm not sure if this is a valid fix. According to the comment instruction,
   
   ```
   Converts the value to either a single value (string, number, bytebuffer), multi value (Object[]) or a Map
   Natively Pinot only understands single values and multi values.
   Map is useful only if some ingestion transform functions operates on it in the transformation layer.
   ```
   
   Don't we need to follow the above conversion in case of `GenericData.Record`?




----------------------------------------------------------------
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.

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



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