Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 1.4.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      TableAPI testAllPassingFilter:

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

      We got error:

      org.apache.flink.table.api.ValidationException: Cannot resolve [TrUe] given input [int, long, string].
      

      The error is caused by :

          lazy val boolLiteral: PackratParser[Expression] = ("true" | "false") ^^ {
          str => Literal(str.toBoolean)
        }
      

      I want improve the method as follow:

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

      Is there any drawback to this improvement? Welcome anyone feedback ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sunjincheng121 sunjincheng
                Reporter:
                sunjincheng121 sunjincheng
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: