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

Extract common code from Divide/Remainder to a base trait

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • SQL
    • None

    Description

      There's a lot of code duplication between Divide and Remainder expression types. They're mostly the codegen template (which is exactly the same, with just cosmetic differences), the eval function structure, etc.

      It tedious to have to update multiple places in case we make improvements to the codegen templates in the future. This ticket proposes to refactor the duplicate code into a common base trait for these two classes.

      Non-goal: There another class, Pmod, that is also similiar to Divide and Remainder, so in theory we can make a deeper refactoring to accommodate this class as well. But the "operation" part of its codegen template is harder to factor into the base trait, so this ticket only handles Divide and Remainder for now.

      Attachments

        Activity

          People

            rednaxelafx Kris Mok
            rednaxelafx Kris Mok
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: