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

Support GENERATED ALWAYS AS syntax in create/replace table to create a generated column

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • SQL
    • None

    Description

      Support GENERATED ALWAYS AS syntax for defining generated columns in create table and replace table.

      For example,

      CREATE TABLE default.example (
          time TIMESTAMP,
          date DATE GENERATED ALWAYS AS (CAST(time AS DATE))
      )
      

       

      This syntax is SQL standard and will enable defining generated columns in Spark SQL for data sources that support it.

       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: