[
https://issues.apache.org/jira/browse/FLINK-6632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017198#comment-16017198
]
ASF GitHub Bot commented on FLINK-6632:
---------------------------------------
GitHub user sunjincheng121 opened a pull request:
https://github.com/apache/flink/pull/3944
[FLINK-6632][table]Improved the method BoolLiteral of ExpressionParse…
This PR. only improved the method `BoolLiteral` of `ExpressionParser` for
case insensitive.
- [x] General
- The pull request references the related JIRA issue
("[FLINK-6632][table]Improved the method BoolLiteral of ExpressionParser for
case insensitive.")
- The pull request addresses only one issue
- Each commit in the PR has a meaningful commit message (including the
JIRA id)
- [ ] Documentation
- Documentation has been added for new functionality
- Old documentation affected by the pull request has been updated
- JavaDoc for public methods has been added
- [x] Tests & Build
- Functionality added by the pull request is covered by tests
- `mvn clean verify` has been executed successfully locally or a Travis
build has passed
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sunjincheng121/flink FLINK-6632-PR
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/3944.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3944
----
commit 959af858fb0345c8d28254a3984d58a39e0405c6
Author: sunjincheng121 <[email protected]>
Date: 2017-05-19T10:24:09Z
[FLINK-6632][table]Improved the method BoolLiteral of ExpressionParser for
case insensitive.
----
> Fix parameter case sensitive error for test passing/rejecting filter API
> ------------------------------------------------------------------------
>
> Key: FLINK-6632
> URL: https://issues.apache.org/jira/browse/FLINK-6632
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
> Reporter: sunjincheng
> Assignee: sunjincheng
>
> TableAPI {{testAllPassingFilter}}:
> {code}
> val t = util.addTable[(Int, Long, String)]('int, 'long, 'string)
> val resScala = t.filter(Literal(true)).select('int as 'myInt, 'string)
> val resJava = t.filter("TrUe").select("int as myInt, string")
> {code}
> We got error:
> {code}
> org.apache.flink.table.api.ValidationException: Cannot resolve [TrUe] given
> input [int, long, string].
> {code}
> The error is caused by :
> {code}
> lazy val boolLiteral: PackratParser[Expression] = ("true" | "false") ^^ {
> str => Literal(str.toBoolean)
> }
> {code}
> I want improve the method as follow:
> {code}
> lazy val boolLiteral: PackratParser[Expression] =
> ("(t|T)(r|R)(u|U)(e|E)".r | "(f|F)(a|A)(l|L)(s|S)(e|E)".r) ^^ { str =>
> Literal(str.toBoolean)}
> {code}
> Is there any drawback to this improvement? Welcome anyone feedback ?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)