You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>>optimize(sqlglot.parse_one("select col from tbl",read='spark'),schema={"tbl": {"col": "BINARY"}}).expressions[0].typeDataType(this=Type.BINARY, nested=False)
>>>optimize(sqlglot.parse_one("select substring(col, 2, 3) as x from tbl",read='spark'),schema={"tbl": {"col": "BINARY"}}).expressions[0].typeDataType(this=Type.VARCHAR)
In the second expression, the expected output type is Type.BINARY. In spark shell, this works fine (spark 3.5.1):
Fully reproducible code snippet
In the second expression, the expected output type is
Type.BINARY
. In spark shell, this works fine (spark 3.5.1):From my understanding, the return data type for
Substring
is hardcoded to VARCHAR:sqlglot/sqlglot/dialects/dialect.py
Lines 609 to 617 in fcaae87
The text was updated successfully, but these errors were encountered: