You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "Kengo Seki (Jira)" <ji...@apache.org> on 2022/09/19 15:26:00 UTC

[jira] [Created] (SEDONA-169) Fix ST_RemovePoint in accordance with the API document

Kengo Seki created SEDONA-169:
---------------------------------

             Summary: Fix ST_RemovePoint in accordance with the API document
                 Key: SEDONA-169
                 URL: https://issues.apache.org/jira/browse/SEDONA-169
             Project: Apache Sedona
          Issue Type: Bug
            Reporter: Kengo Seki


According to the API document for {{ST_RemovePoint}}, the second parameter can be omitted.
{quote}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)
{quote}
But it actually fails if the second parameter isn't specified.
{code:java}
$ 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)

...
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)