"GENERATED ALWAYS AS" expressions for columns has been supported in spark 3.4 https://github.com/apache/spark/pull/38823 .
I try to create delta table
CREATE TABLE IF NOT EXISTS delta_generated_column_test (
id INT,
name STRING,
date_created TIMESTAMP,
dt DATE GENERATED ALWAYS AS (cast(date_trunc('MONTH',date_created) as date))
)USING DELTA
Exception occur
The feature is not supported: Table `spark_catalog`.`default`.`delta_tttt` does not support generated columns. Please check the current catalog and namespace to make sure the qualified table name is expected, and also check the catalog implementation which is configured by "spark.sql.catalog".
Here is an introduction to Spark 3.4
Using GENERATED ALWAYS AS expr in CREATE/REPLACE table statements will no longer throw a parsing error. When used with a supporting table catalog the query should progress, when used with a nonsupporting catalog there will be an analysis exception.