mihaibudiu commented on code in PR #5037:
URL: https://github.com/apache/calcite/pull/5037#discussion_r3453881309
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -408,6 +408,22 @@ RexNode isFalse(RexNode e) {
private RexNode simplifyGenericNode(RexCall e) {
final List<RexNode> operands = new ArrayList<>(e.operands);
simplifyList(operands, UNKNOWN);
+
+ // Simplify CARDINALITY(MAP_KEYS(m)) -> CARDINALITY(m)
+ // and CARDINALITY(MAP_VALUES(m)) -> CARDINALITY(m)
+ if (e.getOperator().getName().equals("CARDINALITY")
Review Comment:
Do you expect people write such programs?
There's potentially an infinite number of such optimizations we can
consider, but are they useful in practice?
--
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]