You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by zh...@apache.org on 2019/09/28 03:19:30 UTC

[incubator-doris] branch master updated: Remove default value for HLL column (#1901)

This is an automated email from the ASF dual-hosted git repository.

zhaoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new bdd9c31  Remove default value for HLL column (#1901)
bdd9c31 is described below

commit bdd9c31766b1b9736faa0e49affc291d00c79dc3
Author: HangyuanLiu <46...@qq.com>
AuthorDate: Sat Sep 28 11:19:25 2019 +0800

    Remove default value for HLL column (#1901)
    
    1.fixed hll default column to no default value (#1901)
    2. Don't allow insert stmt insert default values into Doris except hll_empty
---
 fe/src/main/java/org/apache/doris/analysis/ColumnDef.java  | 2 +-
 fe/src/main/java/org/apache/doris/analysis/InsertStmt.java | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fe/src/main/java/org/apache/doris/analysis/ColumnDef.java b/fe/src/main/java/org/apache/doris/analysis/ColumnDef.java
index 1c2e684..821a205 100644
--- a/fe/src/main/java/org/apache/doris/analysis/ColumnDef.java
+++ b/fe/src/main/java/org/apache/doris/analysis/ColumnDef.java
@@ -69,7 +69,7 @@ public class ColumnDef {
         // default null
         public static DefaultValue NULL_DEFAULT_VALUE = new DefaultValue(true, null);
         // default "value"
-        public static DefaultValue HLL_EMPTY_DEFAULT_VALUE = new DefaultValue(true, "0");
+        public static DefaultValue HLL_EMPTY_DEFAULT_VALUE = new DefaultValue(true, null);
     }
 
     // parameter initialized in constructor
diff --git a/fe/src/main/java/org/apache/doris/analysis/InsertStmt.java b/fe/src/main/java/org/apache/doris/analysis/InsertStmt.java
index 9f3e4f0..c3639a0 100644
--- a/fe/src/main/java/org/apache/doris/analysis/InsertStmt.java
+++ b/fe/src/main/java/org/apache/doris/analysis/InsertStmt.java
@@ -380,6 +380,12 @@ public class InsertStmt extends DdlStmt {
                 }
                 targetColumns.add(col);
             }
+            // hll column mush in mentionedColumns
+            for (Column col : targetTable.getBaseSchema()) {
+                if (col.getType().isHllType() && !mentionedColumns.contains(col.getName())) {
+                    throw new AnalysisException (" hll column " + col.getName() + " mush in insert into columns");
+                }
+            }
         }
 
         /*
@@ -598,7 +604,8 @@ public class InsertStmt extends DdlStmt {
             }
         } else if (expr instanceof FunctionCallExpr) {
             final FunctionCallExpr functionExpr = (FunctionCallExpr) expr;
-            if (!functionExpr.getFnName().getFunction().equalsIgnoreCase("hll_hash")) {
+            if (!functionExpr.getFnName().getFunction().equalsIgnoreCase("hll_hash")
+                    && !functionExpr.getFnName().getFunction().equalsIgnoreCase("empty_hll")) {
                 throw new AnalysisException(hllMismatchLog);
             }
         } else {


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