Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6619 Check Table API & SQL support for 1.3.0 RC01 Release
  3. FLINK-6632

Fix parameter case sensitive error for test passing/rejecting filter API

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 1.4.0
    • Table SQL / API
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: