morrySnow commented on code in PR #32867:
URL: https://github.com/apache/doris/pull/32867#discussion_r1560971566
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnBE.java:
##########
@@ -156,12 +189,23 @@ private static void collectConst(Expression expr,
Map<String, Expression> constM
return;
}
// eg: avg_state(1) return is agg function serialize data
- if (expr.getDataType().isAggStateType()) {
+ // and some type can't find a literal to represent.
+ // time type: need add a time literal in nereids
+ // IPv6 type: need get a library to output the compressed address
format
+ if (expr.getDataType().isAggStateType() ||
expr.getDataType().isObjectType()
+ || expr.getDataType().isVariantType() ||
expr.getDataType().isTimeLikeType()
+ || expr.getDataType().isIPv6Type()) {
return;
}
- if (skipSleepFunction(expr)) {
+ if (skipSleepFunction(expr) || (expr instanceof
TableGeneratingFunction)) {
return;
}
+ // Tokenize function want check the second child literal must be
string type
+ // and properties format, it's a little special,
+ // maybe check in checkLegalityBeforeTypeCoercion function?
Review Comment:
agree with check in `checkLegalityBeforeTypeCoercion`
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnBE.java:
##########
@@ -291,4 +311,304 @@ private static Map<String, Expression>
evalOnBE(Map<String, Map<String, TExpr>>
}
return resultMap;
}
+
+ /**
+ * convert PValues which from BE to Expression of nereids
+ */
+ public static List<Literal> getResultExpression(DataType type, PValues
resultContent) {
+ List<Literal> res = new ArrayList<>();
Review Comment:
how about result is a NullLiteral with non-null type?
--
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]