@@ -0,0 +1,1654 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.facebook.presto.tests;%0A%0Aimport com.facebook.presto.testing.LocalQueryRunner;%0Aimport org.testng.annotations.Test;%0A%0Aimport static com.facebook.presto.SystemSessionProperties.DICTIONARY_AGGREGATION;%0Aimport static com.facebook.presto.testing.TestingSession.testSessionBuilder;%0A%0Apublic class TestDictionaryAggregation%0A        extends AbstractTestQueryFramework%0A%7B%0A    public TestDictionaryAggregation()%0A    %7B%0A        super(() -%3E new LocalQueryRunner(testSessionBuilder()%0A                .setSystemProperty(DICTIONARY_AGGREGATION, %22true%22)%0A                .build()));%0A    %7D%0A%0A    @Test%0A    public void testMixedDistinctWithFilter()%0A    %7B%0A        assertQuery(%0A                %22SELECT %22 +%0A                        %22     count(DISTINCT x) FILTER (WHERE x %3E 0), %22 +%0A                        %22     sum(x) %22 +%0A                        %22FROM (VALUES 0, 1, 1, 2) t(x)%22,%0A                %22VALUES (2, 4)%22);%0A%0A        assertQuery(%0A                %22SELECT count(DISTINCT x) FILTER (where y = 1)%22 +%0A                        %22FROM (VALUES (2, 1), (1, 2), (1,1)) t(x, y)%22,%0A                %22VALUES 2%22);%0A    %7D%0A%7D%0A

Add basic test for dictionary aggregation