Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Databricks GENERATED ALWAYS AS (expr) is incomplete #3397

Closed
crash-g opened this issue May 2, 2024 · 0 comments
Closed

Support for Databricks GENERATED ALWAYS AS (expr) is incomplete #3397

crash-g opened this issue May 2, 2024 · 0 comments

Comments

@crash-g
Copy link

crash-g commented May 2, 2024

The following code will throw sqlglot.errors.ParseError: Expecting ), even though it is a valid CREATE statement.

import sqlglot

sql = """
CREATE TABLE IF NOT EXISTS db.table (
  a  TIMESTAMP,
  b  BOOLEAN GENERATED ALWAYS AS (a IS NOT NULL)
)
USING DELTA
"""

sqlglot.parse_one(sql, read="databricks")

Tested with latest version (23.12.2) and with main.

GENERATED ALWAYS AS documentation: https://docs.databricks.com/en/sql/language-manual/sql-ref-syntax-ddl-create-table-using.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant