liyafan82 commented on a change in pull request #2355:
URL: https://github.com/apache/calcite/pull/2355#discussion_r589917567
##########
File path: core/src/main/java/org/apache/calcite/rel/core/Project.java
##########
@@ -442,6 +443,19 @@ public boolean isMapping() {
return true;
}
+ /**
+ * Given some columns, gets the non-constant ones.
+ */
+ public ImmutableBitSet getNonConstColumns(ImmutableBitSet columns) {
+ ImmutableBitSet.Builder nonConstCols = ImmutableBitSet.builder();
+ for (int col : columns) {
+ if (!RexUtil.isLiteral(getProjects().get(col), true)) {
+ nonConstCols.set(col);
+ }
+ }
Review comment:
Thanks for the good suggestion. I have moved it to class `RexUils`.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]