fix(mito): avoid caching empty batches in row group (#4652)

* fix: avoid caching empty batches in row group

* fix: clippy

* Update tests/cases/standalone/common/select/last_value.sql

* fix: sqlness
This commit is contained in:
Lei, HUANG
2024-09-02 10:43:00 +08:00
committed by GitHub
parent 8eda36bfe3
commit 37dcf34bb9
3 changed files with 111 additions and 0 deletions

View File

@@ -213,6 +213,10 @@ impl RowGroupLastRowReader {
/// Updates row group's last row cache if cache manager is present.
fn maybe_update_cache(&mut self) {
if let Some(cache) = &self.cache_manager {
if self.yielded_batches.is_empty() {
// we always expect that row groups yields batches.
return;
}
let value = Arc::new(SelectorResultValue {
result: std::mem::take(&mut self.yielded_batches),
projection: self