diff --git a/parquet_file/src/chunk.rs b/parquet_file/src/chunk.rs index 61b37edfe9..8ab764c3c4 100644 --- a/parquet_file/src/chunk.rs +++ b/parquet_file/src/chunk.rs @@ -1,7 +1,4 @@ -use crate::{ - metadata::{IoxMetadata, IoxParquetMetaData}, - storage::Storage, -}; +use crate::{metadata::IoxParquetMetaData, storage::Storage}; use data_types::{ partition_metadata::{Statistics, TableSummary}, timestamp::TimestampRange, @@ -118,20 +115,10 @@ impl ParquetChunk { store: Arc, file_size_bytes: usize, parquet_metadata: Arc, + table_name: Arc, + partition_key: Arc, metrics: ChunkMetrics, ) -> Result { - let iox_md = parquet_metadata - .read_iox_metadata() - .context(IoxMetadataReadFailed { - path: &file_location, - })?; - - let IoxMetadata { - table_name, - partition_key, - .. - } = iox_md; - let schema = parquet_metadata.read_schema().context(SchemaReadFailed { path: &file_location, })?; diff --git a/server/src/db/lifecycle/write.rs b/server/src/db/lifecycle/write.rs index fe3bad1f1e..855fcfe437 100644 --- a/server/src/db/lifecycle/write.rs +++ b/server/src/db/lifecycle/write.rs @@ -53,6 +53,8 @@ pub(super) fn write_chunk_to_object_store( )> { let db = Arc::clone(&chunk.data().db); let addr = chunk.addr().clone(); + let table_name = Arc::clone(&addr.table_name); + let partition_key = Arc::clone(&addr.partition_key); let (tracker, registration) = db.jobs.register(Job::WriteChunk { chunk: addr.clone(), @@ -116,8 +118,8 @@ pub(super) fn write_chunk_to_object_store( // between creation and the transaction commit. let metadata = IoxMetadata { creation_timestamp: Utc::now(), - table_name: Arc::clone(&addr.table_name), - partition_key: Arc::clone(&addr.partition_key), + table_name: Arc::clone(&table_name), + partition_key: Arc::clone(&partition_key), chunk_id: addr.chunk_id, partition_checkpoint, database_checkpoint, @@ -141,6 +143,8 @@ pub(super) fn write_chunk_to_object_store( Arc::clone(&db.store), file_size_bytes, Arc::clone(&parquet_metadata), + Arc::clone(&table_name), + Arc::clone(&partition_key), metrics, ) .context(ParquetChunkError)?, diff --git a/server/src/db/load.rs b/server/src/db/load.rs index 1c5add8ad5..b33cc42d91 100644 --- a/server/src/db/load.rs +++ b/server/src/db/load.rs @@ -210,6 +210,8 @@ impl CatalogState for Loader { object_store, info.file_size_bytes, info.metadata, + Arc::clone(&iox_md.table_name), + Arc::clone(&iox_md.partition_key), metrics, ) .context(ChunkCreationFailed {