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

Improve UNSUPPORTED_DATA_TYPE message for complex types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • Spark Core
    • None

    Description

      spark-sql> SELECT CAST(array(1, 2, 3) AS ARRAY);

      [UNSUPPORTED_DATATYPE] Unsupported data type "ARRAY"(line 1, pos 30)

      == SQL ==

      SELECT CAST(array(1, 2, 3) AS ARRAY)

      ------------------------------^^^

      This error message is confusing. We support ARRAY. We just require it to be typed.
      We should have an error like:
      [INCOMPLETE_TYPE_DEFINITION.ARRAY] The definition of type `ARRAY` is incomplete. You must provide an element type. For example: `ARRAY\<INT\>`.
      Similarly for STRUCT and MAP.  

      Attachments

        Activity

          People

            maxgekk Max Gekk
            srielau Serge Rielau
            Max Gekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: