mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-30 03:40:37 +00:00
feat: add a subcommand to bench scan (#7722)
* feat: support scan bench Signed-off-by: evenyag <realevenyag@gmail.com> * feat: support projection by name Signed-off-by: evenyag <realevenyag@gmail.com> * feat: support force flat format Signed-off-by: evenyag <realevenyag@gmail.com> * feat: spawn tasks to poll streams Signed-off-by: evenyag <realevenyag@gmail.com> * feat: support filter config Signed-off-by: evenyag <realevenyag@gmail.com> * feat: scan bench support wal Signed-off-by: evenyag <realevenyag@gmail.com> * chore: support not providing provider in wal Signed-off-by: evenyag <realevenyag@gmail.com> * fix: skip wal replay Signed-off-by: evenyag <realevenyag@gmail.com> * refactor: wrap EngineComponents Signed-off-by: evenyag <realevenyag@gmail.com> * docs: add scanbench doc Signed-off-by: evenyag <realevenyag@gmail.com> * chore: change --skip-wal-replay to --enable-wal Signed-off-by: evenyag <realevenyag@gmail.com> * chore: remove limit from config Signed-off-by: evenyag <realevenyag@gmail.com> --------- Signed-off-by: evenyag <realevenyag@gmail.com>
This commit is contained in:
@@ -124,6 +124,8 @@ pub struct ScanRequest {
|
||||
/// Optional hint for KNN vector search. When set, the scan should use
|
||||
/// vector index to find the k nearest neighbors.
|
||||
pub vector_search: Option<VectorSearchRequest>,
|
||||
/// Whether to force reading region data in flat format.
|
||||
pub force_flat_format: bool,
|
||||
}
|
||||
|
||||
impl Display for ScanRequest {
|
||||
@@ -206,6 +208,14 @@ impl Display for ScanRequest {
|
||||
vector_search.metric
|
||||
)?;
|
||||
}
|
||||
if self.force_flat_format {
|
||||
write!(
|
||||
f,
|
||||
"{}force_flat_format: {}",
|
||||
delimiter.as_str(),
|
||||
self.force_flat_format
|
||||
)?;
|
||||
}
|
||||
write!(f, " }}")
|
||||
}
|
||||
}
|
||||
@@ -259,5 +269,14 @@ mod tests {
|
||||
request.to_string(),
|
||||
"ScanRequest { projection: [1, 2], limit: 10 }"
|
||||
);
|
||||
|
||||
let request = ScanRequest {
|
||||
force_flat_format: true,
|
||||
..Default::default()
|
||||
};
|
||||
assert_eq!(
|
||||
request.to_string(),
|
||||
"ScanRequest { force_flat_format: true }"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user