[
https://issues.apache.org/jira/browse/DRILL-6375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16483391#comment-16483391
]
ASF GitHub Bot commented on DRILL-6375:
---------------------------------------
amansinha100 commented on a change in pull request #1256: DRILL-6375 : Support
for ANY_VALUE aggregate function
URL: https://github.com/apache/drill/pull/1256#discussion_r189756131
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/agg/TestAggWithAnyValue.java
##########
@@ -18,62 +18,117 @@
package org.apache.drill.exec.physical.impl.agg;
+import com.google.common.collect.Lists;
+import org.apache.drill.exec.physical.config.StreamingAggregate;
+import org.apache.drill.exec.physical.unit.PhysicalOpUnitTestBase;
import org.apache.drill.test.BaseTestQuery;
import org.apache.drill.categories.OperatorTest;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.apache.drill.test.TestBuilder;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
import java.math.BigDecimal;
+import java.util.List;
@Category(OperatorTest.class)
-public class TestAggWithAnyValue extends BaseTestQuery{
+@RunWith(Enclosed.class)
+public class TestAggWithAnyValue {
- private static final String disableHashAgg = "alter session set
`planner.enable_hashagg` = false";
- private static final String defaultHashAgg = "alter session set
`planner.enable_hashagg` = true";
+ public static class TestAggWithAnyValueMultipleBatches extends
PhysicalOpUnitTestBase {
- @Test
- public void testWithGroupBy() throws Exception {
- String query = "select t1.age.`max` as age, count(*) as cnt,
any_value(t1.a) as any_a, any_value(t1.city) as any_city, " +
- "any_value(f) as any_f, any_value(m) as any_m from
cp.`store/json/test_anyvalue.json` t1 group by t1.age.`max`";
- testBuilder()
- .sqlQuery(query)
- .unOrdered()
- .baselineColumns("age", "cnt", "any_a", "any_city", "any_f", "any_m")
- .baselineValues(60l, 2l, TestBuilder.listOf(TestBuilder.mapOf("b",
50l, "c", 30l), TestBuilder.mapOf("b", 70l, "c", 40l)), "San Bruno",
- TestBuilder.listOf(TestBuilder.mapOf("g", TestBuilder.mapOf("h",
TestBuilder.listOf(TestBuilder.mapOf("k", 70l), TestBuilder.mapOf("k", 80l))))),
- TestBuilder.listOf(TestBuilder.mapOf("n", TestBuilder.listOf(10l,
11l, 12l))))
- .baselineValues(80l, 3l, TestBuilder.listOf(TestBuilder.mapOf("b",
10l, "c", 15l), TestBuilder.mapOf("b", 20l, "c", 45l)), "Palo Alto",
- TestBuilder.listOf(TestBuilder.mapOf("g", TestBuilder.mapOf("h",
TestBuilder.listOf(TestBuilder.mapOf("k", 10l), TestBuilder.mapOf("k", 20l))))),
- TestBuilder.listOf(TestBuilder.mapOf("n", TestBuilder.listOf(1l,
2l, 3l))))
- .go();
+ @Test
Review comment:
Thanks for adding the new test. LGTM.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> ANY_VALUE aggregate function
> ----------------------------
>
> Key: DRILL-6375
> URL: https://issues.apache.org/jira/browse/DRILL-6375
> Project: Apache Drill
> Issue Type: New Feature
> Components: Functions - Drill
> Affects Versions: 1.13.0
> Reporter: Gautam Kumar Parai
> Assignee: Gautam Kumar Parai
> Priority: Major
> Fix For: 1.14.0
>
>
> We had discussions on the Apache Calcite [1] and Apache Drill [2] mailing
> lists regarding an equivalent for DISTINCT ON. The community seems to prefer
> the ANY_VALUE. This Jira is a placeholder for implementing the ANY_VALUE
> aggregate function in Apache Drill. We should also eventually contribute it
> to Apache Calcite.
> [1]https://lists.apache.org/thread.html/f2007a489d3a5741875bcc8a1edd8d5c3715e5114ac45058c3b3a42d@%3Cdev.calcite.apache.org%3E
> [2]https://lists.apache.org/thread.html/2517eef7410aed4e88b9515f7e4256335215c1ad39a2676a08d21cb9@%3Cdev.drill.apache.org%3E
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)