pavibhai commented on a change in pull request #635:
URL: https://github.com/apache/orc/pull/635#discussion_r578853891



##########
File path: java/core/src/java/org/apache/orc/impl/TreeReaderFactory.java
##########
@@ -2854,11 +2924,19 @@ public static TypeReader 
createTreeReader(TypeDescription readerType,
     }
   }
 
+  public static boolean isDecimalAsLong(OrcFile.Version version, int 
precision) {
+    return version == OrcFile.Version.UNSTABLE_PRE_2_0 &&
+    precision <= TypeDescription.MAX_DECIMAL64_PRECISION;
+  }
+
   public static BatchReader createRootReader(TypeDescription readerType, 
Context context)
           throws IOException {
     TypeReader reader = createTreeReader(readerType, context);
     if (reader instanceof StructTreeReader) {
-      return new StructBatchReader((StructTreeReader) reader, context);
+      return new StructBatchReader(reader, context);
+    } else if (reader instanceof LevelTypeReader
+               && ((LevelTypeReader)reader).getReader() instanceof 
StructTreeReader) {
+      return new LevelStructBatchReader((LevelTypeReader) reader, context);

Review comment:
       I understand the concern regarding doubling the type readers. I don't 
quite understand the suggestion on how to circumvent that.
   
   One possibility I do see is that instead of having the conditional code 
within LevelTypeReader we include that into each of the Readers directly, it 
will be duplicated but you will have a single reference.




----------------------------------------------------------------
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:
[email protected]


Reply via email to