rdblue commented on pull request #3875:
URL: https://github.com/apache/iceberg/pull/3875#issuecomment-1015573169
@puchengy, I took a deeper look at this yesterday and I think it's something
that can be handled by the parser itself, which is probably better. My concern
with stripping quotes from the ends is that extra quotes may also be removed
and escaped quotes within the string itself may not be correctly unescaped.
Here's an update that uses the parser to handle this and passes your test
cases:
```diff
diff --git a/python_legacy/iceberg/api/expressions/expression_parser.py
b/python_legacy/iceberg/api/expressions/expression_parser.py
index 0ffde4e23..e231747d8 100644
--- a/python_legacy/iceberg/api/expressions/expression_parser.py
+++ b/python_legacy/iceberg/api/expressions/expression_parser.py
@@ -30,6 +30,7 @@ from pyparsing import (
opAssoc,
pyparsing_common as ppc,
quotedString,
+ removeQuotes,
Word
)
@@ -50,7 +51,7 @@ intNum = ppc.signed_integer()
columnRval = (realNum
| intNum
- | quotedString
+ | quotedString.setParseAction(removeQuotes)
| columnName) # need to add support for alg expressions
whereCondition = Group(
(columnName + binop + columnRval)
```
Can you update this PR with that fix instead?
--
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]