[ 
https://issues.apache.org/jira/browse/BEAM-5103?focusedWorklogId=132700&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-132700
 ]

ASF GitHub Bot logged work on BEAM-5103:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Aug/18 22:03
            Start Date: 08/Aug/18 22:03
    Worklog Time Spent: 10m 
      Work Description: akedin commented on a change in pull request #6175: 
[BEAM-5103][SQL]test aggregation functions at DSL level
URL: https://github.com/apache/beam/pull/6175#discussion_r208736981
 
 

 ##########
 File path: 
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/BeamSqlDslSqlStdOperatorsTest.java
 ##########
 @@ -515,6 +515,132 @@ public void testComparisonOperatorFunction() {
     checker.buildRunAndCheck();
   }
 
+  @Test
+  @SqlOperatorTest(name = "MAX", kind = "MAX")
+  public void testMax() {
+    ExpressionChecker checker =
+        new ExpressionChecker()
+            .addExpr("MAX(c_tinyint)", (byte) 3)
+            .addExpr("MAX(c_smallint)", (short) 3)
+            .addExpr("MAX(c_integer)", 3)
+            .addExpr("MAX(c_bigint)", 3L)
+            .addExpr("MAX(c_float)", 3.0f)
+            .addExpr("MAX(c_double)", 3.0)
+            .addExpr("MAX(c_decimal)", BigDecimal.valueOf(3.0))
+            .addExpr("MAX(ts)", parseDate("1986-04-15 11:35:26"));
+    checker.buildRunAndCheck(getAggregationTestPCollection());
+  }
+
+  @Test
+  @SqlOperatorTest(name = "MIN", kind = "MIN")
+  public void testMin() {
+    ExpressionChecker checker =
+        new ExpressionChecker()
+            .addExpr("MIN(c_tinyint)", (byte) 1)
+            .addExpr("MIN(c_smallint)", (short) 1)
+            .addExpr("MIN(c_integer)", 1)
+            .addExpr("MIN(c_bigint)", 1L)
+            .addExpr("MIN(c_float)", 1.0f)
+            .addExpr("MIN(c_double)", 1.0)
+            .addExpr("MIN(c_decimal)", BigDecimal.valueOf(1.0))
+            .addExpr("MIN(ts)", parseDate("1986-02-15 11:35:26"));
+    checker.buildRunAndCheck(getAggregationTestPCollection());
+  }
+
+  @Test
+  @SqlOperatorTest(name = "SUM", kind = "SUM")
+  public void testSum() {
+    ExpressionChecker checker =
+        new ExpressionChecker()
+            .addExpr("SUM(c_tinyint)", (byte) 6)
+            .addExpr("SUM(c_smallint)", (short) 6)
+            .addExpr("SUM(c_integer)", 6)
+            .addExpr("SUM(c_bigint)", 6L)
+            .addExpr("SUM(c_float)", 6.0f)
+            .addExpr("SUM(c_double)", 6.0)
+            .addExpr("SUM(c_decimal)", BigDecimal.valueOf(6.0));
+    checker.buildRunAndCheck(getAggregationTestPCollection());
+  }
+
+  @Test
+  @SqlOperatorTest(name = "AVG", kind = "AVG")
+  public void testAvg() {
+    ExpressionChecker checker =
+        new ExpressionChecker()
+            .addExpr("AVG(c_tinyint)", (byte) 2)
+            .addExpr("AVG(c_smallint)", (short) 2)
+            .addExpr("AVG(c_integer)", 2)
+            .addExpr("AVG(c_bigint)", 2L)
+            .addExpr("AVG(c_float)", 2.0f)
+            .addExpr("AVG(c_double)", 2.0)
+            .addExpr("AVG(c_decimal)", BigDecimal.valueOf(2.0));
+    checker.buildRunAndCheck(getAggregationTestPCollection());
+  }
+
+  // @Test
+  // @SqlOperatorTest(name = "$SUM0", kind = "SUM0")
+  // public void testSUM0() {
 
 Review comment:
   Let's uncomment and put `@Ignore("JIRA-xxx")` on it instead

----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 132700)
    Time Spent: 2h 10m  (was: 2h)

> Test aggregation functions at DSL levels
> ----------------------------------------
>
>                 Key: BEAM-5103
>                 URL: https://issues.apache.org/jira/browse/BEAM-5103
>             Project: Beam
>          Issue Type: Sub-task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Typical aggregation functions include COUNT, SUM, MAX, MIN, etc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to