-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Hi Spider2 team,
We identified several gold queries invovling syntactic issues.
- Spider 2.0-Snow
sf_bq033
In this query, the table reference "PATENTS"."PUBLICATIONS" should instead be "PATENTS"."PATENTS"."PUBLICATIONS".
| "PATENTS"."PUBLICATIONS", |
- Spider 2.0-Snow
sf_bq422andsf_local015
Both queries include UNION ALL and WITH clauses. As UNION ALL has a higher priority than WITH, a parser will scope CTEs within the first subquery of UNION ALL. A potential fix would be to move the UNION ALL statements within CTEs and create a query to target the results.
Links:
Spider2/spider2-snow/evaluation_suite/gold/sql/sf_bq422.sql
Lines 64 to 72 in e12c5f1
| SELECT 'Top 3 by Slice Interval' AS "Label", | |
| AVG(s.series_size_mib) AS "Average Series Size MiB" | |
| FROM series_sizes s | |
| JOIN top3_by_slice t USING ("PatientID") | |
| UNION ALL | |
| SELECT 'Top 3 by Max Exposure' AS "Label", | |
| AVG(s.series_size_mib) AS "Average Series Size MiB" | |
| FROM series_sizes s | |
| JOIN top3_by_exposure t USING ("PatientID"); |
Spider2/spider2-snow/evaluation_suite/gold/sql/sf_local015.sql
Lines 48 to 64 in e12c5f1
| SELECT | |
| 'helmet_worn' AS "helmet_usage", | |
| COALESCE( | |
| 100.0 * SUM(CASE WHEN "helmet_group" = 'helmet_worn' THEN "motorcyclist_killed_count" ELSE 0 END) | |
| / NULLIF(SUM(CASE WHEN "helmet_group" = 'helmet_worn' THEN 1 ELSE 0 END), 0), | |
| 0 | |
| ) AS "fatality_percentage" | |
| FROM "classified" | |
| UNION ALL | |
| SELECT | |
| 'no_helmet' AS "helmet_usage", | |
| COALESCE( | |
| 100.0 * SUM(CASE WHEN "helmet_group" = 'no_helmet' THEN "motorcyclist_killed_count" ELSE 0 END) | |
| / NULLIF(SUM(CASE WHEN "helmet_group" = 'no_helmet' THEN 1 ELSE 0 END), 0), | |
| 0 | |
| ) AS "fatality_percentage" | |
| FROM "classified"; |
Please take a look around!
Posted date: Dec 9, 2025