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

Cleanup codegen template for Literal

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.2.1
    • Fix Version/s: 2.4.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Ideally, the codegen templates for Literal should emit literals in the isNull and value fields of ExprCode so that they can be effectively inlined into their use sites.
      But currently there are a couple of paths where Literal.doGenCode() return ExprCode that has non-trivial code field, and all of those are actually unnecessary.

      We can make a simple refactoring to make sure all codegen templates for Literal return empty code and simple literal/constant expressions in isNull and value.

        Attachments

          Activity

            People

            • Assignee:
              rednaxelafx Kris Mok
              Reporter:
              rednaxelafx Kris Mok
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: