我尝试在mongodb中用mongo spark连接器编写一个类型为“密集向量”的列来编写我的数据帧。
但是我收到了这个错误:
无法将[2.0,2.0,115.0,0.0,0.0,0.0,0.0,0.0]转换为BsonValue。 org.apache.spark.ml.linalg.VectorUDT@3bfc3ba7没有匹配项 BsonValue。
但为什么它不会被转换为Array [Double],请参阅:https://docs.mongodb.com/manual/reference/bson-types/
我的数据帧架构:
root
|-- label: double (nullable = false)
|-- date: timestamp (nullable = true)
|-- features: vector (nullable = true)