Skip to content

ST_GeomFromWKT is not working #330

Description

@viswanatharv

Hi, I am trying to run the below code and its throwing the error.

Code:
spark.udf.register("ST_GeomFromWKT", org.apache.spark.sql.geosparksql.expressions.ST_GeomFromWKT)
spark.sql("""SELECT ST_GeomFromWKT('POINT(40.7128,-74.0060)') AS geometry""").show(10,false)

Error:
Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot resolve 'UDF:ST_GeomFromWKT(POINT(40.7128,-74.0060))' due to data type mismatch: argument 1 requires array<struct<>> type, however, ''POINT(40.7128,-74.0060)'' is of string type.; line 1 pos 7;
'Project [UDF:ST_GeomFromWKT(POINT(40.7128,-74.0060)) AS geometry#0]
+- OneRowRelation

GeoSpark version = 1.2.0-SNAPSHOT
GeoSparkSQL Version = 1.2.0-SNAPSHOT
Apache Spark version = 2.4.0
JRE version = 1.8
API type = Scala

Thanks
Vish

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions