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
Make sure you specify the "read" dialect eg. parse_one(sql, read="spark")
Check if the issue still exists on main
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
>>> 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, 1) AS "bar" FROM "DATA"'
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 output
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: