starocean999 commented on code in PR #64026:
URL: https://github.com/apache/doris/pull/64026#discussion_r3418958551
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/PartitionDefinition.java:
##########
@@ -189,12 +200,73 @@ public void setPartitionTypes(List<DataType>
partitionTypes) {
this.partitionTypes = partitionTypes;
}
+ protected void ensurePartitionTypesInitialized() {
+ if (partitionTypes == null) {
+ throw new AnalysisException("partitionTypes should be initialized
before validating partition definition");
+ }
+ }
+
+ protected Expression typedPartitionExpression(Expression expression, int
index) {
+ ensurePartitionTypesInitialized();
+ return strictTypedPartitionExpression(expression,
partitionTypes.get(index));
+ }
+
+ static Expression strictTypedPartitionExpression(Expression expression,
DataType targetType) {
+ if (expression instanceof MaxValue || expression instanceof
MaxLiteral) {
Review Comment:
目前代码里同时使用了MaxValue和MaxLiteral.
其中MaxLiteral在MTMVUtil,OneRangePartitionEvaluator和PartitionPredicateToRange都有相关判断,这两者应该需要统一,但这里同时检查两者可以保证不出错。统一这两个类型可以由后续单独PR处理
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]