bug: Incorrect mapping for timezone-less timestamp between Ibis schema and sqlglot #11062
Open
1 task done
Labels
bug
Incorrect behavior inside of ibis
What happened?
When converting an Ibis schema containing a timezone-less Timestamp column (i.e.
dt.Timestamp
withtimezone
set toNone
) via a Databricks backend, the column is mapped to the sqlglotTIMESTAMP
(defined in_from_ibis_Timestamp
in theSqlglotType
class). However, in Databricks,TIMESTAMP
corresponds to the timestamp type with timezone information (https://docs.databricks.com/aws/en/sql/language-manual/data-types/timestamp-type). The correct type to convert to should beTIMESTAMP_NTZ
(https://docs.databricks.com/aws/en/sql/language-manual/data-types/timestamp-ntz-type).Example:
As a workaround, I was able to monkey patch this behavior locally by implementing a custom DatabricksTypeMapper with a
def _from_ibis_Timestamp
method that returnssge.DataType(this=sge.DataType.Type.TIMESTAMPNTZ)
when the input timestamp'stimezone
isNone
and wiring this TypeMapper into the DatabricksCompiler:What version of ibis are you using?
10.3.1
What backend(s) are you using, if any?
Databricks
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: