ihuzenko commented on a change in pull request #1945: DRILL-7502: Invalid 
codegen for typeof() with UNION
URL: https://github.com/apache/drill/pull/1945#discussion_r362891731
 
 

 ##########
 File path: exec/vector/src/main/codegen/templates/UnionReader.java
 ##########
 @@ -31,28 +34,33 @@
 /*
  * This class is generated using freemarker and the ${.template_name} template.
  */
-@SuppressWarnings("unused")
 public class UnionReader extends AbstractFieldReader {
 
-  private BaseReader[] readers = new BaseReader[45];
+  private static final int TYPE_COUNT = Types.typeCount();
+  private BaseReader[] readers = new BaseReader[TYPE_COUNT];
   public UnionVector data;
-  
+
   public UnionReader(UnionVector data) {
     this.data = data;
   }
 
-  private static MajorType[] TYPES = new MajorType[45];
+  private static MajorType[] TYPES = new MajorType[TYPE_COUNT];
 
 Review comment:
   can be final?

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


With regards,
Apache Git Services

Reply via email to