NobiGo commented on code in PR #4250:
URL: https://github.com/apache/calcite/pull/4250#discussion_r2000360541


##########
core/src/main/java/org/apache/calcite/rel/logical/LogicalFilter.java:
##########
@@ -135,9 +133,7 @@ public static LogicalFilter create(final RelNode input, 
RexNode condition,
     final RelMetadataQuery mq = cluster.getMetadataQuery();
     final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
         .replaceIfs(RelCollationTraitDef.INSTANCE,
-            () -> RelMdCollation.filter(mq, input))
-        .replaceIf(RelDistributionTraitDef.INSTANCE,
-            () -> RelMdDistribution.filter(mq, input));
+            () -> RelMdCollation.filter(mq, input));

Review Comment:
   If we don't do this. 
   testEnumerableFilterRule will throw an exception:
   ```
   There are not enough rules to produce a node with desired properties: 
convention=ENUMERABLE, dist=any.
   Missing conversion is LogicalFilter[convention: NONE -> ENUMERABLE]
   There is 1 empty subset: rel#39:RelSubset#1.ENUMERABLE.broadcast, the 
relevant part of the original plan is as follows
   14:LogicalFilter(condition=[NOT(<= SOME($5, {
   LogicalProject(COMM=[$6])
     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
   }))])
     8:LogicalTableScan(subset=[rel#13:RelSubset#0.NONE.any], table=[[CATALOG, 
SALES, EMP]])
   ```
   The mismatch of Trait information leads to the invalidity of the transformed 
plan.



-- 
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]

Reply via email to