Skip to content

Improve timestamp support #2270

@FredKhayat

Description

@FredKhayat

Apache Iceberg version

0.9.1 (latest release)

Please describe the bug 🐞

Currently, the pyiceberg library does not support nanosecond timestamps, or timestamp with timezones.

Now is a great time to support that since the Java Iceberg library is actively implementing those features.

How to reproduce

import pyarrow as pa
from datetime import datetime

# Create a pyarrow table with a nanosecond timestamp column
table = pa.Table.from_arrays(
    [pa.array([datetime.now()], type=pa.timestamp("ns"))], names=["timestamps"]
)

catalog.create_table("ns.table1", schema=table.schema)  # Fails since nanosecond timestamps are not supported
# Create a pyarrow table with a timestampz column
table = pa.Table.from_arrays(
    [pa.array([datetime.now()], type=pa.timestamp("ms", tz='America/New_York'))], names=["timestamps"]
)

catalog.create_table("ns.table2", schema=table.schema) # Fails since timezones are not supported

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions