jiayuasu commented on code in PR #2831:
URL: https://github.com/apache/sedona/pull/2831#discussion_r3113925032


##########
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:
   And other predicates do not seem to change? @zhangfengcdt 



-- 
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]

Reply via email to