isichei commented on a change in pull request #10461:
URL: https://github.com/apache/arrow/pull/10461#discussion_r646852666
##########
File path: cpp/src/parquet/arrow/reader_internal.cc
##########
@@ -742,20 +752,20 @@ Status TransferColumnData(RecordReader* reader,
std::shared_ptr<DataType> value_
case ::arrow::Type::TIMESTAMP: {
const ::arrow::TimestampType& timestamp_type =
checked_cast<::arrow::TimestampType&>(*value_type);
- switch (timestamp_type.unit()) {
- case ::arrow::TimeUnit::MILLI:
- case ::arrow::TimeUnit::MICRO: {
- result = TransferZeroCopy(reader, value_type);
- } break;
- case ::arrow::TimeUnit::NANO: {
- if (descr->physical_type() == ::parquet::Type::INT96) {
- RETURN_NOT_OK(TransferInt96(reader, pool, value_type, &result));
- } else {
+ if (descr->physical_type() == ::parquet::Type::INT96) {
+ RETURN_NOT_OK(TransferInt96(reader, pool, value_type, &result,
timestamp_type.unit()));
+ }
+ else {
+ switch (timestamp_type.unit()) {
+ case ::arrow::TimeUnit::SECOND:
+ case ::arrow::TimeUnit::MILLI:
+ case ::arrow::TimeUnit::MICRO:
+ case ::arrow::TimeUnit::NANO: {
result = TransferZeroCopy(reader, value_type);
- }
- } break;
- default:
- return Status::NotImplemented("TimeUnit not supported");
+ } break;
+ default:
Review comment:
I don't think so. I was just copying how others had written switch
expressions in the existing codebase. Will remove 👍
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]