Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/3057#discussion_r223892664
  
    --- Diff: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/hadoop/hive/ql/io/orc/NiFiOrcUtils.java
 ---
    @@ -163,19 +161,30 @@ public static Object convertToORCObject(TypeInfo 
typeInfo, Object o, final boole
                             .mapToObj((element) -> 
convertToORCObject(TypeInfoFactory.getPrimitiveTypeInfo("boolean"), element == 
1, hiveFieldNames))
                             .collect(Collectors.toList());
                 }
    -            if (o instanceof GenericData.Array) {
    -                GenericData.Array array = ((GenericData.Array) o);
    -                // The type information in this case is interpreted as a 
List
    -                TypeInfo listTypeInfo = ((ListTypeInfo) 
typeInfo).getListElementTypeInfo();
    -                return array.stream().map((element) -> 
convertToORCObject(listTypeInfo, element, 
hiveFieldNames)).collect(Collectors.toList());
    -            }
                 if (o instanceof List) {
                     return o;
                 }
    +            if (o instanceof Record) {
    --- End diff --
    
    This is actually the part that fixes the nested records issue. The rest is 
that from the Record, we can only get RecordSchema info, where the original 
util methods required Avro schema/type info. The other changes are a 
consequence of this, to replace Avro-specific stuff with NiFi Record API stuff.


---

Reply via email to