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

Generated column expression validation fails if there is a char/varchar column anywhere in the schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0, 3.4.1
    • 3.4.2, 3.5.0
    • SQL
    • None

    Description

      When validating generated column expressions, this call https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/GeneratedColumn.scala#L123 to checkAnalysis fails when there are char or varchar columns anywhere in the schema.

       

      For example, this query will fail

      CREATE TABLE default.example (
          name VARCHAR(64),
          tstamp TIMESTAMP,
          tstamp_date DATE GENERATED ALWAYS AS (CAST(tstamp as DATE))
      )

       

      Attachments

        Issue Links

          Activity

            People

              allison-portis Allison Portis
              allison-portis Allison Portis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: