Skip to content
New issue

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

is there a way to make writing timestamp_ntz optional #2339

Closed
djouallah opened this issue Mar 25, 2024 · 3 comments
Closed

is there a way to make writing timestamp_ntz optional #2339

djouallah opened this issue Mar 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@djouallah
Copy link

currently Fabric don't support reading delta table with timestamp_ntz columns, is there a way to turn it off ?

@djouallah djouallah added the enhancement New feature or request label Mar 25, 2024
@djouallah djouallah changed the title is there a way to turn off timestamp_ntz is there a way to make writing timestamp_ntz optional Mar 25, 2024
@t1g0rz
Copy link
Contributor

t1g0rz commented Mar 25, 2024

@djouallah

It seems to me that you can explicitly specify the timezone that you prefer. As far as I remember, in the previous version, there was a default UTC timezone. Now, you just need to add the timezone to the schema definition:

from deltalake import DeltaTable
import pyarrow as pa

DeltaTable.create('./test1', schema=pa.schema([pa.field('ts', pa.timestamp('us', tz='UTC'))]))
DeltaTable.create('./test2', schema=pa.schema([pa.field('ts', pa.timestamp('us'))]))

DeltaTable('./test1').schema()
# Schema([Field(ts, PrimitiveType("timestamp"), nullable=True)])

DeltaTable('./test2').schema()
# Schema([Field(ts, PrimitiveType("timestampNtz"), nullable=True)])

You can find a reference to pyarrow documentation here.

@ion-elgreco
Copy link
Collaborator

It's only enabled when you're passing timestamps with no timezone during write.

@djouallah
Copy link
Author

Thanks, got me scared for a couple of hours, casting as TIMESTAMPTZ fixed the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants