From 2e24eae5a5dae9225bc74291ec233d32b56ea36c Mon Sep 17 00:00:00 2001 From: "Piyush:)" <47020544+piyushsarraf@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:13:23 +0530 Subject: [PATCH] Fix: Adding UTF encoding for Oracle hash generation (#878) Co-authored-by: Piyush Sarraf --- third_party/ibis/ibis_addon/operations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/ibis/ibis_addon/operations.py b/third_party/ibis/ibis_addon/operations.py index 140f80b42..6757f5e2a 100644 --- a/third_party/ibis/ibis_addon/operations.py +++ b/third_party/ibis/ibis_addon/operations.py @@ -240,7 +240,8 @@ def sa_format_hashbytes_mssql(translator, expr): def sa_format_hashbytes_oracle(translator, expr): arg, how = expr.op().args compiled_arg = translator.translate(arg) - hash_func = sa.func.standard_hash(compiled_arg, sa.sql.literal_column("'SHA256'")) + convert = sa.func.convert(compiled_arg, sa.sql.literal_column("'UTF8'")) + hash_func = sa.func.standard_hash(convert, sa.sql.literal_column("'SHA256'")) return sa.func.lower(hash_func) def sa_format_hashbytes_mysql(translator, expr):