Closed Stegallo closed 2 months ago
when using function date() in a sql script results in Catalog Error: Scalar Function with name date does not exist! in version 0.9.8.
Catalog Error: Scalar Function with name date does not exist!
it used to work successfully in version 0.9.6.
here's code used to replicate the issue. Works in 0.9.6. Fails in 0.9.8
import fakesnow import snowflake.connector conn = snowflake.connector.connect() conn.cursor().execute('CREATE DATABASE TEST') conn.cursor().execute('USE DATABASE TEST') conn.cursor().execute('CREATE SCHEMA TEST') conn.cursor().execute('USE SCHEMA TEST') print(conn.cursor().execute("with SOURCE_TABLE AS (SELECT '2024-01-01' AS start_date) SELECT 'Hello fake world!', date(a.start_date) from SOURCE_TABLE AS a").fetchone())
Thanks for raising this, looks like this was introduced when moving from sqlglot 21.2 to 23.3 👀
Raised here https://github.com/tobymao/sqlglot/issues/3338
when using function date() in a sql script results in
Catalog Error: Scalar Function with name date does not exist!
in version 0.9.8.it used to work successfully in version 0.9.6.
here's code used to replicate the issue. Works in 0.9.6. Fails in 0.9.8