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

Cannot cast a datetime type with a timezone into a timestampz type. #863

Closed
dongsupkim-onepredict opened this issue Jun 27, 2024 · 2 comments · Fixed by #910
Closed

Cannot cast a datetime type with a timezone into a timestampz type. #863

dongsupkim-onepredict opened this issue Jun 27, 2024 · 2 comments · Fixed by #910
Assignees

Comments

@dongsupkim-onepredict
Copy link

dongsupkim-onepredict commented Jun 27, 2024

Apache Iceberg version

0.6.1 (latest release)

Please describe the bug 🐞

It seems that when inserting a pyarrow table containing UTC information created using the pendulum library into an iceberg table, an error occurs due to the inability to convert to the timestampz type.

import pendulum
import pyarrow as pa
import numpy as np

test_data_with_tz = {
    "date_time": [pendulum.now() for _ in range(nums)], #with timezone
    "int_data": [i for i in range(nums)],
    "str_data": ["v" for _ in range(nums)],
    "struct_data": [{"v_a": np.random.rand(1000), "v_b": np.random.rand(1000) } for i in range(nums)],
}
pa_table_with_tz = pa.Table.from_pydict(test_data_with_tz)

catalog.create_table(identifier=("test", "test"), schema=pa_table_with_tz.schema)

TypeError: Unsupported type: timestamp[us, tz=Etc/UTC]

@kevinjqliu
Copy link
Contributor

Thanks for reporting! There's a related thread around this at #541. And a WIP fix at #848.
cc @syun64 who's working on this

@sungwy sungwy self-assigned this Jun 27, 2024
@sungwy
Copy link
Collaborator

sungwy commented Jun 27, 2024

I'm excited to take a look into this. I'll hopefully find some time to work on this tomorrow. thanks @dongsupkim-onepredict for reporting the issue

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

Successfully merging a pull request may close this issue.

3 participants