Fokko commented on code in PR #965: URL: https://github.com/apache/iceberg-python/pull/965#discussion_r1707389618
########## tests/expressions/test_parser.py: ########## @@ -199,3 +199,7 @@ def test_with_function() -> None: parser.parse("foo = 1 and lower(bar) = '2'") assert "Expected end of text, found 'and'" in str(exc_info) + + +def test_nested_field_equality() -> None: + assert EqualTo("foo.first", "a") == parser.parse("foo.first == 'a'") Review Comment: > I think we first have to come up with a proposal for representing nested fields in a flat string that doesn't result in these edge cases, or is at least configurable (e.g. Config parameter PYICEBERG__NESTED_FIELD_DELIMITER defined at the session level that defaults to `.`) I think the key to success is to have some kind of syntax for quoting literals. For example: https://spark.apache.org/docs/latest/sql-ref-literals.html Then we can parse something like: ```python 'a.b' -> Reference(('a.b',)) 'a.b'.c -> Reference(('a.b', 'c')) a.b.c -> Reference(('a', 'b', 'c')) ``` Or folks have to use: ```python row_filter=EqualTo(('a.b',), 123) row_filter=EqualTo(('a.b', 'c'), 123) row_filter=EqualTo(('a', 'b', 'c'), 123) ``` -- 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-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org