MCPcopy Create free account
hub / github.com/apache/arrow / SetMetadata

Method SetMetadata

cpp/src/arrow/dataset/file_parquet.cc:831–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829}
830
831Status ParquetFileFragment::SetMetadata(
832 std::shared_ptr<parquet::FileMetaData> metadata,
833 std::shared_ptr<parquet::arrow::SchemaManifest> manifest,
834 std::shared_ptr<parquet::FileMetaData> original_metadata) {
835 DCHECK(row_groups_.has_value());
836
837 metadata_ = std::move(metadata);
838 manifest_ = std::move(manifest);
839 original_metadata_ = original_metadata ? std::move(original_metadata) : metadata_;
840 // The SchemaDescriptor needs to be owned by a FileMetaData instance,
841 // because SchemaManifest only stores a raw pointer (GH-39562).
842 DCHECK_EQ(manifest_->descr, original_metadata_->schema())
843 << "SchemaDescriptor should be owned by the original FileMetaData";
844
845 if (!physical_schema_) {
846 physical_schema_ = given_physical_schema_;
847 }
848
849 statistics_expressions_.resize(row_groups_->size(), compute::literal(true));
850 statistics_expressions_complete_.resize(manifest_->descr->num_columns(), false);
851
852 for (int row_group : *row_groups_) {
853 // Ensure RowGroups are indexing valid RowGroups before augmenting.
854 if (row_group < metadata_->num_row_groups()) continue;
855
856 return Status::IndexError("ParquetFileFragment references row group ", row_group,
857 " but ", source_.path(), " only has ",
858 metadata_->num_row_groups(), " row groups");
859 }
860
861 return Status::OK();
862}
863
864Status ParquetFileFragment::ClearCachedMetadata() {
865 metadata_.reset();

Callers 3

SplitByRowGroupMethod · 0.45
SubsetMethod · 0.45

Calls 9

IndexErrorFunction · 0.85
resizeMethod · 0.80
literalFunction · 0.50
OKFunction · 0.50
schemaMethod · 0.45
sizeMethod · 0.45
num_columnsMethod · 0.45
num_row_groupsMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected