diff --git a/pyiceberg/io/pyarrow.py b/pyiceberg/io/pyarrow.py index 999813d0c2..a8e3daf320 100644 --- a/pyiceberg/io/pyarrow.py +++ b/pyiceberg/io/pyarrow.py @@ -1068,8 +1068,14 @@ def primitive(self, primitive: pa.DataType) -> PrimitiveType: return StringType() elif pa.types.is_date32(primitive): return DateType() - elif isinstance(primitive, pa.Time64Type) and primitive.unit == "us": - return TimeType() + elif isinstance(primitive, pa.Time64Type): + if primitive.unit == "us": + return TimeType() + elif primitive.unit == "ns": + if self._downcast_ns_timestamp_to_us: + logger.warning("Iceberg does not yet support 'ns' timestamp precision. Downcasting to 'us'.") + else: + return TimeType() elif pa.types.is_timestamp(primitive): primitive = cast(pa.TimestampType, primitive) if primitive.unit in ("s", "ms", "us"):