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

Add UserDefinedType support to DataTypeUtils.canWrite

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.0.0
    • SQL

    Description

      Our customer hits an issue recently when they tries to save a DataFrame containing some UDTs as table (`saveAsTable`). The error looks like:

      ```

      • Cannot write 'xxx': struct<...> is incompatible with struct<...>
        ```

      The catalog strings between two sides are actually same which makes the customer confused.

      It is because `DataTypeUtils.canWrite` doesn't handle `UserDefinedType`. If the `UserDefinedType`'s underlying sql type is same as read side, `canWrite` should return true for two sides.

      Attachments

        Issue Links

          Activity

            People

              viirya L. C. Hsieh
              viirya L. C. Hsieh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: