[ 
https://issues.apache.org/jira/browse/SPARK-48033?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenchen Fan reassigned SPARK-48033:
-----------------------------------

    Assignee: Richard Chen

> Support Generated Column expressions that are `RuntimeReplaceable`
> ------------------------------------------------------------------
>
>                 Key: SPARK-48033
>                 URL: https://issues.apache.org/jira/browse/SPARK-48033
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Spark Core
>    Affects Versions: 4.0.0
>            Reporter: Richard Chen
>            Assignee: Richard Chen
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, default columns that have a default of a `RuntimeReplaceable` 
> expression fails.
> This is because the `AlterTableCommand` constant folds before replacing 
> expressions with the actual implementation. For example:
> ```
> sql(s"CREATE TABLE t(v VARIANT DEFAULT parse_json('1')) USING PARQUET")
> sql("INSERT INTO t VALUES(DEFAULT)")
> ```
> fails because `parse_json` is `RuntimeReplaceable` and is evaluated before 
> the analyzer inserts the correct expression into the plan
> This is especially important for Variant types because literal variants are 
> difficult to create - `parse_json` will likely be used the majority of the 
> time.



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

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

Reply via email to