Skip to content

Commit 92aa139

Browse files
committed
chore: add some comments.
1 parent 7f093dd commit 92aa139

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/query/storages/delta/src/table.rs

+11
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ pub struct DeltaTableMeta {
7373
partition_columns: Vec<String>,
7474
}
7575

76+
/// In a delta table, partition columns are not stored in parquet file.
77+
/// so it needs a few efforts to make pushdown work:
78+
/// - context:
79+
/// - Table store partition column names in meta.engine_options.
80+
/// - Each partition carries all partition column values in the same order.
81+
/// - With this order, we can get need info with a PartitionIndex.
82+
/// - pushdown:
83+
/// - projections (mask): partition columns are excluded when read parquet file and inserted at last.
84+
/// - filter pass to parquet reader: all partition columns are appended to the filter input columns.
85+
/// - pruner: ColumnRef of partition columns in filter expr are replace with const scalars.
86+
/// Type of partition columns can only be simple primitive types.
7687
impl DeltaTable {
7788
#[async_backtrace::framed]
7889
pub fn try_create(info: TableInfo) -> Result<Box<dyn Table>> {

src/query/storages/parquet/src/parquet_rs/parquet_reader/reader/full_reader.rs

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub struct ParquetRSFullReader {
6868
}
6969

7070
impl ParquetRSFullReader {
71+
// partition_fields is only used for delta table engine.
7172
pub async fn prepare_data_stream(
7273
&self,
7374
loc: &str,

src/query/storages/parquet/src/parquet_rs/pruning.rs

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ impl ParquetRSPruner {
114114
/// Return the selected row groups' indices in the meta and omit filter flags.
115115
///
116116
/// If `stats` is not [None], we use this statistics to prune but not collect again.
117+
///
118+
/// `partition_values` is used only for Delta table engine.
117119
pub fn prune_row_groups(
118120
&self,
119121
meta: &ParquetMetaData,
@@ -178,6 +180,7 @@ impl ParquetRSPruner {
178180
/// Prune pages of a parquet file.
179181
///
180182
/// Return a vector of [`RowSelection`] to represent rows to read.
183+
/// `partition_values` is used only for Delta table engine.
181184
pub fn prune_pages(
182185
&self,
183186
meta: &ParquetMetaData,

0 commit comments

Comments
 (0)