flink git commit: [FLINK-6632] [table] Improved the method BoolLiteral of ExpressionParser for case insensitive.

2017-05-22 Thread twalthr
Repository: flink
Updated Branches:
  refs/heads/release-1.3 09cc3f7c5 -> 95fce1548


[FLINK-6632] [table] Improved the method BoolLiteral of ExpressionParser for 
case insensitive.

This closes #3944.


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

Branch: refs/heads/release-1.3
Commit: 95fce15483fe6b12adc465a0b709362b8ea7fd0c
Parents: 09cc3f7
Author: sunjincheng121 
Authored: Fri May 19 18:24:09 2017 +0800
Committer: twalthr 
Committed: Mon May 22 19:01:49 2017 +0200

--
 .../table/expressions/ExpressionParser.scala| 52 +---
 .../stringexpr/CalcStringExpressionTest.scala   |  4 +-
 .../table/expressions/ScalarOperatorsTest.scala | 19 +++
 3 files changed, 56 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flink/blob/95fce154/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
index f995a96..e1ffb33 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
@@ -82,6 +82,24 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
   lazy val UNBOUNDED_RANGE: Keyword = Keyword("unbounded_range")
   lazy val ROWTIME: Keyword = Keyword("rowtime")
   lazy val PROCTIME: Keyword = Keyword("proctime")
+  lazy val TRUE: Keyword = Keyword("true")
+  lazy val FALSE: Keyword = Keyword("false")
+  lazy val PRIMITIVE_ARRAY: Keyword = Keyword("PRIMITIVE_ARRAY")
+  lazy val OBJECT_ARRAY: Keyword = Keyword("OBJECT_ARRAY")
+  lazy val BYTE: Keyword = Keyword("BYTE")
+  lazy val SHORT: Keyword = Keyword("SHORT")
+  lazy val INTERVAL_MONTHS: Keyword = Keyword("INTERVAL_MONTHS")
+  lazy val INTERVAL_MILLIS: Keyword = Keyword("INTERVAL_MILLIS")
+  lazy val INT: Keyword = Keyword("INT")
+  lazy val LONG: Keyword = Keyword("LONG")
+  lazy val FLOAT: Keyword = Keyword("FLOAT")
+  lazy val DOUBLE: Keyword = Keyword("DOUBLE")
+  lazy val BOOLEAN: Keyword = Keyword("BOOLEAN")
+  lazy val STRING: Keyword = Keyword("STRING")
+  lazy val SQL_DATE: Keyword = Keyword("SQL_DATE")
+  lazy val SQL_TIMESTAMP: Keyword = Keyword("SQL_TIMESTAMP")
+  lazy val SQL_TIME: Keyword = Keyword("SQL_TIME")
+  lazy val DECIMAL: Keyword = Keyword("DECIMAL")
 
   def functionIdent: ExpressionParser.Parser[String] = super.ident
 
@@ -121,22 +139,22 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
   // data types
 
   lazy val dataType: PackratParser[TypeInformation[_]] =
-"PRIMITIVE_ARRAY" ~ "(" ~> dataType <~ ")" ^^ { ct => 
Types.PRIMITIVE_ARRAY(ct) } |
-"OBJECT_ARRAY" ~ "(" ~> dataType <~ ")" ^^ { ct => Types.OBJECT_ARRAY(ct) 
} |
-"BYTE" ^^ { e => Types.BYTE } |
-"SHORT" ^^ { e => Types.SHORT } |
-"INTERVAL_MONTHS" ^^ { e => Types.INTERVAL_MONTHS } |
-"INTERVAL_MILLIS" ^^ { e => Types.INTERVAL_MILLIS } |
-"INT" ^^ { e => Types.INT } |
-"LONG" ^^ { e => Types.LONG } |
-"FLOAT" ^^ { e => Types.FLOAT } |
-"DOUBLE" ^^ { e => Types.DOUBLE } |
-"BOOLEAN" ^^ { { e => Types.BOOLEAN } } |
-"STRING" ^^ { e => Types.STRING } |
-"SQL_DATE" ^^ { e => Types.SQL_DATE } |
-"SQL_TIMESTAMP" ^^ { e => Types.SQL_TIMESTAMP } |
-"SQL_TIME" ^^ { e => Types.SQL_TIME } |
-"DECIMAL" ^^ { e => Types.DECIMAL }
+PRIMITIVE_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => 
Types.PRIMITIVE_ARRAY(ct) } |
+OBJECT_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => Types.OBJECT_ARRAY(ct) } |
+BYTE ^^ { e => Types.BYTE } |
+SHORT ^^ { e => Types.SHORT } |
+INTERVAL_MONTHS ^^ { e => Types.INTERVAL_MONTHS } |
+INTERVAL_MILLIS ^^ { e => Types.INTERVAL_MILLIS } |
+INT ^^ { e => Types.INT } |
+LONG ^^ { e => Types.LONG } |
+FLOAT ^^ { e => Types.FLOAT } |
+DOUBLE ^^ { e => Types.DOUBLE } |
+BOOLEAN ^^ { { e => Types.BOOLEAN } } |
+STRING ^^ { e => Types.STRING } |
+SQL_DATE ^^ { e => Types.SQL_DATE } |
+SQL_TIMESTAMP ^^ { e => Types.SQL_TIMESTAMP } |
+SQL_TIME ^^ { e => Types.SQL_TIME } |
+DECIMAL ^^ { e => Types.DECIMAL }
 
   // literals
 
@@ -167,7 +185,7 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
 str => Literal(str.substring(1, str.length - 1))
   }
 
-  lazy val 

flink git commit: [FLINK-6632] [table] Improved the method BoolLiteral of ExpressionParser for case insensitive.

2017-05-22 Thread twalthr
Repository: flink
Updated Branches:
  refs/heads/master a7bc5de9b -> 9a9e193a1


[FLINK-6632] [table] Improved the method BoolLiteral of ExpressionParser for 
case insensitive.

This closes #3944.


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

Branch: refs/heads/master
Commit: 9a9e193a1edf335c89804dc3643fc02681570821
Parents: a7bc5de
Author: sunjincheng121 
Authored: Fri May 19 18:24:09 2017 +0800
Committer: twalthr 
Committed: Mon May 22 19:00:19 2017 +0200

--
 .../table/expressions/ExpressionParser.scala| 52 +---
 .../stringexpr/CalcStringExpressionTest.scala   |  4 +-
 .../table/expressions/ScalarOperatorsTest.scala | 19 +++
 3 files changed, 56 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/flink/blob/9a9e193a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
--
diff --git 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
index f995a96..e1ffb33 100644
--- 
a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
+++ 
b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
@@ -82,6 +82,24 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
   lazy val UNBOUNDED_RANGE: Keyword = Keyword("unbounded_range")
   lazy val ROWTIME: Keyword = Keyword("rowtime")
   lazy val PROCTIME: Keyword = Keyword("proctime")
+  lazy val TRUE: Keyword = Keyword("true")
+  lazy val FALSE: Keyword = Keyword("false")
+  lazy val PRIMITIVE_ARRAY: Keyword = Keyword("PRIMITIVE_ARRAY")
+  lazy val OBJECT_ARRAY: Keyword = Keyword("OBJECT_ARRAY")
+  lazy val BYTE: Keyword = Keyword("BYTE")
+  lazy val SHORT: Keyword = Keyword("SHORT")
+  lazy val INTERVAL_MONTHS: Keyword = Keyword("INTERVAL_MONTHS")
+  lazy val INTERVAL_MILLIS: Keyword = Keyword("INTERVAL_MILLIS")
+  lazy val INT: Keyword = Keyword("INT")
+  lazy val LONG: Keyword = Keyword("LONG")
+  lazy val FLOAT: Keyword = Keyword("FLOAT")
+  lazy val DOUBLE: Keyword = Keyword("DOUBLE")
+  lazy val BOOLEAN: Keyword = Keyword("BOOLEAN")
+  lazy val STRING: Keyword = Keyword("STRING")
+  lazy val SQL_DATE: Keyword = Keyword("SQL_DATE")
+  lazy val SQL_TIMESTAMP: Keyword = Keyword("SQL_TIMESTAMP")
+  lazy val SQL_TIME: Keyword = Keyword("SQL_TIME")
+  lazy val DECIMAL: Keyword = Keyword("DECIMAL")
 
   def functionIdent: ExpressionParser.Parser[String] = super.ident
 
@@ -121,22 +139,22 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
   // data types
 
   lazy val dataType: PackratParser[TypeInformation[_]] =
-"PRIMITIVE_ARRAY" ~ "(" ~> dataType <~ ")" ^^ { ct => 
Types.PRIMITIVE_ARRAY(ct) } |
-"OBJECT_ARRAY" ~ "(" ~> dataType <~ ")" ^^ { ct => Types.OBJECT_ARRAY(ct) 
} |
-"BYTE" ^^ { e => Types.BYTE } |
-"SHORT" ^^ { e => Types.SHORT } |
-"INTERVAL_MONTHS" ^^ { e => Types.INTERVAL_MONTHS } |
-"INTERVAL_MILLIS" ^^ { e => Types.INTERVAL_MILLIS } |
-"INT" ^^ { e => Types.INT } |
-"LONG" ^^ { e => Types.LONG } |
-"FLOAT" ^^ { e => Types.FLOAT } |
-"DOUBLE" ^^ { e => Types.DOUBLE } |
-"BOOLEAN" ^^ { { e => Types.BOOLEAN } } |
-"STRING" ^^ { e => Types.STRING } |
-"SQL_DATE" ^^ { e => Types.SQL_DATE } |
-"SQL_TIMESTAMP" ^^ { e => Types.SQL_TIMESTAMP } |
-"SQL_TIME" ^^ { e => Types.SQL_TIME } |
-"DECIMAL" ^^ { e => Types.DECIMAL }
+PRIMITIVE_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => 
Types.PRIMITIVE_ARRAY(ct) } |
+OBJECT_ARRAY ~ "(" ~> dataType <~ ")" ^^ { ct => Types.OBJECT_ARRAY(ct) } |
+BYTE ^^ { e => Types.BYTE } |
+SHORT ^^ { e => Types.SHORT } |
+INTERVAL_MONTHS ^^ { e => Types.INTERVAL_MONTHS } |
+INTERVAL_MILLIS ^^ { e => Types.INTERVAL_MILLIS } |
+INT ^^ { e => Types.INT } |
+LONG ^^ { e => Types.LONG } |
+FLOAT ^^ { e => Types.FLOAT } |
+DOUBLE ^^ { e => Types.DOUBLE } |
+BOOLEAN ^^ { { e => Types.BOOLEAN } } |
+STRING ^^ { e => Types.STRING } |
+SQL_DATE ^^ { e => Types.SQL_DATE } |
+SQL_TIMESTAMP ^^ { e => Types.SQL_TIMESTAMP } |
+SQL_TIME ^^ { e => Types.SQL_TIME } |
+DECIMAL ^^ { e => Types.DECIMAL }
 
   // literals
 
@@ -167,7 +185,7 @@ object ExpressionParser extends JavaTokenParsers with 
PackratParsers {
 str => Literal(str.substring(1, str.length - 1))
   }
 
-  lazy val boolLiteral: