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

Fail to create a decimal arrays with literals having different inferred precessions and scales

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1, 2.1.0
    • None
    • None

    Description

      In Spark 2.0, we will parse float literals as decimals. However, it introduces a side-effect, which is described below.

      select array(0.001, 0.02)
      

      causes

      org.apache.spark.sql.AnalysisException: cannot resolve 'array(CAST(0.001 AS DECIMAL(3,3)), CAST(0.02 AS DECIMAL(2,2)))' due to data type mismatch: input to function array should all be the same type, but it's [decimal(3,3), decimal(2,2)]; line 1 pos 7
      

      Attachments

        Activity

          People

            cloud_fan Wenchen Fan
            yhuai Yin Huai
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: