sqlglot fails to parse bigquery partition expression with function call
See original GitHub issueexample query:
with table as (
select 1.1 as x
union all
select 1.2
union all
select 2.3
)
select x, row_number() over (partition by bqutil.fn.int(x))
from table
sqlglot error:
error formatting query: ParseError('Expecting ). Line 8, Col: 48.\n \n union all\n select 1.2\n union all\n select 2.3\n)\nselect x, row_number() over (partition by f.int\x1b[4m(\x1b[0mx))\nfrom table\n\n\n\nInvalid expression / Unexpected token. Line 8, Col: 51.\n union all\n select 1.2\n union all\n select 2.3\n)\nselect x, row_number() over (partition by f.int(x)\x1b[4m)\x1b[0m\nfrom table\n\n')
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
sqlglot/parser.py at main - GitHub
from sqlglot.errors import ErrorLevel, ParseError, concat_messages, ... Array(expressions=values), ... bigquery allows function calls like x.y.count(...).
Read more >Query partitioned tables | BigQuery - Google Cloud
Isolate the partition column when expressing a filter. Filters that require data from multiple fields to compute will not prune partitions.
Read more >Partitioning by expressions of type FLOAT64 is not allowed at ...
Usually this is a mistake, and partitioning only by CMS_ID should be fine. CAST(REVENUE as STRING). Share. Share a link to this answer....
Read more >Release Notes - Ibis Project
api: bring back null datatype parsing (fc131a1); api: compute the type from both ... duckdb: remove timezone function invocation (33d38fc) ...
Read more >How to Use Partitions and Clusters in BigQuery Using SQL
Essentially, we will not need to read through each record in a table but read ... When you partition a table and then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
just pushed it out
3e93a22 isn’t deployed yet