beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Work logged] (BEAM-5103) Test aggregation functions at DSL levels
Date Wed, 08 Aug 2018 18:34:00 GMT

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

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

                Author: ASF GitHub Bot
            Created on: 08/Aug/18 18:33
            Start Date: 08/Aug/18 18:33
    Worklog Time Spent: 10m 
      Work Description: vectorijk 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_r208689472
 
 

 ##########
 File path: sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/BeamSqlDslSqlStdOperatorsTest.java
 ##########
 @@ -515,6 +515,71 @@ public void testComparisonOperatorFunction() {
     checker.buildRunAndCheck();
   }
 
+  @Test
+  @SqlOperatorTest(name = "MAX", kind = "MAX")
+  @SqlOperatorTest(name = "MIN", kind = "MIN")
+  @SqlOperatorTest(name = "SUM", kind = "SUM")
+  @SqlOperatorTest(name = "AVG", kind = "AVG")
+  @SqlOperatorTest(name = "$SUM0", kind = "SUM0")
+  @SqlOperatorTest(name = "COUNT", kind = "COUNT")
+  @SqlOperatorTest(name = "VAR_POP", kind = "VAR_POP")
+  @SqlOperatorTest(name = "VAR_SAMP", kind = "VAR_SAMP")
+  @SqlOperatorTest(name = "COVAR_POP", kind = "COVAR_POP")
+  @SqlOperatorTest(name = "COVAR_SAMP", kind = "COVAR_SAMP")
+  public void testAggrationFunctions() {
+    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"))
+            .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"))
+            .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))
+            .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))
+            .addExpr("COUNT(*)", 3L)
+            .addExpr("COUNT(1)", 3L)
+            .addExpr("$SUM0(c_tinyint)", (byte) 6)
 
 Review comment:
   +1 That's what I was thinking.

----------------------------------------------------------------
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:
users@infra.apache.org


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

    Worklog Id:     (was: 132522)
    Time Spent: 1h 40m  (was: 1.5h)

> 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: 1h 40m
>  Remaining Estimate: 0h
>
> Typical aggregation functions include COUNT, SUM, MAX, MIN, etc.



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

Mime
View raw message