You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sedona.apache.org by ji...@apache.org on 2020/12/30 07:07:54 UTC
[incubator-sedona] branch master updated: [maven-release-plugin]
revert the scala file commit
This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sedona.git
The following commit(s) were added to refs/heads/master by this push:
new 097c7b3 [maven-release-plugin] revert the scala file commit
097c7b3 is described below
commit 097c7b330ae508ef42e5ffd2abecb4f89b29a02d
Author: Jia Yu <ji...@apache.org>
AuthorDate: Tue Dec 29 23:07:41 2020 -0800
[maven-release-plugin] revert the scala file commit
---
.../org/apache/sedona/sql/UDF/UdfRegistrator.scala | 8 ++---
.../strategy/join/JoinQueryDetector.scala | 36 +++++++++++-----------
.../strategy/join/TraitJoinQueryExec.scala | 8 ++---
3 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/sql/src/main/scala/org/apache/sedona/sql/UDF/UdfRegistrator.scala b/sql/src/main/scala/org/apache/sedona/sql/UDF/UdfRegistrator.scala
index 30dc107..7074408 100644
--- a/sql/src/main/scala/org/apache/sedona/sql/UDF/UdfRegistrator.scala
+++ b/sql/src/main/scala/org/apache/sedona/sql/UDF/UdfRegistrator.scala
@@ -29,13 +29,13 @@ object UdfRegistrator {
def registerAll(sparkSession: SparkSession): Unit = {
Catalog.expressions.foreach(f => sparkSession.sessionState.functionRegistry.createOrReplaceTempFunction(f.getClass.getSimpleName.dropRight(1), f))
-//Catalog.aggregateExpressions.foreach(f => sparkSession.udf.register(f.getClass.getSimpleName, functions.udaf(f))) // SPARK3 anchor
-Catalog.aggregateExpressions_UDAF.foreach(f => sparkSession.udf.register(f.getClass.getSimpleName, f)) // SPARK2 anchor
+Catalog.aggregateExpressions.foreach(f => sparkSession.udf.register(f.getClass.getSimpleName, functions.udaf(f))) // SPARK3 anchor
+//Catalog.aggregateExpressions_UDAF.foreach(f => sparkSession.udf.register(f.getClass.getSimpleName, f)) // SPARK2 anchor
}
def dropAll(sparkSession: SparkSession): Unit = {
Catalog.expressions.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName.dropRight(1))))
-//Catalog.aggregateExpressions.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK3 anchor
-Catalog.aggregateExpressions_UDAF.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK2 anchor
+Catalog.aggregateExpressions.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK3 anchor
+//Catalog.aggregateExpressions_UDAF.foreach(f => sparkSession.sessionState.functionRegistry.dropFunction(FunctionIdentifier(f.getClass.getSimpleName))) // SPARK2 anchor
}
}
\ No newline at end of file
diff --git a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
index 184249d..df624f9 100644
--- a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
+++ b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/JoinQueryDetector.scala
@@ -36,48 +36,48 @@ object JoinQueryDetector extends Strategy {
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
// ST_Contains(a, b) - a contains b
-//case Join(left, right, Inner, Some(ST_Contains(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Contains(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Contains(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Contains(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(left, right, Seq(leftShape, rightShape), false)
// ST_Intersects(a, b) - a intersects b
-//case Join(left, right, Inner, Some(ST_Intersects(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Intersects(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Intersects(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Intersects(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(left, right, Seq(leftShape, rightShape), true)
// ST_WITHIN(a, b) - a is within b
-//case Join(left, right, Inner, Some(ST_Within(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Within(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Within(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Within(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(right, left, Seq(rightShape, leftShape), false)
// ST_Overlaps(a, b) - a overlaps b
-//case Join(left, right, Inner, Some(ST_Overlaps(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Overlaps(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Overlaps(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Overlaps(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(right, left, Seq(rightShape, leftShape), false)
// ST_Touches(a, b) - a touches b
-//case Join(left, right, Inner, Some(ST_Touches(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Touches(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Touches(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Touches(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(left, right, Seq(leftShape, rightShape), true)
// ST_Distance(a, b) <= radius consider boundary intersection
-//case Join(left, right, Inner, Some(LessThanOrEqual(ST_Distance(Seq(leftShape, rightShape)), radius)), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(LessThanOrEqual(ST_Distance(Seq(leftShape, rightShape)), radius))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(LessThanOrEqual(ST_Distance(Seq(leftShape, rightShape)), radius)), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(LessThanOrEqual(ST_Distance(Seq(leftShape, rightShape)), radius))) => // SPARK2 anchor
planDistanceJoin(left, right, Seq(leftShape, rightShape), radius, true)
// ST_Distance(a, b) < radius don't consider boundary intersection
-//case Join(left, right, Inner, Some(LessThan(ST_Distance(Seq(leftShape, rightShape)), radius)), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(LessThan(ST_Distance(Seq(leftShape, rightShape)), radius))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(LessThan(ST_Distance(Seq(leftShape, rightShape)), radius)), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(LessThan(ST_Distance(Seq(leftShape, rightShape)), radius))) => // SPARK2 anchor
planDistanceJoin(left, right, Seq(leftShape, rightShape), radius, false)
// ST_Equals(a, b) - a is equal to b
-//case Join(left, right, Inner, Some(ST_Equals(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Equals(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Equals(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Equals(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(left, right, Seq(leftShape, rightShape), false)
// ST_Crosses(a, b) - a crosses b
-//case Join(left, right, Inner, Some(ST_Crosses(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
-case Join(left, right, Inner, Some(ST_Crosses(Seq(leftShape, rightShape)))) => // SPARK2 anchor
+case Join(left, right, Inner, Some(ST_Crosses(Seq(leftShape, rightShape))), _) => // SPARK3 anchor
+//case Join(left, right, Inner, Some(ST_Crosses(Seq(leftShape, rightShape)))) => // SPARK2 anchor
planSpatialJoin(right, left, Seq(rightShape, leftShape), false)
case _ =>
diff --git a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/TraitJoinQueryExec.scala b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/TraitJoinQueryExec.scala
index c64f01e..b6fb28b 100644
--- a/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/TraitJoinQueryExec.scala
+++ b/sql/src/main/scala/org/apache/spark/sql/sedona_sql/strategy/join/TraitJoinQueryExec.scala
@@ -38,8 +38,8 @@ trait TraitJoinQueryExec {
// Using lazy val to avoid serialization
@transient private lazy val boundCondition: (InternalRow => Boolean) = {
if (extraCondition.isDefined) {
-//Predicate.create(extraCondition.get, left.output ++ right.output).eval _ // SPARK3 anchor
-newPredicate(extraCondition.get, left.output ++ right.output).eval _ // SPARK2 anchor
+Predicate.create(extraCondition.get, left.output ++ right.output).eval _ // SPARK3 anchor
+//newPredicate(extraCondition.get, left.output ++ right.output).eval _ // SPARK2 anchor
} else { (r: InternalRow) =>
true
}
@@ -134,8 +134,8 @@ newPredicate(extraCondition.get, left.output ++ right.output).eval _ // SPARK2 a
matches.rdd.mapPartitions { iter =>
val filtered =
if (extraCondition.isDefined) {
-//val boundCondition = Predicate.create(extraCondition.get, left.output ++ right.output) // SPARK3 anchor
-val boundCondition = newPredicate(extraCondition.get, left.output ++ right.output) // SPARK2 anchor
+val boundCondition = Predicate.create(extraCondition.get, left.output ++ right.output) // SPARK3 anchor
+//val boundCondition = newPredicate(extraCondition.get, left.output ++ right.output) // SPARK2 anchor
iter.filter {
case (l, r) =>
val leftRow = l.getUserData.asInstanceOf[UnsafeRow]