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/02/19 03:31:54 UTC
(iceberg-rust) branch gh-pages updated: deploy: 446665652eedc9cd23b9a3ef1ed168e6e5bc36e6
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 f42a9e43 deploy: 446665652eedc9cd23b9a3ef1ed168e6e5bc36e6
f42a9e43 is described below
commit f42a9e43f78b2c91663144b7aff9fb5f3eb9b9ff
Author: liurenjie1024 <li...@users.noreply.github.com>
AuthorDate: Wed Feb 19 03:31:50 2025 +0000
deploy: 446665652eedc9cd23b9a3ef1ed168e6e5bc36e6
---
.../physical_plan/expr_to_predicate.rs.html | 32 +++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/api/src/iceberg_datafusion/physical_plan/expr_to_predicate.rs.html b/api/src/iceberg_datafusion/physical_plan/expr_to_predicate.rs.html
index fd09975f..6ef02434 100644
--- a/api/src/iceberg_datafusion/physical_plan/expr_to_predicate.rs.html
+++ b/api/src/iceberg_datafusion/physical_plan/expr_to_predicate.rs.html
@@ -404,6 +404,21 @@
<a href="#404" id="404">404</a>
<a href="#405" id="405">405</a>
<a href="#406" id="406">406</a>
+<a href="#407" id="407">407</a>
+<a href="#408" id="408">408</a>
+<a href="#409" id="409">409</a>
+<a href="#410" id="410">410</a>
+<a href="#411" id="411">411</a>
+<a href="#412" id="412">412</a>
+<a href="#413" id="413">413</a>
+<a href="#414" id="414">414</a>
+<a href="#415" id="415">415</a>
+<a href="#416" id="416">416</a>
+<a href="#417" id="417">417</a>
+<a href="#418" id="418">418</a>
+<a href="#419" id="419">419</a>
+<a href="#420" id="420">420</a>
+<a href="#421" id="421">421</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
@@ -423,6 +438,7 @@
</span><span class="kw">use </span>std::vec;
+<span class="kw">use </span>datafusion::arrow::datatypes::DataType;
<span class="kw">use </span>datafusion::logical_expr::{Expr, Operator};
<span class="kw">use </span>datafusion::scalar::ScalarValue;
<span class="kw">use </span>iceberg::expr::{BinaryExpression, Predicate, PredicateOperator, Reference, UnaryExpression};
@@ -525,7 +541,14 @@
<span class="kw">_ </span>=> TransformedResult::NotTransformed,
}
}
- Expr::Cast(c) => to_iceberg_predicate(<span class="kw-2">&</span>c.expr),
+ Expr::Cast(c) => {
+ <span class="kw">if </span>c.data_type == DataType::Date32 || c.data_type == DataType::Date64 {
+ <span class="comment">// Casts to date truncate the expression, we cannot simply extract it as it
+ // can create erroneous predicates.
+ </span><span class="kw">return </span>TransformedResult::NotTransformed;
+ }
+ to_iceberg_predicate(<span class="kw-2">&</span>c.expr)
+ }
<span class="kw">_ </span>=> TransformedResult::NotTransformed,
}
}
@@ -809,5 +832,12 @@
Reference::new(<span class="string">"ts"</span>).greater_than_or_equal_to(Datum::string(<span class="string">"2023-01-05T00:00:00"</span>));
<span class="macro">assert_eq!</span>(predicate, expected_predicate);
}
+
+ <span class="attr">#[test]
+ </span><span class="kw">fn </span>test_predicate_conversion_with_date_cast() {
+ <span class="kw">let </span>sql = <span class="string">"ts >= date '2023-01-05T11:00:00'"</span>;
+ <span class="kw">let </span>predicate = convert_to_iceberg_predicate(sql);
+ <span class="macro">assert_eq!</span>(predicate, <span class="prelude-val">None</span>);
+ }
}
</code></pre></div></section></main></body></html>
\ No newline at end of file