zabetak commented on code in PR #4591:
URL: https://github.com/apache/calcite/pull/4591#discussion_r2465904010
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -3206,29 +3206,11 @@ private boolean accept_(RexNode e, List<RexNode>
newTerms) {
private boolean accept2(RexNode left, RexNode right, SqlKind kind,
List<RexNode> newTerms) {
- switch (left.getKind()) {
- case INPUT_REF:
- case FIELD_ACCESS:
- case CAST:
- switch (right.getKind()) {
- case LITERAL:
- return accept2b(left, kind, (RexLiteral) right, newTerms);
- default:
- break;
- }
- return false;
- case LITERAL:
- switch (right.getKind()) {
- case INPUT_REF:
- case FIELD_ACCESS:
- case CAST:
- return accept2b(right, kind.reverse(), (RexLiteral) left, newTerms);
- default:
- break;
- }
- return false;
- default:
- break;
+ if (right.isA(SqlKind.LITERAL) && RexUtil.isDeterministic(left)) {
Review Comment:
I added some Javadoc in
https://github.com/apache/calcite/pull/4591/commits/15d095eacf1b0641e1cb4ea5d2f92f0368d358ab
but do be honest I don't feel they add much value as they pretty much state
what the code does.
--
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]