You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "kevinjqliu (via GitHub)" <gi...@apache.org> on 2026/06/13 18:41:19 UTC

[I] Binary StartsWith visitors compare bytes as strings [iceberg-python]

kevinjqliu opened a new issue, #3497:
URL: https://github.com/apache/iceberg-python/issues/3497

   Several `StartsWith` / `NotStartsWith` visitors appear to compare binary values by converting them with `str(...)`, which gives incorrect byte-prefix behavior.
   
   Examples:
   
   ```text
   StartsWith("x", b"a") on b"aa" -> False  # expected True
   NotStartsWith("x", b"a") on b"aa" -> True # expected False
   ```
   
   This also affects planning paths:
   
   ```text
   inclusive metrics for a file containing only b"aa":
   StartsWith("x", b"a") -> False  # unsafe skip
   ```
   
   Manifest evaluation for binary `StartsWith` can also raise `TypeError` when comparing decoded `bytes` bounds to a `str` prefix.
   
   Relevant code: `pyiceberg/expressions/visitors.py` starts-with handling in expression, manifest, metrics, and residual visitors.


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Binary StartsWith visitors compare bytes as strings [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on issue #3497:
URL: https://github.com/apache/iceberg-python/issues/3497#issuecomment-4699449081

   Verified against the current worktree.
   
   ```text
   StartsWith("x", b"a") on b"aa" -> False  # expected True
   NotStartsWith("x", b"a") on b"aa" -> True # expected False
   ```
   
   Planning impact also reproduces:
   
   ```text
   inclusive metrics for a file containing only b"aa":
   StartsWith("x", b"a") -> False  # unsafe skip
   ```
   
   Manifest evaluation for binary `StartsWith` raises `TypeError` comparing decoded `bytes` bounds to a `str` prefix.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Binary StartsWith visitors compare bytes as strings [iceberg-python]

Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu closed issue #3497: Binary StartsWith visitors compare bytes as strings
URL: https://github.com/apache/iceberg-python/issues/3497


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org