stevenzwu commented on code in PR #14101:
URL: https://github.com/apache/iceberg/pull/14101#discussion_r2604371067
##########
api/src/main/java/org/apache/iceberg/expressions/Literals.java:
##########
@@ -719,4 +722,45 @@ public String toString() {
return "X'" + BaseEncoding.base16().encode(bytes) + "'";
}
}
+
+ static class BoundingBoxLiteral extends BaseLiteral<ByteBuffer> {
+ private static final Comparator<ByteBuffer> CMP =
+
Comparators.<ByteBuffer>nullsFirst().thenComparing(Comparators.unsignedBytes());
+
+ BoundingBoxLiteral(BoundingBox value) {
+ super(value.toByteBuffer());
+ }
+
+ BoundingBoxLiteral(ByteBuffer value) {
+ super(value);
+ }
+
+ @Override
+ protected Type.TypeID typeId() {
+ return Type.TypeID.GEOMETRY;
Review Comment:
this seems a bit weird to me. bounding box literal can only be `GEOMETRY`
type?
Maybe we should revisit a previous discussion.
https://github.com/apache/iceberg/pull/12667#discussion_r2456577612
Maybe the `BoundingBox` needs to include the geo type?
##########
api/src/main/java/org/apache/iceberg/expressions/Literal.java:
##########
@@ -71,6 +72,10 @@ static Literal<BigDecimal> of(BigDecimal value) {
return new Literals.DecimalLiteral(value);
}
+ static Literal<ByteBuffer> of(BoundingBox value) {
Review Comment:
curious if `BoundingBox` is the only geo literal we are going to have.
--
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]