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
This commit is contained in:
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user