From 793312017ee64e69c88cf83fb6be3ffcb4697f35 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Tue, 15 Oct 2024 17:40:39 -0700 Subject: [PATCH] Clean up. --- clients/databricks/dialect/typing.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/databricks/dialect/typing.go b/clients/databricks/dialect/typing.go index 6e4ba82ee..c3d4bfcef 100644 --- a/clients/databricks/dialect/typing.go +++ b/clients/databricks/dialect/typing.go @@ -27,8 +27,11 @@ func (DatabricksDialect) DataTypeForKind(kindDetails typing.KindDetails, _ bool) case typing.ETime.Kind: switch kindDetails.ExtendedTimeDetails.Type { case ext.TimestampTzKindType: - // Using datetime2 because it's the recommendation, and it provides more precision: https://stackoverflow.com/a/1884088 return "TIMESTAMP" + case ext.TimestampNTZKindType: + // This is currently in public preview, to use this, the customer will need to enable [timestampNtz] in their delta tables. + // Ref: https://docs.databricks.com/en/sql/language-manual/data-types/timestamp-ntz-type.html + return "TIMESTAMP_NTZ" case ext.DateKindType: return "DATE" case ext.TimeKindType: @@ -73,7 +76,7 @@ func (DatabricksDialect) KindForDataType(rawType string, _ string) (typing.KindD case "timestamp": return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampTzKindType), nil case "timestamp_ntz": - return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampTzKindType), nil + return typing.NewKindDetailsFromTemplate(typing.ETime, ext.TimestampNTZKindType), nil } return typing.Invalid, fmt.Errorf("unsupported data type: %q", rawType)