feat: Add first/last write time on DbChunk

To eventually be used in collect_rub
pull/24376/head
Carol (Nichols || Goulding) 2021-07-19 09:38:58 -04:00
parent 799406be72
commit 0c44179aa9
1 changed files with 15 additions and 0 deletions

View File

@ -1,6 +1,7 @@
use super::{
catalog::chunk::ChunkMetadata, pred::to_read_buffer_predicate, streams::ReadFilterResultsStream,
};
use chrono::{DateTime, Utc};
use data_types::partition_metadata;
use datafusion::physical_plan::SendableRecordBatchStream;
use datafusion_util::MemoryStream;
@ -201,6 +202,20 @@ impl DbChunk {
pub fn table_name(&self) -> Arc<str> {
Arc::clone(&self.table_name)
}
pub fn time_of_first_write(&self) -> DateTime<Utc> {
match &self.state {
State::MutableBuffer { chunk } => chunk.table_summary().time_of_first_write,
_ => unimplemented!(),
}
}
pub fn time_of_last_write(&self) -> DateTime<Utc> {
match &self.state {
State::MutableBuffer { chunk } => chunk.table_summary().time_of_last_write,
_ => unimplemented!(),
}
}
}
impl QueryChunk for DbChunk {