You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/07/12 02:51:47 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #5980: [ARRAY] Support array type load and select

morningman commented on a change in pull request #5980:
URL: https://github.com/apache/incubator-doris/pull/5980#discussion_r653178455



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/ColumnDef.java
##########
@@ -206,6 +206,12 @@ public void analyze(boolean isOlap) throws AnalysisException {
             defaultValue = DefaultValue.BITMAP_EMPTY_DEFAULT_VALUE;
         }
 
+        if (type.getPrimitiveType() == PrimitiveType.ARRAY) {
+            if (defaultValue.isSet && defaultValue != DefaultValue.NULL_DEFAULT_VALUE) {
+                throw new AnalysisException("Array type column default value just support null");

Review comment:
       ```suggestion
                   throw new AnalysisException("Array type column default value only support null");
   ```

##########
File path: be/src/exprs/expr_context.cpp
##########
@@ -373,10 +373,19 @@ void* ExprContext::get_value(Expr* e, TupleRow* row) {
         _result.decimalv2_val = DecimalV2Value::from_decimal_val(v);
         return &_result.decimalv2_val;
     }
+    case TYPE_ARRAY: {
+        doris_udf::CollectionVal v = e->get_array_val(this, row);
+        if (v.is_null) {
+            return NULL;
+        }
+
+        _result.array_val = CollectionValue::from_collection_val(v);
+        return &_result.array_val;
+    }
 #if 0
     case TYPE_ARRAY:

Review comment:
       Remove this

##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java
##########
@@ -294,6 +296,7 @@ public void write(DataOutput out) throws IOException {
         int columnCount = fullSchema.size();
         out.writeInt(columnCount);
         for (Column column : fullSchema) {
+            String json = GsonUtils.GSON.toJson(column);

Review comment:
       seems not used?




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

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org