pitrou commented on code in PR #50916:
URL: https://github.com/apache/arrow/pull/50916#discussion_r4123399378
##########
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:
I think a DCHECK is ok if it's purely testing an internal invariant.
--
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]