iceberg-python icon indicating copy to clipboard operation
iceberg-python copied to clipboard

[feature request] Support Time64Type[ns]

Open kevinjqliu opened this issue 1 year ago • 8 comments

Feature Request / Improvement

Currently Time64Type[ns] (Time64Type with nanosecond precision) is not supported. Only Time64Type[ms] (Time64Type with microsecond precision) is supported.

https://github.com/apache/iceberg-python/blob/d8d509ff1bc33040b9f6c90c28ee47ac7437945d/pyiceberg/io/pyarrow.py#L1071-L1072

Also add the ability to downcast, similar to the pa.types.is_timestamp(primitive): branch.

Interestingly Time64Type[ns] is False when evaluating pa.types.is_timestamp(primitive).

kevinjqliu avatar Sep 12 '24 22:09 kevinjqliu

@kevinjqliu if the issue is still available can you assign it to me please

zaryab-ali avatar Sep 19 '24 17:09 zaryab-ali

@zaryab-ali assigned to you

kevinjqliu avatar Sep 19 '24 17:09 kevinjqliu

@kevinjqliu can you please review my PR and let me know if i made a mistake (please check with extra caution as it is my first contribution to any open source project)

zaryab-ali avatar Sep 20 '24 17:09 zaryab-ali

@kevinjqliu did someone else solve the issue while it was still assigned to me??? or is this still open??? because i just made the changes and added the test case

zaryab-ali avatar Oct 01 '24 23:10 zaryab-ali

@zaryab-ali Hey, sorry about the confusion. I did not see that 2 PRs were opened for the same issue. I just assumed it was from the same person. The issue is still open, #1188, #1206, and #1215 are all trying to address it. Since it's already assigned to you, I'll take a look at #1215.

Hey @JE-Chen, since this issue is already assigned to @zaryab-ali, would you mind collaborating with him on it?

kevinjqliu avatar Oct 02 '24 18:10 kevinjqliu

This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.

github-actions[bot] avatar Apr 01 '25 00:04 github-actions[bot]

| Interestingly Time64Type[ns] is False when evaluating pa.types.is_timestamp(primitive).

I think this is expected, time64/32 is not a timestamp but a time.

>>> import pyarrow as pa
>>> pa.types.is_timestamp(pa.time64("ns"))
False
>>> pa.types.is_time(pa.time64("ns"))
True

0x26res avatar Apr 14 '25 14:04 0x26res

Hi, I see there’s an existing PR #1252 for this issue but it looks stale.
If there’s no objection, I can pick this up and open a new PR to move it forward, referencing the original work.
Please let me know if that’s okay.

jaimeferj avatar Oct 02 '25 21:10 jaimeferj