summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/presto.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/dialects/presto.py')
-rw-r--r--sqlglot/dialects/presto.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/sqlglot/dialects/presto.py b/sqlglot/dialects/presto.py
index 1285281..e4c1edf 100644
--- a/sqlglot/dialects/presto.py
+++ b/sqlglot/dialects/presto.py
@@ -21,6 +21,7 @@ from sqlglot.dialects.dialect import (
regexp_extract_sql,
rename_func,
right_to_substring_sql,
+ sha256_sql,
struct_extract_sql,
str_position_sql,
timestamptrunc_sql,
@@ -452,9 +453,7 @@ class Presto(Dialect):
),
exp.MD5Digest: rename_func("MD5"),
exp.SHA: rename_func("SHA1"),
- exp.SHA2: lambda self, e: self.func(
- "SHA256" if e.text("length") == "256" else "SHA512", e.this
- ),
+ exp.SHA2: sha256_sql,
}
RESERVED_KEYWORDS = {