zhongyujiang commented on code in PR #2429:
URL: https://github.com/apache/iceberg-python/pull/2429#discussion_r2375526651
##########
pyiceberg/table/upsert_util.py:
##########
@@ -14,38 +14,61 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-import functools
-import operator
+from math import isnan
+from typing import Any
import pyarrow as pa
from pyarrow import Table as pyarrow_table
from pyarrow import compute as pc
from pyiceberg.expressions import (
AlwaysFalse,
+ And,
BooleanExpression,
EqualTo,
In,
+ IsNaN,
+ IsNull,
Or,
)
def create_match_filter(df: pyarrow_table, join_cols: list[str]) ->
BooleanExpression:
Review Comment:
If I understand this correctly, this is creating a predicate to test whether
a row might exist in the `pyarrow_table` (matching on `join_cols`).
And since `Null == Any` should always return unknown in SQL, can we just
filter out any rows from the `pyarrow_table` where the `join_cols` fields
contain `None`(we treat `None` as SQL `Null`), and then build the match filter
based on the filtered pyarrow table (using the existing logic for building the
match filter)? This would be much simpler.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]