kevinjqliu commented on code in PR #1206:
URL: https://github.com/apache/iceberg-python/pull/1206#discussion_r1777321794


##########
pyiceberg/io/pyarrow.py:
##########
@@ -1068,20 +1068,13 @@ 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":
+        elif isinstance(primitive, pa.Time64Type) and primitive.unit in ["us", 
"ns"]:

Review Comment:
   So this function is converting pyarrow types to Iceberg types. 
   
   In the example of timestamp type (`pa.types.is_timestamp(primitive)`), we 
check if the `unit` (or precision) is `ns`. If it is and the 
`downcast-ns-timestamp-to-us-on-write` is set, we want to downcast the `unit` 
from `ns` to `us`.
   If its not, we don't do anything special and just return the Iceberg type.
   
   We want to do the same thing with the `Time64Type` type. 
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to