divjotarora commented on code in PR #50916:
URL: https://github.com/apache/arrow/pull/50916#discussion_r4123143789


##########
cpp/src/parquet/arrow/reader_internal.cc:
##########
@@ -964,6 +1028,22 @@ Status TransferColumnData(RecordReader* reader,
       if (descr->physical_type() == ::parquet::Type::INT96) {
         RETURN_NOT_OK(
             TransferInt96(reader, pool, value_field, &result, 
timestamp_type.unit()));
+      } else if (descr->physical_type() == 
::parquet::Type::FIXED_LEN_BYTE_ARRAY) {
+        // Validate that the provided Arrow timestamp unit matches the Parquet 
unit.
+        DCHECK(descr->logical_type()->is_timestamp());
+        const auto& ts_logical =
+            checked_cast<const TimestampLogicalType&>(*descr->logical_type());
+        ARROW_ASSIGN_OR_RAISE(auto expected_unit,
+                              
ArrowTimeUnitFromParquet(ts_logical.time_unit()));
+        if (timestamp_type.unit() != expected_unit) {

Review Comment:
   This was a defensive check added based on [this 
comment](https://github.com/apache/arrow/pull/50916#pullrequestreview-5098804957).
 We established that this layer of the code can't receive a custom schema that 
might have the wrong type. I'll change the conditional to `DCHECK`, but let me 
know if you'd prefer to remove it completely.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to