mdwint commented on issue #2426:
URL: 
https://github.com/apache/iceberg-python/issues/2426#issuecomment-3255586794

   I've made some progress fixing the filter expressions in 
https://github.com/apache/iceberg-python/compare/main...mdwint:iceberg-python:fix/upsert-with-nulls
   
   The tests now confirm that the right expressions are produced. For example, 
in the last test case I can print this: 
   ```
   Or(
     left=And(
       left=IsNull(term=Reference(name='foo')),
       right=EqualTo(term=Reference(name='bar'), literal=LongLiteral(1))
     ),
     right=And(
       left=EqualTo(term=Reference(name='foo'), literal=literal('lemon')),
       right=IsNull(term=Reference(name='bar'))
     )
   )
   ```
   
   However, that last test case fails to update the row `{"foo": None, "bar": 
1, ...}` with `join_cols=["foo", "bar"]`:
   ```
   tests/table/test_upsert.py:741: in test_upsert_with_nulls
       assert upd.rows_updated == 1
   E   assert 0 == 1
   E    +  where 0 = UpsertResult(rows_updated=0, rows_inserted=1).rows_updated
   ```
   
   So I think the filter expressions are now correct, but the upsert logic 
still doesn't handle updates with null values correctly. Wild guess: maybe it 
has to do with the way null values are compared (null doesn't equal itself?). 
Any ideas?


-- 
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]

Reply via email to