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

Fix(snowflake): convert VALUES with invalid expressions into UNION ALL #3213

Merged
merged 1 commit into from Mar 25, 2024

Conversation

georgesittas
Copy link
Collaborator

Snowflake doesn't support some expressions inside of the VALUES clause. For example, the following fails:

-- Invalid expression [OBJECT_CONSTRUCT('a', 'b')] in VALUES clause
SELECT * FROM (VALUES (OBJECT_CONSTRUCT('a', 'b'))) AS t(x)

Related slack thread and reference: https://docs.snowflake.com/en/sql-reference/constructs/values

Each expression must be a constant, or an expression that can be evaluated as a constant during compilation of the SQL statement. Most simple arithmetic expressions and string functions can be evaluated at compile time, but most other expressions cannot.

@georgesittas georgesittas merged commit af1b026 into main Mar 25, 2024
5 checks passed
@georgesittas georgesittas deleted the jo/snowflake_values_unsupported_exprs branch March 25, 2024 00:51
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

Successfully merging this pull request may close these issues.

None yet

2 participants