flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject flink git commit: [FLINK-6068] [table] Support If() as a built-in function.
Date Sat, 18 Mar 2017 14:08:49 GMT
Repository: flink
Updated Branches:
  refs/heads/master 85070df14 -> da10a9b5f


[FLINK-6068] [table] Support If() as a built-in function.

This cloes #3553.


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

Branch: refs/heads/master
Commit: da10a9b5f4fb95185486ff918df4ef5b2b444392
Parents: 85070df
Author: Zhuoluo Yang <zhuoluo.yzl@alibaba-inc.com>
Authored: Thu Mar 16 16:07:33 2017 +0800
Committer: Kurt Young <kurt@apache.org>
Committed: Sat Mar 18 22:07:32 2017 +0800

----------------------------------------------------------------------
 .../scala/org/apache/flink/table/validate/FunctionCatalog.scala | 1 +
 .../apache/flink/table/expressions/ScalarOperatorsTest.scala    | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/da10a9b5/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala
index fcfcf43..224a370 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala
@@ -161,6 +161,7 @@ object FunctionCatalog {
     "isFalse" -> classOf[IsFalse],
     "isNotTrue" -> classOf[IsNotTrue],
     "isNotFalse" -> classOf[IsNotFalse],
+    "if" -> classOf[If],
 
     // aggregate functions
     "avg" -> classOf[Avg],

http://git-wip-us.apache.org/repos/asf/flink/blob/da10a9b5/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
index a4dca93..1a65806 100644
--- a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
+++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarOperatorsTest.scala
@@ -154,6 +154,11 @@ class ScalarOperatorsTest extends ExpressionTestBase {
       "true.?(true.?(true.?(10, 4), 4), 4)",
       "10")
     testTableApi(true, "?((f6 && true), 'true', 'false')", "true")
+    testTableApi(
+      If('f9 > 'f8, 'f9 - 1, 'f9),
+      "If(f9 > f8, f9 - 1, f9)",
+      "9"
+    )
     testSqlApi("CASE 11 WHEN 1 THEN 'a' ELSE 'b' END", "b")
     testSqlApi("CASE 2 WHEN 1 THEN 'a' ELSE 'b' END", "b")
     testSqlApi(


Mime
View raw message