Kontinuation commented on code in PR #14101:
URL: https://github.com/apache/iceberg/pull/14101#discussion_r2610598858
##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionVisitors.java:
##########
@@ -318,7 +350,6 @@ public <T> R predicate(BoundPredicate<T> pred) {
"Invalid operation for BoundSetPredicate: " + pred.op());
}
}
-
Review Comment:
Change reverted
##########
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java:
##########
@@ -579,6 +593,8 @@ private static String sanitize(Literal<?> literal, long
now, int today) {
return sanitizeNumber(((Literals.DoubleLiteral) literal).value(),
"float");
} else if (literal instanceof Literals.VariantLiteral) {
return sanitizeVariant(((Literals.VariantLiteral) literal).value(), now,
today);
+ } else if (literal instanceof BoundingBoxLiteral) {
+ return "(geospatial)";
Review Comment:
Change the sanitized string for bounding box literals.
I have also found that the expression sanitization code could be furture
simplified as by product of addressing this review comment. I have removed 2
overloaded versions of `ExpressionUtil.sanitize`, the code still seemed to have
the correct semantics and passed all related tests.
##########
core/src/test/java/org/apache/iceberg/expressions/TestExpressionParser.java:
##########
@@ -544,4 +563,122 @@ public void testNegativeScaleDecimalLiteral() {
assertThat(ExpressionParser.toJson(ExpressionParser.fromJson(expected),
true))
.isEqualTo(expected);
}
+
+ @Test
+ public void testSpatialPredicate() {
+ String expected =
+ "{\n"
+ + " \"type\" : \"st-intersects\",\n"
Review Comment:
I have added this to `rest-catalog-open-api.yaml` and regenerated the Python
code. This is a change to the REST Catalog API spec so maybe we want to have
broader discussion about this change.
--
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]