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
The SQL query in the file Spider2/spider2-lite/baselines/utils/2-shot-Snowflake.txt for the question What is the total number of severe storm events that occurred in the most affected month over the past 15 years according to NOAA records, considering only the top 100 storm events with the highest property damage? is currently failing with the following error:
invalid type [CAST("values"."event_begin_time" AS DATE)] for parameter 'TO_DATE'
I think the issue arises because the event_begin_time field is being cast incorrectly. The current query uses:
"event_begin_time"::Date
This needs to be updated to:
TO_TIMESTAMP("event_begin_time"/1000000)
to properly handle the timestamp conversion.
So the correct one should be:
WITH base_info AS (
SELECT"episode_id",
CONCAT(CAST(EXTRACT(MONTH FROMMIN(TO_TIMESTAMP("event_begin_time"/1000000))) AS STRING), '-', CAST(EXTRACT(YEAR FROMMIN(TO_TIMESTAMP("event_begin_time"/1000000))) AS STRING)) AS"episode_month",
EXTRACT(MONTH FROMMIN(TO_TIMESTAMP("event_begin_time"/1000000))) AS"month",
SUM("damage_property") /1000000000AS"damage_property_in_billions"FROM (
SELECT*FROMnoaa_historic_severe_storms.storms_2010UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2011UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2012UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2013UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2014UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2015UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2016UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2017UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2018UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2019UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2020UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2021UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2022UNION ALLSELECT*FROMnoaa_historic_severe_storms.storms_2023
)
WHERE
EXTRACT(YEAR FROM TO_TIMESTAMP("event_begin_time"/1000000)) BETWEEN (EXTRACT(YEAR FROMCURRENT_DATE()) -15) AND EXTRACT(YEAR FROMCURRENT_DATE())
GROUP BY"episode_id"ORDER BY"damage_property_in_billions"DESCLIMIT100
)
SELECTCOUNT(*) AS"month_count"FROM base_info
GROUP BY"month"ORDER BY"month_count"DESCLIMIT1
The text was updated successfully, but these errors were encountered:
Thank you for your suggestion! We will promptly correct the mistakes. Regarding baselines like DailSQL, we think they are somewhat outdated. We recommend using the Spider-Agent baseline instead.
The SQL query in the file
Spider2/spider2-lite/baselines/utils/2-shot-Snowflake.txt
for the questionWhat is the total number of severe storm events that occurred in the most affected month over the past 15 years according to NOAA records, considering only the top 100 storm events with the highest property damage?
is currently failing with the following error:I think the issue arises because the
event_begin_time
field is being cast incorrectly. The current query uses:This needs to be updated to:
to properly handle the timestamp conversion.
So the correct one should be:
The text was updated successfully, but these errors were encountered: