flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject flink git commit: [hotfix][table] Fix bug of testAggregateFunctionOperandTypeCheck
Date Thu, 31 Aug 2017 14:58:53 GMT
Repository: flink
Updated Branches:
  refs/heads/master ddf62b114 -> d8d061b88


[hotfix][table] Fix bug of testAggregateFunctionOperandTypeCheck

This closes #4629


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/d8d061b8
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/d8d061b8
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/d8d061b8

Branch: refs/heads/master
Commit: d8d061b8857f0f6c66e8efb4e1ff2ca33ada2008
Parents: ddf62b1
Author: sunjincheng121 <sunjincheng121@gmail.com>
Authored: Thu Aug 31 20:25:44 2017 +0800
Committer: Jark Wu <jark@apache.org>
Committed: Thu Aug 31 22:58:18 2017 +0800

----------------------------------------------------------------------
 .../UserDefinedFunctionValidationTest.scala        | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d8d061b8/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/validation/UserDefinedFunctionValidationTest.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/validation/UserDefinedFunctionValidationTest.scala
b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/validation/UserDefinedFunctionValidationTest.scala
index 6939771..aeb226e 100644
--- a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/validation/UserDefinedFunctionValidationTest.scala
+++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/validation/UserDefinedFunctionValidationTest.scala
@@ -21,7 +21,7 @@ import org.apache.flink.api.scala._
 import org.apache.flink.table.api.ValidationException
 import org.apache.flink.table.api.scala._
 import org.apache.flink.table.expressions.utils.Func0
-import org.apache.flink.table.runtime.utils.JavaUserDefinedAggFunctions.WeightedAvg
+import org.apache.flink.table.runtime.utils.JavaUserDefinedAggFunctions.OverAgg0
 import org.apache.flink.table.utils.TableTestBase
 import org.junit.Test
 
@@ -36,8 +36,8 @@ class UserDefinedFunctionValidationTest extends TableTestBase {
         "Expected: (int)")
     val util = streamTestUtil()
     util.addTable[(Int, String)]("t", 'a, 'b)
-    util.tableEnv.registerFunction("func",Func0)
-    util.verifySql("select func(b) from t","n/a")
+    util.tableEnv.registerFunction("func", Func0)
+    util.verifySql("select func(b) from t", "n/a")
   }
 
   @Test
@@ -46,15 +46,14 @@ class UserDefinedFunctionValidationTest extends TableTestBase {
     thrown.expectMessage(
       "Given parameters of function do not match any signature. \n" +
         "Actual: (java.lang.String, java.lang.Integer) \n" +
-        "Expected: (org.apache.flink.table.runtime.utils.JavaUserDefinedAggFunctions." +
-        "WeightedAvgAccum, int, int), (org.apache.flink.table.runtime.utils." +
-        "JavaUserDefinedAggFunctions.WeightedAvgAccum, long, int)")
+        "Expected: (org.apache.flink.table.runtime.utils.JavaUserDefinedAggFunctions" +
+        ".Accumulator0, long, int)")
 
     val util = streamTestUtil()
-    val weightAvgFun = new WeightedAvg
+    val agg = new OverAgg0
     util.addTable[(Int, String)]("t", 'a, 'b)
-    util.tableEnv.registerFunction("agg",weightAvgFun)
-    util.verifySql("select agg(b, a) from t","n/a")
+    util.tableEnv.registerFunction("agg", agg)
+    util.verifySql("select agg(b, a) from t", "n/a")
   }
 
 }


Mime
View raw message