This is an automated email from the ASF dual-hosted git repository.
timoninmaxim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 5f5fadf7982 IGNITE-24642 Calcite: remove condition on trim unused
fields (#11899)
5f5fadf7982 is described below
commit 5f5fadf79828090901718b0e24936d846bf6ecd8
Author: Maksim Timonin <[email protected]>
AuthorDate: Fri Feb 28 19:48:55 2025 +0300
IGNITE-24642 Calcite: remove condition on trim unused fields (#11899)
---
.../internal/processors/query/calcite/prepare/IgnitePlanner.java | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgnitePlanner.java
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgnitePlanner.java
index a66f2564ef7..92b9efdbd28 100644
---
a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgnitePlanner.java
+++
b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/prepare/IgnitePlanner.java
@@ -39,7 +39,6 @@ import org.apache.calcite.plan.RelOptMaterialization;
import org.apache.calcite.plan.RelOptPlanner;
import org.apache.calcite.plan.RelOptRule;
import org.apache.calcite.plan.RelOptTable;
-import org.apache.calcite.plan.RelOptUtil;
import org.apache.calcite.plan.RelTraitDef;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.plan.volcano.VolcanoPlanner;
@@ -452,12 +451,9 @@ public class IgnitePlanner implements Planner,
RelOptTable.ViewExpander {
* @return Trimmed relational expression
*/
public RelRoot trimUnusedFields(RelRoot root) {
- // For now, don't trim if there are more than 3 joins. The projects
- // near the leaves created by trim migrate past joins and seem to
- // prevent join-reordering.
final SqlToRelConverter.Config cfg = sqlToRelConverterCfg
.withExpand(false)
- .withTrimUnusedFields(RelOptUtil.countJoins(root.rel) < 2);
+ .withTrimUnusedFields(true);
SqlToRelConverter converter = sqlToRelConverter(validator(),
catalogReader, cfg);
boolean ordered = !root.collation.getFieldCollations().isEmpty();
boolean dml = SqlKind.DML.contains(root.kind);