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

Evaluation helper's output type doesn't conform to input type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: SQL
    • Labels:

      Description

      In sql/catalyst/org/apache/spark/sql/catalyst/expressions.scala

      protected final def n2 ( i: Row, e1: Expression, e2: Expression, f: ((Numeric[Any], Any, Any) => Any)): Any  

      is intended to do computations for Numeric add/Minus/Multipy.
      Just as the comment suggest :

      Those expressions are supposed to be in the same data type, and also the return type.


      But in code, function f was casted to function signature:

      (Numeric[n.JvmType], n.JvmType, n.JvmType) => Int

      I thought it as a typo and the correct should be:

      (Numeric[n.JvmType], n.JvmType, n.JvmType) => n.JvmType

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yijieshen Yijie Shen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: