我有以下Dataframe:
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+--------------+---------------+
|BinaryGeometry |GeomFromTextt |rayon |geomType |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+--------------+---------------+
|POLYGON ((-11.8108617196089 29.8507670666341, -4.57087148523385 29.7935784163308, -4.3498556231508 31.9294487995902, -1.97955533018205 34.6337837831159, -2.2294942950258 35.5618471079438, -5.32678491271918 35.8616851590318, -5.35631066955511 35.8783778180929, -5.4984462896723 35.9100841807378, -5.98665124572699 35.8160406191253, -6.87105065978949 34.1713722381582, -9.54622155822699 32.8708311306213, -11.8108617196089 29.8507670666341)) |POINT (-7.073781666666667 33.826661666666666)|null |Polygon |
|POLYGON ((-6.70005799736828 34.2118684058451, -6.66641236748546 34.1993751935347, -6.63139344658703 34.208461349766, -6.6135406633839 34.2192498881446, -6.5970611711964 34.2283339016717, -6.5695953508839 34.2328755410488, -6.54281617607921 34.2220887476075, -6.5256500383839 34.2283339016717, -6.51123048271984 34.2748740913813, -6.55242921318859 34.3026724029165, -6.56547547783703 34.2975672800575, -6.58813477959484 34.3060756457653, -6.60186768975109 34.314583149474, -6.62109376396984 34.3043740415805, -6.64169312920421 34.318553022848, -6.68426515068859 34.2538774367323, -6.70005799736828 34.2118684058451))|POINT (-7.6198783 33.5942549) |0.002 |Polygon |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------+--------------+---------------+
Dataframe的shema:
|-- BinaryGeometry: geometry (nullable = false)
|-- GeomFromTextt: geometry (nullable = false)
|-- rayon: double (nullable = true)
|-- geomType: string (nullable = true)
我正在尝试执行以下代码:
df.registerTempTable("data");
df = sparkSession.sql("select * from data where ((geomType = 'Polygon' OR geomType='Point') AND ST_IntersectS(ST_Buffer(BinaryGeometry,rayon),GeomFromTextt)) ");
df.show();
我得到以下错误:
20/08/15 20:22:10 ERROR Executor: Exception in task 87.0 in stage 80.0 (TID 1600) scala.MatchError: null
at org.apache.spark.sql.geosparksql.expressions.ST_Buffer.eval(Functions.scala:127)
at org.apache.spark.sql.geosparksql.expressions.ST_Intersects.eval(Predicates.scala:74)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificPredicate.And_0$(Unknown Source)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificPredicate.eval(Unknown Source)
at org.apache.spark.sql.execution.joins.CartesianProductExec$$anonfun$doExecute$1$$anonfun$2.apply(CartesianProductExec.scala:89)
at org.apache.spark.sql.execution.joins.CartesianProductExec$$anonfun$doExecute$1$$anonfun$2.apply(CartesianProductExec.scala:88)
暂无答案!
目前还没有任何答案,快来回答吧!