arina-ielchiieva commented on a change in pull request #1726: DRILL-7143: 
Support default value for empty columns
URL: https://github.com/apache/drill/pull/1726#discussion_r272136201
 
 

 ##########
 File path: exec/vector/src/main/codegen/templates/ColumnAccessors.java
 ##########
 @@ -302,97 +350,70 @@ public final Instant getTimestamp() {
     <#if varWidth>
   public static class ${drillType}ColumnWriter extends BaseVarWidthWriter {
     <#else>
+      <#if intType>
+  public static class ${drillType}ColumnWriter extends BaseIntWriter {
+      <#else>
   public static class ${drillType}ColumnWriter extends BaseFixedWidthWriter {
+      </#if>
 
     private static final int VALUE_WIDTH = ${drillType}Vector.VALUE_WIDTH;
     </#if>
 
     private final ${drillType}Vector vector;
     <#if drillType == "VarDecimal">
+    private int precision;
     private int scale;
     <#elseif decimal>
     private MajorType type;
     </#if>
 
     public ${drillType}ColumnWriter(final ValueVector vector) {
-      <#if varWidth>
+    <#if varWidth>
       super(((${drillType}Vector) vector).getOffsetVector());
-      <#else>
-      </#if>
-      <#if drillType == "VarDecimal">
+    </#if>
+    <#if drillType == "VarDecimal">
       // VarDecimal requires a scale. If not set, assume 0
       MajorType type = vector.getField().getType();
+      precision = type.hasPrecision() ? type.getPrecision() : 9;
 
 Review comment:
   Replace 9 with 38, Drill current behavior is to set default 38 when no 
precision is available.
   
   

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