-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
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
bigquery REGEXP_EXTRACT adds a non-supported fifth argument to the call #1776
Comments
thank you @tobymao ❤️ |
It looks like the same issue remains at the latest release which has 0a1362b
The output shouldn't contain the 5th argument |
@xiaoling you need to provide the >>> import sqlglot
>>> sqlglot.parse_one("""SELECT
... REGEXP_EXTRACT(`foo`, 'bar: (.+?)', 1, 1) AS `bar`
... FROM `DATA`""", read="bigquery").sql(dialect="bigquery")
"SELECT REGEXP_EXTRACT(`foo`, 'bar: (.+?)', 1, 1) AS `bar` FROM `DATA`" |
Thank you @georgesittas was thinking the parse might carry the dialect. this works now |
adrianisk
pushed a commit
to adrianisk/sqlglot
that referenced
this issue
Jun 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before you file an issue
Fully reproducible code snippet
Please include a fully reproducible code snippet or the input sql, dialect, and expected output.
Ran from main as of reporting
The output adds a non-supported fifth argument to the function call of
REGEXP_EXTRACT
We expect
'SELECT REGEXP_EXTRACT("foo", \'bar: (.+?)\', 1, 1) AS "bar" FROM "DATA"'
as the outputOfficial Documentation
Please include links to official SQL documentation related to your issue.
https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_extract
REGEXP_EXTRACT only supports at most 4 args.
Thanks in advance!
The text was updated successfully, but these errors were encountered: