Skip to content

Commit

Permalink
Enable SortProjectTransposeRule (#15002)
Browse files Browse the repository at this point in the history
contains Enable already passing tests in DecoupledPlanningCalciteQueryTest #14996
enables a transpose rule to support a query plan in which the plan was in the shape:
Sort
  Project
     Aggregate
  • Loading branch information
kgyrtkirk authored Sep 29, 2023
1 parent 5f3b310 commit db71e28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public class CalciteRulesManager
CoreRules.FILTER_VALUES_MERGE,
CoreRules.PROJECT_FILTER_VALUES_MERGE,
CoreRules.PROJECT_VALUES_MERGE,
CoreRules.SORT_PROJECT_TRANSPOSE,
CoreRules.AGGREGATE_VALUES
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2739,7 +2739,6 @@ public void testGroupByWithSelectAndOrderByProjections()
);
}

@DecoupledIgnore(mode = Modes.PLAN_MISMATCH)
@Test
public void testTopNWithSelectProjections()
{
Expand All @@ -2756,7 +2755,7 @@ public void testTopNWithSelectProjections()
.intervals(querySegmentSpec(Filtration.eternity()))
.granularity(Granularities.ALL)
.dimension(new DefaultDimensionSpec("dim1", "d0"))
.postAggregators(expressionPostAgg("p0", "substring(\"d0\", 1, -1)"))
.postAggregators(expressionPostAgg("s0", "substring(\"d0\", 1, -1)"))
.metric(new DimensionTopNMetricSpec(null, StringComparators.LEXICOGRAPHIC))
.threshold(10)
.context(QUERY_CONTEXT_DEFAULT)
Expand Down Expand Up @@ -11643,7 +11642,6 @@ public void testSortProjectAfterNestedGroupBy()
);
}

@DecoupledIgnore(mode = Modes.CANNOT_CONVERT)
@Test
public void testPostAggWithTimeseries()
{
Expand Down Expand Up @@ -11674,7 +11672,7 @@ public void testPostAggWithTimeseries()
)
)
.postAggregators(
expressionPostAgg("p0", "(\"a0\" + \"a1\")")
expressionPostAgg("s0", "(\"a0\" + \"a1\")")
)
.descending(true)
.context(getTimeseriesContextWithFloorTime(TIMESERIES_CONTEXT_BY_GRAN, "d0"))
Expand All @@ -11687,7 +11685,6 @@ public void testPostAggWithTimeseries()
);
}

@DecoupledIgnore(mode = Modes.PLAN_MISMATCH)
@Test
public void testPostAggWithTopN()
{
Expand Down Expand Up @@ -11736,7 +11733,7 @@ public void testPostAggWithTopN()
new FieldAccessPostAggregator(null, "a0:count")
)
),
expressionPostAgg("p0", "(\"a1\" + \"a2\")")
expressionPostAgg("s0", "(\"a1\" + \"a2\")")
)
.metric(new DimensionTopNMetricSpec(null, StringComparators.NUMERIC))
.threshold(5)
Expand Down

0 comments on commit db71e28

Please sign in to comment.