Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-24642 Calcite: remove condition on trim unused fields #11899

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
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;
Expand Down Expand Up @@ -452,12 +451,9 @@ private List<RelOptMaterialization> materializations() {
* @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);
Expand Down