You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Allison Portis (Jira)" <ji...@apache.org> on 2023/07/05 22:38:00 UTC

[jira] [Created] (SPARK-44313) Generated column expression validation fails if there is a char/varchar column anywhere in the schema

Allison Portis created SPARK-44313:
--------------------------------------

             Summary: Generated column expression validation fails if there is a char/varchar column anywhere in the schema
                 Key: SPARK-44313
                 URL: https://issues.apache.org/jira/browse/SPARK-44313
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.4.1, 3.4.0
            Reporter: Allison Portis


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
{code:java}
CREATE TABLE default.example (
    name VARCHAR(64),
    tstamp TIMESTAMP,
    tstamp_date DATE GENERATED ALWAYS AS (CAST(tstamp as DATE))
){code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org