You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "sunjincheng (JIRA)" <ji...@apache.org> on 2017/05/19 10:23:04 UTC

[jira] [Updated] (FLINK-6632) Fix parameter case sensitive error for test passing/rejecting filter API

     [ https://issues.apache.org/jira/browse/FLINK-6632?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sunjincheng updated FLINK-6632:
-------------------------------
    Description: 
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 ?

  was:
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 import 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 ?


> 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)