Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-16714 Fail to create a decimal arrays with literals having different inferred precessions and scales
  3. SPARK-16735

Fail to create a map contains decimal type with literals having different inferred precessions and scales

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.0.1
    • 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.

      spark-sql> select map(0.1,0.01, 0.2,0.033);
      Error in query: cannot resolve 'map(CAST(0.1 AS DECIMAL(1,1)), CAST(0.01 AS DECIMAL(2,2)), CAST(0.2 AS DECIMAL(1,1)), CAST(0.033 AS DECIMAL(3,3)))' due to data type mismatch: The given values of function map should all be the same type, but they are [decimal(2,2), decimal(3,3)]; line 1 pos 7

      Attachments

        Activity

          People

            cloud_fan Wenchen Fan
            biglobster Liang Ke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: