st\u geomfromtextAssert使用spark java失败

6ie5vjzr  于 2021-05-27  发布在  Spark
关注(0)|答案(1)|浏览(472)

当我输入以下代码时

Dataset<Row> df = sparkSession.sql("select -7.07378166 as longitude, 33.826661 as latitude");
    df.withColumn("ST_Geomfromtext ",
            expr("ST_GeomFromText(CONCAT('POINT(',longitude,' ',latitude,')'),4326)"))
            .show(true);

我得到以下错误:

20/07/22 14:39:56 ERROR Executor: Exception in task 0.0 in stage 1.0 (TID 1)
 java.lang.AssertionError: assertion failed
at scala.Predef$.assert(Predef.scala:156)
at org.apache.spark.sql.geosparksql.expressions.ST_GeomFromText.eval(Constructors.scala:148)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown 
Source)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown 
Source)

我需要你的帮助
谢谢您

mpbci0fu

mpbci0fu1#

从源代码中,函数st\u geomfromtext只需要1个表达式,但是有2个- concat(..) 以及 4326 请在此处查看示例

相关问题