Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33619

GetMapValueUtil code generation error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • SQL
    • None

    Description

      ```

      In SPARK-33460--

      there is a bug as follow.

      GetMapValueUtil generated code error when ANSI mode is on

       

      s"""throw new NoSuchElementException("Key " + $eval2 + " does not exist.");"""

      should be 

      s"""throw new java.util.NoSuchElementException("Key " + $eval2 + " does not exist.");"""

       

      But Why are

      checkExceptionInExpression[Exception](expr, errMsg)

      and sql/testOnly org.apache.spark.sql.SQLQueryTestSuite – -z ansi/map.sql

      can't detect this Bug

       

      it's because 

      1. checkExceptionInExpression is some what error, too. it should wrap with 

      withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key like CheckEvalulation, AND WE SHOULD FIX this later.

      2. SQLQueryTestSuite ansi/map.sql failed to detect because of the ConstantFolding rules, it is calling eval instead of code gen  in this case

       

      ```

      Attachments

        Issue Links

          Activity

            People

              leanken Leanken.Lin
              leanken Leanken.Lin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: