Add transpilation support for DECRYPT and TRY_DECRYPT, and test case …#7474
Add transpilation support for DECRYPT and TRY_DECRYPT, and test case …#7474fivetran-ashashankar wants to merge 1 commit intomainfrom
Conversation
SQLGlot Integration Test ResultsComparing:
By Dialect
Overallmain: 107722 total, 106190 passed (pass rate: 98.6%), sqlglot version: sqlglot:RD-1069385-transpile-try_decrypt: 98796 total, 98796 passed (pass rate: 100.0%), sqlglot version: Transitions: Dialect pair changes: 0 previous results not found, 2 curent results not found ✅ 17 test(s) passed |
georgesittas
left a comment
There was a problem hiding this comment.
not sure if this pr is needed
| 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], |
There was a problem hiding this comment.
Why do we need these and we didnt handle this in https://github.com/tobymao/sqlglot/pull/7473/changes?
There was a problem hiding this comment.
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.
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.