[SEDONA-690] Set default metric to use Haversine for KNN join and code refactoring#1909
Merged
jiayuasu merged 3 commits intoApr 10, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot reviewed 3 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (4)
- spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastObjectSideKNNJoinExec.scala: Language not supported
- spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/BroadcastQuerySideKNNJoinExec.scala: Language not supported
- spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/KNNJoinExec.scala: Language not supported
- spark/common/src/test/scala/org/apache/sedona/sql/KnnJoinSuite.scala: Language not supported
Comments suppressed due to low confidence (3)
spark/common/src/main/java/org/apache/sedona/core/spatialOperator/JoinQuery.java:830
- Ensure that switching from 'indexedRDD' to 'spatialPartitionedRDD' here is intentional and that it does not adversely impact the join performance or expected partitioning behavior.
queryRDD.spatialPartitionedRDD.zipPartitions(objectRDD.spatialPartitionedRDD, judgement);
spark/common/src/main/java/org/apache/sedona/core/joinJudgement/KnnJoinIndexJudgement.java:48
- The change in generic types alters the method signature; please verify that all downstream usages of KnnJoinIndexJudgement align with this new type ordering to prevent potential type mismatches.
implements FlatMapFunction2<Iterator<T>, Iterator<U>, Pair<T, U>>
spark/common/src/main/java/org/apache/sedona/core/spatialOperator/JoinQuery.java:786
- The updated type for 'broadcastQueryObjects' improves type safety. Please confirm that all its usages are updated accordingly to handle 'UniqueGeometry' objects consistently.
final Broadcast<List<UniqueGeometry<U>>> broadcastQueryObjects;
jiayuasu
approved these changes
Apr 10, 2025
jiayuasu
pushed a commit
that referenced
this pull request
May 30, 2025
…e refactoring (#1909) * [SEDONA-690] Set default metric to use Haversine for KNN join and some code refactor * fix unit tests * clean up join params
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[SEDONA-XXX] my subject.What changes were proposed in this PR?
This PR change the default distance metric to use Haversine distance when use_spheroid = true. It also refactors the join index judgement code to be more readable.
How was this patch tested?
KNNTestSuit
Did this PR include necessary documentation updates?