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
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