You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/07 06:05:40 UTC

[GitHub] [iceberg] Fokko commented on issue #5924: Python: Fix repr of the Literals

Fokko commented on issue #5924:
URL: https://github.com/apache/iceberg/issues/5924#issuecomment-1271150482

   That's a very good point indeed. I think we have multiple cases where this can happen.
   
   - Using `literal(123)` we will always create a `LongLiteral`, since Python has no distinction between an Integer and a Long.
   - Also, when we create a bytes literal `literal(b'\00')` for the `FixedLiteral`:
   ```python
   >>> from pyiceberg.expressions.literals import literal
   >>> literal(b'\0x00')
   BinaryLiteral(b'\x00x00')
   ```
   We might also need to scale this when we bind it to a FixedLiteral field (binary field, with a fixed length). Upon binding, we should convert the type to the one in the schema, and check if the value is still within bounds (doesn't overflow an int in the case of Long to Integer, or the binary field is greater than the size of the FixedLength).


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