We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hive uses 0-based indexing, while Presto uses 1-based indexing, however in the following example sqlglot doesn't properly translate between the two:
print(sqlglot.transpile(""" SELECT SPLIT(str_col_with_space, ' ')[0] FROM my_db.my_table """, read='hive', write='presto', pretty=True)[0])
returns the query unchanged, but it should be
SELECT SPLIT(str_col_with_space, ' ')[1] FROM my_db.my_table
and conversely
print(sqlglot.transpile(""" SELECT SPLIT(str_col_with_space, ' ')[1] FROM my_db.my_table """, read='presto', write='hive', pretty=True)[0])
SELECT SPLIT(str_col_with_space, ' ')[0] FROM my_db.my_table
This is particularly dangerous when going from presto --> hive, as the wrongly translated code will always still be syntactically correct.
The text was updated successfully, but these errors were encountered:
this is using version 1.22.0
Sorry, something went wrong.
allow for array index offsets
96e3afd
fixes #68 triggers warnings because it may not be correct for certain cases like maps with integer indicies
Successfully merging a pull request may close this issue.
Hive uses 0-based indexing, while Presto uses 1-based indexing, however in the following example sqlglot doesn't properly translate between the two:
returns the query unchanged, but it should be
and conversely
returns the query unchanged, but it should be
This is particularly dangerous when going from presto --> hive, as the wrongly translated code will always still be syntactically correct.
The text was updated successfully, but these errors were encountered: