小编Aym*_*hal的帖子

无法执行用户定义的函数(VectorAssembler

我正在使用 Kmeans 作为聚类算法,我的代码想要执行并向我显示此错误:

org.apache.spark.SparkException: Failed to execute user defined function(VectorAssembler$$Lambda$1525/671078904: (struct<latitude:double,longitude:double>) => struct<type:tinyint,size:int,indices:array<int>,values:array<double>>)
    at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

这是数据框代码:

org.apache.spark.SparkException: Failed to execute user defined function(VectorAssembler$$Lambda$1525/671078904: (struct<latitude:double,longitude:double>) => struct<type:tinyint,size:int,indices:array<int>,values:array<double>>)
    at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

对于架构它是有效的,但如果我把节目放出来,我就会遇到问题。

scala apache-spark apache-spark-ml

6
推荐指数
2
解决办法
5904
查看次数

标签 统计

apache-spark ×1

apache-spark-ml ×1

scala ×1