We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there, i have an issue with transpile. It cannot work for date_trunc from duckdb to spark/databricks, see below:
date_trunc
from pypika import CustomFunction from pypika.functions import Timestamp from sqlglot import transpile from datetime import datetime DateTrunc = CustomFunction("date_trunc", ["part", "timestamp"]) # duckdb format https://duckdb.org/docs/archive/0.2.8/sql/functions/timestamp query = DateTrunc("hour", Timestamp(datetime.now())).get_sql(dialect="duckdb") print(query) spark_sql = transpile(query, read="duckdb", write="databricks", pretty=True) print(spark_sql)
The output is
date_trunc('hour',TIMESTAMP('2023-07-01T00:29:36.860678')) ["TRUNC(TIMESTAMP('2023-07-01T00:29:36.860678'), 'hour')"]
expecting the databricks sql output be something like this date_trunc('hour',TIMESTAMP('2023-07-01T00:29:36.860678')), see doc https://docs.databricks.com/sql/language-manual/functions/date_trunc.html
date_trunc('hour',TIMESTAMP('2023-07-01T00:29:36.860678'))
The text was updated successfully, but these errors were encountered:
fe69102
No branches or pull requests
Hi there, i have an issue with transpile. It cannot work for
date_trunc
from duckdb to spark/databricks, see below:The output is
expecting the databricks sql output be something like this
date_trunc('hour',TIMESTAMP('2023-07-01T00:29:36.860678'))
, see doc https://docs.databricks.com/sql/language-manual/functions/date_trunc.htmlThe text was updated successfully, but these errors were encountered: