xiedeyantu commented on code in PR #4288:
URL: https://github.com/apache/calcite/pull/4288#discussion_r2034155889
##########
core/src/main/java/org/apache/calcite/rex/RexBuilder.java:
##########
@@ -1917,6 +1917,27 @@ public RexLiteral makeZeroLiteral(RelDataType type) {
return makeLiteral(zeroValue(type), type);
}
+ public RexNode makeZeroForNestedType(RelDataType type) {
+ SqlOperator op;
+ switch (type.getSqlTypeName()) {
+ case ARRAY:
+ op = SqlStdOperatorTable.ARRAY_VALUE_CONSTRUCTOR;
+ break;
+ case MULTISET:
+ op = SqlStdOperatorTable.MULTISET_VALUE;
+ break;
+ case MAP:
+ op = SqlStdOperatorTable.MAP_VALUE_CONSTRUCTOR;
+ break;
+ case ROW:
+ op = SqlStdOperatorTable.ROW;
Review Comment:
I tried to sort out the logic according to your suggestion. ROW needs to be
processed recursively and filled with real zero values. Should MAP have the
same logic as ROW or ARRAY? If both use recursive logic, then ARRAY and
MULITSET only need to do a CAST at the innermost level?
--
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]