drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [drill] arina-ielchiieva commented on a change in pull request #1690: DRILL-7086: Output schema for row set mechanism
Date Tue, 12 Mar 2019 13:53:15 GMT
arina-ielchiieva commented on a change in pull request #1690: DRILL-7086: Output schema for
row set mechanism
URL: https://github.com/apache/drill/pull/1690#discussion_r264650992
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/record/metadata/AbstractColumnMetadata.java
 ##########
 @@ -204,63 +184,78 @@ public void setExpectedElementCount(int childCount) {
     // makes an error.
 
     if (isArray()) {
-      expectedElementCount = Math.max(1, childCount);
+      PropertyAccessor.set(this, EXPECTED_CARDINALITY_PROP, Math.max(1, childCount));
     }
   }
 
   @Override
-  public int expectedElementCount() { return expectedElementCount; }
+  public int expectedElementCount() {
+    if (isArray()) {
+      return PropertyAccessor.getInt(this, EXPECTED_CARDINALITY_PROP, DEFAULT_ARRAY_SIZE);
+    } else {
+      return 1;
+    }
+  }
 
   @Override
   public void setProjected(boolean projected) {
-    this.projected = projected;
+    if (projected) {
+      // Projected is the default
+      setProperty(PROJECTED_PROP, null);
+    } else {
+      PropertyAccessor.set(this, PROJECTED_PROP, projected);
+    }
   }
 
   @Override
-  public boolean isProjected() { return projected; }
-
-  @Override
-  public void setFormatValue(String value) { }
+  public boolean isProjected() {
+    return PropertyAccessor.getBoolean(this, PROJECTED_PROP, true);
+  }
 
-  @JsonProperty("format")
   @Override
-  public String formatValue() { return null; }
+  public void setFormat(String value) {
+    setProperty(FORMAT_PROP, value);
+  }
 
   @Override
-  public void setDefaultValue(Object value) { }
+  public String format() {
+    return property(FORMAT_PROP);
+  }
 
   @Override
-  public Object defaultValue() { return null; }
+  public DateTimeFormatter dateTimeFormatter() {
+    throw new UnsupportedOperationException();
+  }
 
   @Override
-  public void setDefaultFromString(String value) { }
+  public void setDefaultValue(String value) {
+    setProperty(DEFAULT_VALUE_PROP, value);
+  }
 
-  @JsonProperty("default")
   @Override
-  public String defaultStringValue() {
-    return null;
+  public String defaultValue() {
+    return property(DEFAULT_VALUE_PROP);
   }
 
   @Override
-  public void setTypeConverter(ColumnConversionFactory factory) {
-    throw new UnsupportedConversionError("Type conversion not supported for non-scalar writers");
+  public Object decodeDefaultValue() {
+    return valueFromString(defaultValue());
   }
 
   @Override
-  public ColumnConversionFactory typeConverter() { return null; }
+  public Object valueFromString(String value) {
+    throw new UnsupportedOperationException();
 
 Review comment:
   Please add some error message.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message