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

Codegen issue for decimal type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.3, 3.1.2, 3.2.0
    • 3.2.0, 3.1.3, 3.0.4
    • SQL
    • None

    Description

      How to reproduce this issue:

      spark.sql(
        """
          |CREATE TABLE t1 (
          |  c1 DECIMAL(18,6),
          |  c2 DECIMAL(18,6),
          |  c3 DECIMAL(18,6))
          |USING parquet;
          |""".stripMargin)
      
      spark.sql("SELECT sum(c1 * c3) + sum(c2 * c3) FROM t1").show
      
      20:23:36.272 ERROR org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 56, Column 6: Expression "agg_exprIsNull_2_0" is not an rvalue
      org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 56, Column 6: Expression "agg_exprIsNull_2_0" is not an rvalue
      	at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12675)
      	at org.codehaus.janino.UnitCompiler.toRvalueOrCompileException(UnitCompiler.java:7676)
      

      Attachments

        Activity

          People

            viirya L. C. Hsieh
            yumwang Yuming Wang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: