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

Fix ST_RemovePoint in accordance with the API document

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0

    Description

      According to the API document for ST_RemovePoint, the second parameter can be omitted.

      Introduction: RETURN Line with removed point at given index, position can be omitted and then last one will be removed.

      Format: ST_RemovePoint(geom: geometry, position: integer)

      Format: ST_RemovePoint(geom: geometry)

      But it actually fails if the second parameter isn't specified.

      $ spark-shell --packages org.apache.sedona:sedona-python-adapter-3.0_2.12:1.2.1-incubating-SNAPSHOT,org.datasyslab:geotools-wrapper:1.1.0-25.2
      
      ...
      
      scala> import org.apache.sedona.sql.utils.SedonaSQLRegistrator
      import org.apache.sedona.sql.utils.SedonaSQLRegistrator
      
      scala> SedonaSQLRegistrator.registerAll(spark)
      
      scala> spark.sql("SELECT ST_RemovePoint(ST_GeomFromWKT('LINESTRING (0 0, 1 1, 2 2)'))").show()
      java.lang.AssertionError: assertion failed
        at scala.Predef$.assert(Predef.scala:208)
        at org.apache.spark.sql.sedona_sql.expressions.ST_RemovePoint.<init>(Functions.scala:1253)
      
      ...
      

      Attachments

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              sekikn Kengo Seki
              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 - 0.5h
                  0.5h