Skip to content

Add transpilation support for DECRYPT and TRY_DECRYPT, and test case …#7474

Open
fivetran-ashashankar wants to merge 1 commit intomainfrom
RD-1069385-transpile-try_decrypt
Open

Add transpilation support for DECRYPT and TRY_DECRYPT, and test case …#7474
fivetran-ashashankar wants to merge 1 commit intomainfrom
RD-1069385-transpile-try_decrypt

Conversation

@fivetran-ashashankar
Copy link
Copy Markdown
Collaborator

TRY_DECRYPT marked unsupported.
Neither DECRYPT nor TRY_DECRYPT exist in DuckDB, and there is no trydecrypt_sql method in the generator to emit a transpile-time warning.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

SQLGlot Integration Test Results

Comparing:

  • this branch (sqlglot:RD-1069385-transpile-try_decrypt, sqlglot version: RD-1069385-transpile-try_decrypt)
  • baseline (main, sqlglot version: 0.0.1.dev1)

By Dialect

dialect main sqlglot:RD-1069385-transpile-try_decrypt transitions links
bigquery -> bigquery 22925/22930 passed (100.0%) 21255/21255 passed (100.0%) No change full result / delta
bigquery -> duckdb 1304/1674 passed (77.9%) 0/0 passed (0.0%) Results not found full result / delta
snowflake -> duckdb 1521/2678 passed (56.8%) 0/0 passed (0.0%) Results not found full result / delta
snowflake -> snowflake 65927/65927 passed (100.0%) 63028/63028 passed (100.0%) No change full result / delta
databricks -> databricks 1370/1370 passed (100.0%) 1370/1370 passed (100.0%) No change full result / delta
postgres -> postgres 6042/6042 passed (100.0%) 6042/6042 passed (100.0%) No change full result / delta
redshift -> redshift 7101/7101 passed (100.0%) 7101/7101 passed (100.0%) No change full result / delta

Overall

main: 107722 total, 106190 passed (pass rate: 98.6%), sqlglot version: 0.0.1.dev1

sqlglot:RD-1069385-transpile-try_decrypt: 98796 total, 98796 passed (pass rate: 100.0%), sqlglot version: RD-1069385-transpile-try_decrypt

Transitions:
No change

Dialect pair changes: 0 previous results not found, 2 curent results not found

✅ 17 test(s) passed

Copy link
Copy Markdown
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this pr is needed

Comment on lines +1499 to +1510
exp.Decrypt: lambda self, e: (
self.unsupported(
f"{'TRY_' if e.args.get('safe') else ''}DECRYPT is not supported in DuckDB"
),
self.func(
f"{'TRY_' if e.args.get('safe') else ''}DECRYPT",
e.this,
e.args.get("passphrase"),
e.args.get("aad"),
e.args.get("encryption_method"),
),
)[1],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need these and we didnt handle this in https://github.com/tobymao/sqlglot/pull/7473/changes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented https://github.com/tobymao/sqlglot/pull/7473/changes  and then when I was looking into TRY_DECRYPT I saw an opportunity to combine them. Hence I combined them as part of this PR.

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.

2 participants