feat: add a way to retrieve timestamp range from parquet chunk

pull/24376/head
Marco Neumann 2021-05-03 17:09:51 +02:00
parent c54109113e
commit 056c29aaa2
2 changed files with 11 additions and 0 deletions

View File

@ -146,6 +146,12 @@ impl Chunk {
Ok(table.path())
}
/// Return Schema for the specified table / columns
pub fn timestamp_range(&self, table_name: &str) -> Result<Option<TimestampRange>> {
let table = self.find_table(table_name)?;
Ok(table.timestamp_range())
}
// Return all tables of this chunk whose timestamp overlaps with the give one
pub fn table_names(
&self,

View File

@ -96,6 +96,11 @@ impl Table {
})
}
/// Return timestamp range of this table
pub fn timestamp_range(&self) -> Option<TimestampRange> {
self.timestamp_range
}
// Check if 2 time ranges overlap
pub fn matches_predicate(&self, timestamp_range: &Option<TimestampRange>) -> bool {
match (self.timestamp_range, timestamp_range) {