0
我想将预测结果DataFrame写回oracle数据库,就像这样: model.transform(testDate).write.mode(SaveMode.Overwrite).jdbc(url,“b_spark_tst” ,道具)Spark写DataFrame出jdbc错误
但我收到此错误信息:
Exception in thread "main" java.lang.IllegalArgumentException: Can't get JDBC type for array<string>
谁能帮助我如何写出来DataFrames数据库?
谢谢!
更新:
这是我的数据框的模式看起来像:
root
|-- CATEG: string (nullable = true)
|-- COMM: string (nullable = true)
|-- label: double (nullable = true)
|-- words: array (nullable = true)
| |-- element: string (containsNull = true)
|-- features: vector (nullable = true)
|-- rawPrediction: vector (nullable = true)
|-- probability: vector (nullable = true)
|-- prediction: double (nullable = true)
如何定义你想要覆盖的表格?以及数据框架的结构如何?用模式结构更新了 – FaigB
。我认为单词列将成为问题。我还没有在数据库中创建我的表格,但我应该吗? :) – solarenqu
如果我修改我的代码:model.transform(testDate).select(“CATEG”,“COMM”,“label”,“fatures”,“rawPrediction”,“probability”,“prediction”)。write.mode (SaveMode.Append).jdbc(url,“b_spark_tst”,prop)我看不到标签异常.. :( – solarenqu