[
https://issues.apache.org/jira/browse/FLINK-3579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15217547#comment-15217547
]
ASF GitHub Bot commented on FLINK-3579:
---------------------------------------
Github user ramkrish86 commented on a diff in the pull request:
https://github.com/apache/flink/pull/1821#discussion_r57844837
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/expressions/ExpressionParser.scala
---
@@ -116,7 +118,18 @@ object ExpressionParser extends JavaTokenParsers with
PackratParsers {
atom <~ ".cast(BOOL)" ^^ { e => Cast(e,
BasicTypeInfo.BOOLEAN_TYPE_INFO) } |
atom <~ ".cast(BOOLEAN)" ^^ { e => Cast(e,
BasicTypeInfo.BOOLEAN_TYPE_INFO) } |
atom <~ ".cast(STRING)" ^^ { e => Cast(e,
BasicTypeInfo.STRING_TYPE_INFO) } |
- atom <~ ".cast(DATE)" ^^ { e => Cast(e, BasicTypeInfo.DATE_TYPE_INFO) }
+ atom <~ ".cast(DATE)" ^^ { e => Cast(e, BasicTypeInfo.DATE_TYPE_INFO)
} |
+ // When an integer is directly casted.
+ atom <~ "cast(BYTE)" ^^ { e => Cast(e, BasicTypeInfo.BYTE_TYPE_INFO) }
|
+ atom <~ "cast(SHORT)" ^^ { e => Cast(e, BasicTypeInfo.SHORT_TYPE_INFO)
} |
+ atom <~ "cast(INT)" ^^ { e => Cast(e, BasicTypeInfo.INT_TYPE_INFO) } |
+ atom <~ "cast(LONG)" ^^ { e => Cast(e, BasicTypeInfo.LONG_TYPE_INFO) }
|
+ atom <~ "cast(FLOAT)" ^^ { e => Cast(e, BasicTypeInfo.FLOAT_TYPE_INFO)
} |
+ atom <~ "cast(DOUBLE)" ^^ { e => Cast(e,
BasicTypeInfo.DOUBLE_TYPE_INFO) } |
+ atom <~ "cast(BOOL)" ^^ { e => Cast(e,
BasicTypeInfo.BOOLEAN_TYPE_INFO) } |
+ atom <~ "cast(BOOLEAN)" ^^ { e => Cast(e,
BasicTypeInfo.BOOLEAN_TYPE_INFO) } |
+ atom <~ "cast(STRING)" ^^ { e => Cast(e,
BasicTypeInfo.STRING_TYPE_INFO) } |
+ atom <~ "cast(DATE)" ^^ { e => Cast(e, BasicTypeInfo.DATE_TYPE_INFO) }
--- End diff --
Since I am handling the '.' operator specifically I needed this combination
where the cast could come without '.' in it.
> Improve String concatenation
> ----------------------------
>
> Key: FLINK-3579
> URL: https://issues.apache.org/jira/browse/FLINK-3579
> Project: Flink
> Issue Type: Bug
> Components: Table API
> Reporter: Timo Walther
> Assignee: ramkrishna.s.vasudevan
> Priority: Minor
>
> Concatenation of a String and non-String does not work properly.
> e.g. {{f0 + 42}} leads to RelBuilder Exception
> ExpressionParser does not like {{f0 + 42.cast(STRING)}} either.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)