zhangfengcdt commented on code in PR #2831:
URL: https://github.com/apache/sedona/pull/2831#discussion_r3119292579
##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala:
##########
@@ -54,40 +54,47 @@ case class JoinQueryDetection(
*/
class JoinQueryDetector(sparkSession: SparkSession) extends SparkStrategy {
+ // Geography spatial joins are not yet supported —
TraitJoinQueryBase.toSpatialRDD deserializes
+ // join keys with GeometrySerializer, which would fail on Geography bytes.
When either side of a
+ // dual-dispatch predicate (e.g. ST_Contains) is GeographyUDT, skip join
planning and let Spark
+ // evaluate the predicate row-by-row via InferredExpression.
+ private def isGeographyInput(shape: Expression): Boolean =
+ shape.dataType.isInstanceOf[GeographyUDT]
+
private def getJoinDetection(
left: LogicalPlan,
right: LogicalPlan,
predicate: ST_Predicate,
extraCondition: Option[Expression] = None): Option[JoinQueryDetection] =
{
predicate match {
- case ST_Contains(Seq(leftShape, rightShape)) =>
+ case ST_Intersects(Seq(leftShape, rightShape)) =>
Review Comment:
Yes, the ST_Contains moved out of getJoinDetection because it was converted
to InferredExpression in this PR (dual-dispatch JTS + S2 Geography). That
removed it from the ST_Predicate class hierarchy, so it no longer is
type-checked.
Once we do the same geography function changes for other predicates, we will
move them as well.
--
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]