From 401a1b4ad1a25d9ec5ed3b12af0e3ec0d7c3aeee Mon Sep 17 00:00:00 2001 From: Laksh Singla Date: Wed, 25 Oct 2023 22:43:06 +0530 Subject: [PATCH] remove test added to resolve the conflict --- .../druid/sql/calcite/CalciteQueryTest.java | 133 ------------------ 1 file changed, 133 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java index 0956e2259a46..d60d6b38ee8f 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/CalciteQueryTest.java @@ -14286,137 +14286,4 @@ public void testWindowingErrorWithoutFeatureFlag() assertThat(e, invalidSqlIs("The query contains window functions; To run these window functions, enable [WINDOW_FUNCTIONS] in query context. (line [1], column [13])")); } - - @Test - public void testInGroupByLimitOutGroupByOrderBy() - { - skipVectorize(); - cannotVectorize(); - testQuery( - "with t AS (SELECT m2, COUNT(m1) as trend_score\n" - + "FROM \"foo\"\n" - + "GROUP BY 1 \n" - + "LIMIT 10\n" - + ")\n" - + "select m2, (MAX(trend_score)) from t\n" - + "where m2 > 2\n" - + "GROUP BY 1 \n" - + "ORDER BY 2 DESC", - QUERY_CONTEXT_DEFAULT, - ImmutableList.of( - new GroupByQuery.Builder() - .setDataSource( - new TopNQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("m2", "d0", ColumnType.DOUBLE)) - .threshold(10) - .aggregators(aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("m1") - ) - )) - .metric(new DimensionTopNMetricSpec(null, StringComparators.NUMERIC)) - .context(OUTER_LIMIT_CONTEXT) - .build() - ) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setDimensions( - new DefaultDimensionSpec("d0", "_d0", ColumnType.DOUBLE) - ) - .setDimFilter( - useDefault ? - bound("d0", "2", null, true, false, null, StringComparators.NUMERIC) : - new RangeFilter("d0", ColumnType.LONG, 2L, null, true, false, null) - ) - .setAggregatorSpecs(aggregators( - new LongMaxAggregatorFactory("_a0", "a0") - )) - .setLimitSpec( - DefaultLimitSpec - .builder() - .orderBy(new OrderByColumnSpec("_a0", Direction.DESCENDING, StringComparators.NUMERIC)) - .build() - ) - .setContext(OUTER_LIMIT_CONTEXT) - .build() - ), - ImmutableList.of( - new Object[]{3.0D, 1L}, - new Object[]{4.0D, 1L}, - new Object[]{5.0D, 1L}, - new Object[]{6.0D, 1L} - ) - ); - } - - @Test - public void testInGroupByOrderByLimitOutGroupByOrderByLimit() - { - skipVectorize(); - cannotVectorize(); - testQuery( - "with t AS (SELECT m2 as mo, COUNT(m1) as trend_score\n" - + "FROM \"foo\"\n" - + "GROUP BY 1\n" - + "ORDER BY trend_score DESC\n" - + "LIMIT 10)\n" - + "select mo, (MAX(trend_score)) from t\n" - + "where mo > 2\n" - + "GROUP BY 1 \n" - + "ORDER BY 2 DESC LIMIT 2\n", - QUERY_CONTEXT_DEFAULT, - ImmutableList.of( - new GroupByQuery.Builder() - .setDataSource( - new TopNQueryBuilder() - .dataSource(CalciteTests.DATASOURCE1) - .intervals(querySegmentSpec(Filtration.eternity())) - .dimension(new DefaultDimensionSpec("m2", "d0", ColumnType.DOUBLE)) - .threshold(10) - .aggregators(aggregators( - useDefault - ? new CountAggregatorFactory("a0") - : new FilteredAggregatorFactory( - new CountAggregatorFactory("a0"), - notNull("m1") - ) - )) - .metric(new NumericTopNMetricSpec("a0")) - .context(OUTER_LIMIT_CONTEXT) - .build() - ) - .setInterval(querySegmentSpec(Filtration.eternity())) - .setGranularity(Granularities.ALL) - .setDimensions( - new DefaultDimensionSpec("d0", "_d0", ColumnType.DOUBLE) - ) - .setDimFilter( - useDefault ? - bound("d0", "2", null, true, false, null, StringComparators.NUMERIC) : - new RangeFilter("d0", ColumnType.LONG, 2L, null, true, false, null) - ) - .setAggregatorSpecs(aggregators( - new LongMaxAggregatorFactory("_a0", "a0") - )) - .setLimitSpec( - DefaultLimitSpec - .builder() - .orderBy(new OrderByColumnSpec("_a0", Direction.DESCENDING, StringComparators.NUMERIC)) - .limit(2) - .build() - ) - .setContext(OUTER_LIMIT_CONTEXT) - .build() - ), - ImmutableList.of( - new Object[]{3.0D, 1L}, - new Object[]{4.0D, 1L} - ) - ); - } }