[bug](auto partition)Fix insert failed because partition exprs of table is empty (#44391)

Fix insert failed because partition exprs of table is empty.

Revert PR: #43274
This commit is contained in:
xy720
2024-11-22 11:16:23 +08:00
committed by GitHub
parent 702abbff0f
commit cd223327c8
4 changed files with 2 additions and 4 deletions

View File

@ -1735,7 +1735,7 @@ public class FunctionCallExpr extends Expr {
if (!Lists.newArrayList("year", "quarter", "month", "week", "day", "hour", "minute", "second")
.contains(constParam)) {
throw new AnalysisException("date_trunc function second param only support argument is "
+ "year|quarter|month|week|day|hour|minute|second but got " + constParam);
+ "year|quarter|month|week|day|hour|minute|second");
}
}
if (fnName.getFunction().equalsIgnoreCase("array_range")

View File

@ -264,7 +264,6 @@ public class PartitionInfo implements Writable {
// forbid change metadata.
public ArrayList<Expr> getPartitionExprs() {
LOG.info("Debug16494 getPartitionExprs: " + this.partitionExprs.get(0).debugString());
return Expr.cloneList(this.partitionExprs);
}

View File

@ -71,7 +71,7 @@ public class DateTrunc extends ScalarFunction
if (!Lists.newArrayList("year", "quarter", "month", "week", "day", "hour", "minute", "second")
.contains(constParam)) {
throw new AnalysisException("date_trunc function second param only support argument is "
+ "year|quarter|month|week|day|hour|minute|second but got" + constParam);
+ "year|quarter|month|week|day|hour|minute|second");
}
}

View File

@ -387,7 +387,6 @@ public class OlapTableSink extends DataSink {
}
for (Expr e : exprs) {
e.reset();
LOG.info("Debug16494: will analyze " + e.debugString());
e.analyze(funcAnalyzer);
}
partitionParam.setPartitionFunctionExprs(Expr.treesToThrift(exprs));