Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 66b7e52

Browse files
committed
Cast to decimal when md5_to_int for databricks to avoid bigint overflow.
1 parent f45598c commit 66b7e52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data_diff/databases/databricks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def quote(self, s: str):
6161
return f"`{s}`"
6262

6363
def md5_to_int(self, s: str) -> str:
64-
return f"conv(substr(md5({s}), {1+MD5_HEXDIGITS-CHECKSUM_HEXDIGITS}), 16, 10)"
64+
return f"cast(conv(substr(md5({s}), {1+MD5_HEXDIGITS-CHECKSUM_HEXDIGITS}), 16, 10) as decimal(38, 0))"
6565

6666
def to_string(self, s: str) -> str:
6767
return f"cast({s} as string)"

0 commit comments

Comments
 (0)