[GitHub] arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add type conversion to row writers

2019-01-28 Thread GitBox
arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add 
type conversion to row writers
URL: https://github.com/apache/drill/pull/1623#discussion_r251408134
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/PrimitiveColumnMetadata.java
 ##
 @@ -23,16 +23,53 @@
 import org.apache.drill.common.types.Types;
 import org.apache.drill.exec.expr.TypeHelper;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.vector.accessor.ColumnConversionFactory;
 
 /**
  * Primitive (non-map) column. Describes non-nullable, nullable and
  * array types (which differ only in mode, but not in metadata structure.)
+ * 
+ * Metadata is of two types:
+ * 
+ * Storage metadata that describes how the is materialized in a
+ * vector. Storage metadata is immutable because revising an existing
+ * vector is a complex operation.
+ * Supplemental metadata used when reading or writing the column.
+ * Supplemental metadata can be changed after the column is created,
+ * though it should generally be set before invoking code that uses
+ * the metadata.
+ * 
  */
 
 public class PrimitiveColumnMetadata extends AbstractColumnMetadata {
 
+  /**
+   * Expected (average) width for variable-width columns.
+   */
+
   private int expectedWidth;
 
+  /**
+   * Default value to use for filling a vector when no real data is
+   * available, such as for columns added in new files but which does not
+   * exist in existing files. The "default default" is null, which works
 
 Review comment:
   `"default default"` -> `"default value"`?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add type conversion to row writers

2019-01-28 Thread GitBox
arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add 
type conversion to row writers
URL: https://github.com/apache/drill/pull/1623#discussion_r251409042
 
 

 ##
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/PrimitiveColumnMetadata.java
 ##
 @@ -23,16 +23,53 @@
 import org.apache.drill.common.types.Types;
 import org.apache.drill.exec.expr.TypeHelper;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.vector.accessor.ColumnConversionFactory;
 
 /**
  * Primitive (non-map) column. Describes non-nullable, nullable and
  * array types (which differ only in mode, but not in metadata structure.)
+ * 
+ * Metadata is of two types:
+ * 
+ * Storage metadata that describes how the is materialized in a
 
 Review comment:
   `describes how the is materialized` -> column?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add type conversion to row writers

2019-01-28 Thread GitBox
arina-ielchiieva commented on a change in pull request #1623: DRILL-7006: Add 
type conversion to row writers
URL: https://github.com/apache/drill/pull/1623#discussion_r251413842
 
 

 ##
 File path: 
exec/vector/src/main/java/org/apache/drill/exec/vector/accessor/writer/ScalarArrayWriter.java
 ##
 @@ -60,13 +60,17 @@
 public final void nextElement() { next(); }
   }
 
-  private final BaseScalarWriter elementWriter;
+  private final ConcreteWriter elementWriter;
 
   public ScalarArrayWriter(ColumnMetadata schema,
   RepeatedValueVector vector, BaseScalarWriter elementWriter) {
 super(schema, vector.getOffsetVector(),
 new ScalarObjectWriter(elementWriter));
-this.elementWriter = elementWriter;
+
+// Save the writer from the scalar object writer created above
+// which may have wrapped the element writer in a type convertor.
+
+this.elementWriter = (ConcreteWriter) elementObjWriter.scalar();
 
 Review comment:
   Is it ok to do the cast here?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services