Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-53

SpatialKnnQuery NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • spark-2.4.5-bin-hadoop2.7
      java version "1.8.0_60"

    Description

      SpatialKnnQuery while useIndex is false and k larger than spatialRDD's approximateTotalCount

      Will throw an exception:

      Caused by: java.lang.NullPointerException
      at org.datasyslab.geospark.knnJudgement.GeometryDistanceComparator.compare(GeometryDistanceComparator.java:61)
      at org.datasyslab.geospark.knnJudgement.GeometryDistanceComparator.compare(GeometryDistanceComparator.java:29)
      at scala.math.LowPriorityOrderingImplicits$$anon$7.compare(Ordering.scala:153)
      at org.apache.spark.util.collection.Utils$$anon$1.compare(Utils.scala:35)
      at org.spark_project.guava.collect.Ordering.max(Ordering.java:551)
      at org.spark_project.guava.collect.Ordering.leastOf(Ordering.java:667)
      at org.apache.spark.util.collection.Utils$.takeOrdered(Utils.scala:37)
      at org.apache.spark.rdd.RDD$$anonfun$takeOrdered$1$$anonfun$32.apply(RDD.scala:1478)
      at org.apache.spark.rdd.RDD$$anonfun$takeOrdered$1$$anonfun$32.apply(RDD.scala:1475)
      at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:823)
      at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:823)
      at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
      at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:346)
      at org.apache.spark.rdd.RDD.iterator(RDD.scala:310)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
      at org.apache.spark.scheduler.Task.run(Task.scala:123)
      at org.apache.spark.executor.Executor$TaskRunner$$anonfun$10.apply(Executor.scala:408)
      at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1360)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:414)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chenpengchuan chenpengchuan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m