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
database.table_name
Fully reproducible code snippet
1/ using transpile:
transpile
import sqlglot query = "SELECT * FROM my_database.my_table TABLESAMPLE (1 PERCENT) foo" sqlglot.transpile(query, read="spark")
SELECT * FROM my_table TABLESAMPLE (1 PERCENT) AS foo
here my_database is missing, expected:
my_database
SELECT * FROM my_database.my_table TABLESAMPLE (1 PERCENT) AS foo
2/ using parse_one:
parse_one
import sqlglot query = "SELECT * FROM my_database.my_table TABLESAMPLE (1 PERCENT) foo" sqlglot.parse_one(query, read="spark")
SELECT * FROM my_database.my_table AS foo TABLESAMPLE (1 PERCENT)
here the alias is misplaced, expected:
Official Documentation
https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-sampling.html
See also here for example snippets https://github.com/sqlfluff/sqlfluff/blob/main/test/fixtures/dialects/hive/select_sampling_table.sql
The text was updated successfully, but these errors were encountered:
99532d9
in the second case, this is expected because you didn't specify an output dialect, try it with sql(dialect="spark")
Sorry, something went wrong.
Awesome, thanks a lot for the super quick fix!
Fix: tablesample losing db closes tobymao#1629
f1a128b
tobymao
No branches or pull requests
Fully reproducible code snippet
1/ using
transpile
:here
my_database
is missing, expected:2/ using
parse_one
:here the alias is misplaced, expected:
Official Documentation
https://spark.apache.org/docs/latest/sql-ref-syntax-qry-select-sampling.html
See also here for example snippets https://github.com/sqlfluff/sqlfluff/blob/main/test/fixtures/dialects/hive/select_sampling_table.sql
The text was updated successfully, but these errors were encountered: