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
- relates to
-
SPARK-41290 Support GENERATED ALWAYS AS syntax in create/replace table to create a generated column
- Resolved