feat: Add first/last write time on DbChunk
To eventually be used in collect_rubpull/24376/head
parent
799406be72
commit
0c44179aa9
|
@ -1,6 +1,7 @@
|
||||||
use super::{
|
use super::{
|
||||||
catalog::chunk::ChunkMetadata, pred::to_read_buffer_predicate, streams::ReadFilterResultsStream,
|
catalog::chunk::ChunkMetadata, pred::to_read_buffer_predicate, streams::ReadFilterResultsStream,
|
||||||
};
|
};
|
||||||
|
use chrono::{DateTime, Utc};
|
||||||
use data_types::partition_metadata;
|
use data_types::partition_metadata;
|
||||||
use datafusion::physical_plan::SendableRecordBatchStream;
|
use datafusion::physical_plan::SendableRecordBatchStream;
|
||||||
use datafusion_util::MemoryStream;
|
use datafusion_util::MemoryStream;
|
||||||
|
@ -201,6 +202,20 @@ impl DbChunk {
|
||||||
pub fn table_name(&self) -> Arc<str> {
|
pub fn table_name(&self) -> Arc<str> {
|
||||||
Arc::clone(&self.table_name)
|
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 {
|
impl QueryChunk for DbChunk {
|
||||||
|
|
Loading…
Reference in New Issue