-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When running a simple query that uses DATE_TRUNC against a table/view in LocalStack’s Snowflake emulation, LocalStack errors with:
function DATE_TRUNC(snowflakevarchar, snowflakevarchar) is not unique
Could not choose a best candidate function. You might need to add explicit type casts.
The same query works on real Snowflake. This looks like an overload-resolution / type-inference issue where the second argument is being treated as snowflakevarchar (text) instead of a timestamp.
The error I get
Error: {'S': 'ERROR', 'V': 'ERROR', 'C': '42725', 'M': 'function DATE_TRUNC(snowflakevarchar, snowflakevarchar) is not unique', 'H': 'Could not choose a best candidate function. You might need to add explicit type casts.', 'P': '8', 'F': 'parse_func.c', 'L': '570', 'R': 'ParseFuncOrColumn'}
Expected Behavior
DATE_TRUNC('SECOND', INTERVAL_UTC)should work whenINTERVAL_UTCis a timestamp column (or is represented as such in the Snowflake emulation), matching Snowflake behavior.
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)
With a docker-compose file
Example that can reproduce the same issue:
WITH fake_bulk_data AS (
SELECT column1 AS interval_utc
FROM VALUES ('2025-08-22 04:00:00 Z')
)
SELECT DATE_TRUNC('SECOND', interval_utc) AS t
FROM fake_bulk_data;
Environment
- OS: Mac
- LocalStack:
LocalStack version: latest
LocalStack Docker image sha: sha256:b10d4627a112317e24ba28e16af9a2b49357ca58f4ee684313addd0ff0878ccd
LocalStack build date: 2026-01-22T16:28:00.632921ZAnything else?
No response