nastra commented on code in PR #14882:
URL: https://github.com/apache/iceberg/pull/14882#discussion_r2635150059
##########
core/src/main/java/org/apache/iceberg/rest/requests/PlanTableScanRequest.java:
##########
@@ -43,8 +49,47 @@ public List<String> select() {
return select;
}
+ /**
+ * Returns the filter expression, deserializing it without schema context.
+ *
+ * <p>Note: This method does not perform type-aware deserialization and may
not work correctly for
+ * BINARY, FIXED, and DECIMAL types. Use {@link #filter(Schema)} instead for
proper type handling.
+ *
+ * @return the filter expression, or null if no filter was specified
+ * @deprecated since 1.11.0, will be removed in 1.12.0; use {@link
#filter(Schema)} instead for
+ * proper type-aware deserialization
+ */
+ @Deprecated
public Expression filter() {
- return filter;
+ if (filterJson == null) {
+ return null;
+ }
+ return ExpressionParser.fromJson(filterJson);
+ }
+
+ /**
+ * Returns the filter expression, deserializing it with the provided schema
for type inference.
+ *
+ * <p>This method should be preferred over {@link #filter()} as it properly
handles BINARY, FIXED,
+ * and DECIMAL types by using schema information for type-aware
deserialization.
+ *
+ * @param schema the table schema to use for type-aware deserialization of
filter values
+ * @return the filter expression, or null if no filter was specified
+ */
+ public Expression filter(Schema schema) {
Review Comment:
<img width="847" height="333" alt="image"
src="https://github.com/user-attachments/assets/f209f4e0-23c6-403e-8c1e-f1903f448ffb"
/>
--
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]