refactor: always use correct chunk sort key
Don't use the same sort key for all files - sort keys may grow over
time, and the information is already at hand.
@@ -640,9 +640,6 @@ impl Compactor {
let namespace_id = overlapped_files[0].data.namespace_id;
let table_id = overlapped_files[0].data.table_id;
- // Read the parquet file's sort key.
- let parquet_sort_key = overlapped_files[0].iox_metadata().sort_key;
-
// Collect all unique tombstone
let mut tombstone_map = overlapped_files[0].tombstones();
@@ -672,7 +669,6 @@ impl Compactor {
assert_eq!(file.data.namespace_id, namespace_id);
assert_eq!(file.data.table_id, table_id);
assert_eq!(file.data.partition_id, partition.id);
- assert_eq!(file.iox_metadata().sort_key, parquet_sort_key);
}
}
@@ -684,7 +680,7 @@ impl Compactor {
f.to_queryable_parquet_chunk(
self.store.clone(),
iox_metadata.table_name.to_string(),
- parquet_sort_key.clone(),
+ f.iox_metadata().sort_key,
partition.sort_key(),
)
})
