Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-45891 Support Variant data type
  3. SPARK-48033

Support Generated Column expressions that are `RuntimeReplaceable`

    XMLWordPrintableJSON

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              richardc-db Richard Chen
              richardc-db Richard Chen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: