You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "zhangfengcdt (via GitHub)" <gi...@apache.org> on 2026/05/01 00:27:41 UTC
Re: [PR] [GH-2830] Geography BC join strategy for newly added predicates [sedona]
zhangfengcdt commented on code in PR #2871:
URL: https://github.com/apache/sedona/pull/2871#discussion_r3171535662
##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala:
##########
@@ -843,9 +886,20 @@ class JoinQueryDetector(sparkSession: SparkSession) extends SparkStrategy {
.map { distanceExpr =>
matchDistanceExpressionToJoinSide(distanceExpr, left, right) match {
case Some(side) =>
- if (broadcastSide.get == side) (Some(distanceExpr), None)
- else if (distanceExpr.references.isEmpty) (Some(distanceExpr), None)
- else (None, Some(distanceExpr))
+ if (geographyShape) {
+ // Geography distance joins read the per-row radius from the stream-side
+ // GeographyJoinShape inside GeographyDistanceRefiner, so the radius MUST
+ // also flow to the stream side. For literal radii we still keep the
+ // build-side expansion (mirror of the geometry literal optimisation).
+ if (broadcastSide.get == side) (Some(distanceExpr), Some(distanceExpr))
+ else if (distanceExpr.references.isEmpty)
+ (Some(distanceExpr), Some(distanceExpr))
+ else (None, Some(distanceExpr))
Review Comment:
Restructured into three explicit branches.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org