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
When testing SQLGlot with DuckDB, there is a parsing error when using the ^ operator in SQL statements. SQLGlot incorrectly translates this to the XOR function, whereas in DuckDB, the ^ operator is used for exponentiation (power).
Original Query:
SELECT ?::DOUBLE ^ ?::DOUBLE LIMIT1
SQLGlot Translation:
SELECT XOR(CAST(? AS DOUBLE), CAST(? AS DOUBLE)) LIMIT1
Expected Behavior:
The translation should retain the ^ operator, as it computes the power of x to y in DuckDB:
SELECT ?::DOUBLE ^ ?::DOUBLE LIMIT1
DuckDB Reference:
By inspecting the DuckDB function definitions, the ^ operator is defined as the exponentiation function:
SELECT*FROM duckdb_functions() WHERE function_name ='^';
The text was updated successfully, but these errors were encountered:
rustyconover
changed the title
DuckDB ^ operator is parsed incorrectly as XOR when it should be POW
DuckDB ^ operator is parsed incorrectly as XOR when it should be POW
Oct 1, 2024
When testing SQLGlot with DuckDB, there is a parsing error when using the
^
operator in SQL statements. SQLGlot incorrectly translates this to theXOR
function, whereas in DuckDB, the^
operator is used for exponentiation (power).Original Query:
SQLGlot Translation:
Expected Behavior:
The translation should retain the
^
operator, as it computes the power ofx
toy
in DuckDB:DuckDB Reference:
By inspecting the DuckDB function definitions, the
^
operator is defined as the exponentiation function:The text was updated successfully, but these errors were encountered: