[
https://issues.apache.org/jira/browse/BEAM-5103?focusedWorklogId=132506&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-132506
]
ASF GitHub Bot logged work on BEAM-5103:
----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Aug/18 18:03
Start Date: 08/Aug/18 18:03
Worklog Time Spent: 10m
Work Description: amaliujia 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_r208679831
##########
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:
I took a look at SUM0 and realized SUM and SUM0 are using the same code. My
understanding is SUM0 requires change here.
So I commented SUM0 related code here. SUM0 can be re-tested once it is
correctly implemented.
----------------------------------------------------------------
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: 132506)
Time Spent: 1.5h (was: 1h 20m)
> 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: 1.5h
> Remaining Estimate: 0h
>
> Typical aggregation functions include COUNT, SUM, MAX, MIN, etc.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)