duneanalytics/harmonizer

Leading zeros are stripped from hex

vegarsti opened this issue · 3 comments

E.g. the burn address, 0x0000000000000000000000000000000000000000, becomes 0x0.

These are lost at parse time

>>> import sqlglot
>>> sqlglot.__version__
'11.7.1'
>>> sqlglot.parse_one("select X'0010'", read="trino")
(SELECT expressions:
  (HEXSTRING this: 16)
>>> sqlglot.parse_one("select X'10'", read="trino")
(SELECT expressions:
  (HEXSTRING this: 16))
>>> sqlglot.transpile("select X'0010'", read="trino")[0]
"SELECT X'10'"

The SQLGlot team will attempt to solve this on their end, but in the mean time #45 is a workaround.

Fixed by #45, which has been released and deployed