mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
feat/objbench:
### Update `objbench.rs` and `parquet.rs` for Improved File Handling - **`objbench.rs`:** - Simplified target access layer initialization by directly using `self.target`. - Added assertion to ensure single file info and constructed destination file path for reporting. - Enhanced logging to include destination file path in write completion message. - **`parquet.rs`:** - Updated test cases to include `None` for additional parameter in function calls. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com>
This commit is contained in:
@@ -134,9 +134,8 @@ impl Command {
|
||||
let total_rows = reader.parquet_metadata().file_metadata().num_rows();
|
||||
|
||||
// Prepare target access layer for writing
|
||||
let (tgt_region_dir, _tgt_file_id_hint) = split_sst_path(&self.target)?;
|
||||
let (tgt_access_layer, tgt_cache_manager) =
|
||||
build_access_layer_simple(tgt_region_dir.clone(), object_store.clone()).await?;
|
||||
build_access_layer_simple(self.target.clone(), object_store.clone()).await?;
|
||||
|
||||
// Build write request
|
||||
let write_opts = WriteOptions::default();
|
||||
@@ -164,9 +163,13 @@ impl Command {
|
||||
.build()
|
||||
})?;
|
||||
|
||||
assert_eq!(infos.len(), 1);
|
||||
let dst_file_id = infos[0].file_id;
|
||||
let dts_file_path = format!("{}/{}", self.target, dst_file_id.as_parquet(),);
|
||||
// Report results
|
||||
println!(
|
||||
"Read completed: rows={}, size={} bytes, build_reader={:?}, metrics: {:?}",
|
||||
"Write complete, dest file: {}, rows={}, size={} bytes, build_reader={:?}, metrics: {:?}",
|
||||
dts_file_path,
|
||||
total_rows, file_size, reader_build_elapsed, metrics
|
||||
);
|
||||
Ok(())
|
||||
|
||||
@@ -162,6 +162,7 @@ mod tests {
|
||||
metadata.clone(),
|
||||
NoopIndexBuilder,
|
||||
file_path,
|
||||
None
|
||||
)
|
||||
.await;
|
||||
|
||||
@@ -219,6 +220,7 @@ mod tests {
|
||||
FixedPathProvider {
|
||||
file_id: handle.file_id(),
|
||||
},
|
||||
None
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user