You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by gi...@apache.org on 2025/03/20 02:23:20 UTC
(iceberg-rust) branch gh-pages updated: deploy: 5690615e59c5a2150b7ad66405db5988a2e5dc63
This is an automated email from the ASF dual-hosted git repository.
github-bot pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/iceberg-rust.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new 973127b3 deploy: 5690615e59c5a2150b7ad66405db5988a2e5dc63
973127b3 is described below
commit 973127b3670dd6301fa36051c0a941a929df1436
Author: liurenjie1024 <li...@users.noreply.github.com>
AuthorDate: Thu Mar 20 02:23:16 2025 +0000
deploy: 5690615e59c5a2150b7ad66405db5988a2e5dc63
---
api/help.html | 2 +-
api/settings.html | 2 +-
.../expr/visitors/page_index_evaluator.rs.html | 50 ++++++++++++++++------
3 files changed, 40 insertions(+), 14 deletions(-)
diff --git a/api/help.html b/api/help.html
index 21943ce1..b3855f23 100644
--- a/api/help.html
+++ b/api/help.html
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-5 [...]
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-5 [...]
\ No newline at end of file
diff --git a/api/settings.html b/api/settings.html
index 8bb04340..0b4d7eab 100644
--- a/api/settings.html
+++ b/api/settings.html
@@ -1 +1 @@
-<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562 [...]
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Settings of Rustdoc"><title>Settings</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562 [...]
\ No newline at end of file
diff --git a/api/src/iceberg/expr/visitors/page_index_evaluator.rs.html b/api/src/iceberg/expr/visitors/page_index_evaluator.rs.html
index cefac593..f36314d8 100644
--- a/api/src/iceberg/expr/visitors/page_index_evaluator.rs.html
+++ b/api/src/iceberg/expr/visitors/page_index_evaluator.rs.html
@@ -1405,6 +1405,19 @@
<a href="#1405" id="1405">1405</a>
<a href="#1406" id="1406">1406</a>
<a href="#1407" id="1407">1407</a>
+<a href="#1408" id="1408">1408</a>
+<a href="#1409" id="1409">1409</a>
+<a href="#1410" id="1410">1410</a>
+<a href="#1411" id="1411">1411</a>
+<a href="#1412" id="1412">1412</a>
+<a href="#1413" id="1413">1413</a>
+<a href="#1414" id="1414">1414</a>
+<a href="#1415" id="1415">1415</a>
+<a href="#1416" id="1416">1416</a>
+<a href="#1417" id="1417">1417</a>
+<a href="#1418" id="1418">1418</a>
+<a href="#1419" id="1419">1419</a>
+<a href="#1420" id="1420">1420</a>
</pre></div><pre class="rust"><code><span class="comment">// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
@@ -1471,6 +1484,7 @@
row_group_metadata: <span class="kw-2">&</span><span class="lifetime">'a </span>RowGroupMetaData,
iceberg_field_id_to_parquet_column_index: <span class="kw-2">&</span><span class="lifetime">'a </span>HashMap<i32, usize>,
snapshot_schema: <span class="kw-2">&</span><span class="lifetime">'a </span>Schema,
+ row_count_cache: HashMap<usize, Vec<usize>>,
}
<span class="kw">impl</span><<span class="lifetime">'a</span>> PageIndexEvaluator<<span class="lifetime">'a</span>> {
@@ -1487,6 +1501,7 @@
row_group_metadata,
iceberg_field_id_to_parquet_column_index: field_id_map,
snapshot_schema,
+ row_count_cache: HashMap::new(),
}
}
@@ -1533,7 +1548,7 @@
}
<span class="kw">fn </span>calc_row_selection<F>(
- <span class="kw-2">&</span><span class="self">self</span>,
+ <span class="kw-2">&mut </span><span class="self">self</span>,
field_id: i32,
predicate: F,
missing_col_behavior: MissingColBehavior,
@@ -1575,17 +1590,28 @@
</span><span class="kw">return </span><span class="self">self</span>.select_all_rows();
};
- <span class="kw">let </span><span class="prelude-val">Some</span>(offset_index) = <span class="self">self</span>.offset_index.get(parquet_column_index) <span class="kw">else </span>{
- <span class="comment">// if we have a column index, we should always have an offset index.
- </span><span class="kw">return </span><span class="prelude-val">Err</span>(Error::new(
- ErrorKind::Unexpected,
- <span class="macro">format!</span>(<span class="string">"Missing offset index for field id {}"</span>, field_id),
- ));
- };
+ <span class="kw">let </span>row_counts = {
+ <span class="comment">// Caches row count calculations for columns that appear multiple times in
+ // the predicate
+ </span><span class="kw">match </span><span class="self">self</span>.row_count_cache.get(<span class="kw-2">&</span>parquet_column_index) {
+ <span class="prelude-val">Some</span>(count) => count.clone(),
+ <span class="prelude-val">None </span>=> {
+ <span class="kw">let </span><span class="prelude-val">Some</span>(offset_index) = <span class="self">self</span>.offset_index.get(parquet_column_index) <span class="kw">else </span>{
+ <span class="comment">// if we have a column index, we should always have an offset index.
+ </span><span class="kw">return </span><span class="prelude-val">Err</span>(Error::new(
+ ErrorKind::Unexpected,
+ <span class="macro">format!</span>(<span class="string">"Missing offset index for field id {}"</span>, field_id),
+ ));
+ };
+
+ <span class="kw">let </span>count = <span class="self">self</span>.calc_row_counts(offset_index);
+ <span class="self">self</span>.row_count_cache
+ .insert(parquet_column_index, count.clone());
- <span class="comment">// TODO: cache row_counts to avoid recalcing if the same column
- // appears multiple times in the filter predicate
- </span><span class="kw">let </span>row_counts = <span class="self">self</span>.calc_row_counts(offset_index);
+ count
+ }
+ }
+ };
<span class="kw">let </span><span class="prelude-val">Some</span>(page_filter) = <span class="self">Self</span>::apply_predicate_to_column_index(
predicate,
@@ -1612,7 +1638,7 @@
<span class="prelude-val">Ok</span>(row_selectors.into())
}
- <span class="doccomment">/// returns a list of row counts per page
+ <span class="doccomment">/// Returns a list of row counts per page
</span><span class="kw">fn </span>calc_row_counts(<span class="kw-2">&</span><span class="self">self</span>, offset_index: <span class="kw-2">&</span>OffsetIndexMetaData) -> Vec<usize> {
<span class="kw">let </span><span class="kw-2">mut </span>remaining_rows = <span class="self">self</span>.row_group_metadata.num_rows() <span class="kw">as </span>usize;
<span class="kw">let </span><span class="kw-2">mut </span>row_counts = Vec::with_capacity(<span class="self">self</span>.offset_index.len());