Skip to content

[GH-3042] Flink Box3D predicates: ST_Intersects / ST_Contains + ST_3DDWithin#3043

Open
jiayuasu wants to merge 1 commit into
apache:masterfrom
jiayuasu:feature/flink-box3d-predicates
Open

[GH-3042] Flink Box3D predicates: ST_Intersects / ST_Contains + ST_3DDWithin#3043
jiayuasu wants to merge 1 commit into
apache:masterfrom
jiayuasu:feature/flink-box3d-predicates

Conversation

@jiayuasu

Copy link
Copy Markdown
Member

Did you read the Contributor Guide?

  • Yes

Is this PR related to a ticket?

What changes were proposed in this PR?

Final Flink Box3D slice. Brings the Flink predicate surface to parity with Spark's Box3D predicates (consolidated into ST_Intersects / ST_Contains plus the standalone ST_3DDWithin).

  • ST_Intersects / ST_Contains: Box3D eval overloads wrapping Predicates.box3dIntersects / box3dContains. Mirrors the Box2D overloads already on these classes.
  • ST_3DDWithin: new scalar function with two overloads — (Geometry, Geometry, Double)dWithin3D (missing Z folds to 0), and (Box3D, Box3D, Double)dWithin3D. NULL-guarded like the Box overloads. Registered in Catalog.

How was this patch tested?

  • PredicateTest.testIntersectsOnBox3D / testContainsOnBox3D — XY-overlapping-but-Z-disjoint rows confirm the Z axis is enforced (not just an XY-footprint check).
  • PredicateTest.test3DDWithin — Geometry POINT Z within / just-outside the threshold, plus Box3D-on-Box3D faces-apart-in-Z within / just-outside.
  • Full PredicateTest: 21 pass.

Did this PR include necessary documentation updates?

  • No — Box3D documentation is tracked separately under the Box3D EPIC.

Completion

This completes Flink Box3D parity with the shipped Spark surface: type + serializer, constructors, accessors, ST_AsText, ST_3DExtent, and predicates.

… ST_3DDWithin

Final Flink Box3D slice, bringing the Flink predicate surface to parity
with Spark's Box3D predicates.

- ST_Intersects / ST_Contains: Box3D eval overloads wrapping
  Predicates.box3dIntersects / box3dContains, mirroring the Box2D
  overloads already on these classes.
- New ST_3DDWithin scalar function: (Geometry, Geometry, Double) →
  dWithin3D (missing Z folds to 0) and (Box3D, Box3D, Double) →
  dWithin3D. NULL-guarded.
- Registered ST_3DDWithin in Catalog.

Tests:
- PredicateTest.testIntersectsOnBox3D / testContainsOnBox3D: the
  XY-overlapping-but-Z-disjoint rows confirm the Z axis is enforced.
- PredicateTest.test3DDWithin: Geometry POINT Z within / just-outside,
  plus Box3D-on-Box3D faces-apart-in-Z within / just-outside.

This completes Flink Box3D parity with the Spark surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant