Skip to content

Commit 918c50e

Browse files
committed
Address review comments
1 parent 6101875 commit 918c50e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

cpp/src/arrow/dataset/file_parquet.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,15 +802,12 @@ Status ParquetFileFragment::EnsureCompleteMetadata(parquet::arrow::FileReader* r
802802
return EnsureCompleteMetadata(reader.get());
803803
}
804804

805-
// TODO temp variable is useless
806-
std::shared_ptr<Schema> schema;
807-
RETURN_NOT_OK(reader->GetSchema(&schema));
808-
if (given_physical_schema_ && !given_physical_schema_->Equals(*schema)) {
805+
RETURN_NOT_OK(reader->GetSchema(&physical_schema_));
806+
if (given_physical_schema_ && !given_physical_schema_->Equals(*physical_schema_)) {
809807
return Status::Invalid("Fragment initialized with physical schema ",
810808
*given_physical_schema_, " but ", source_.path(),
811-
" has schema ", *schema);
809+
" has schema ", *physical_schema_);
812810
}
813-
physical_schema_ = std::move(schema);
814811

815812
if (!row_groups_) {
816813
row_groups_ = Iota(reader->num_row_groups());

cpp/src/arrow/dataset/scanner_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,7 @@ class ClearCachedMetadataFragment : public InMemoryFragment {
929929
using InMemoryFragment::InMemoryFragment;
930930

931931
Status ClearCachedMetadata() override {
932+
RETURN_NOT_OK(InMemoryFragment::ClearCachedMetadata());
932933
metadata_clear_count_.fetch_add(1);
933934
return Status::OK();
934935
}

0 commit comments

Comments
 (0)