我试图用f#创建一个简单的sparkDataframe,因为它在spark.net测试中使用
let schema =
StructType (
[|
StructField("Name", new StringType())
StructField("Age", new IntegerType())
StructField("Date", new DateType())
|] )
let rows: obj[][] =
[|
[| "Alice"; 20; new Date(2020, 1, 1) |]
|]
session.CreateDataFrame(rows |> Array.map GenericRow, schema).Show(10, 0, false)
最终,此代码失败(与使用.net集合的代码完全相同)
JVM method execution failed: Nonstatic method 'createDataFrame' failed for class '7' when called with 2 arguments ([Index=1, Type=GenericRow[], Value=Microsoft.Spark.Sql.GenericRow[]], [Index=2, Type=JvmObjectReference, Value=8], )
1条答案
按热度按时间pexxcrt21#
以上这些对我来说很好
请检查你使用的Spark<2.4.5我用2.4.1做了测试
java>1.8版
同时检查是否提供了所有参数
$spark_home/bin/spark submit--类org.apache.spark.deploy.dotnet.dotnetrunner--主本地bin/debug/netcoreapp3.1/microsoft-spark-2.4.x-0.11.0.jar dotnet bin/debug/netcoreapp3.1/yourlibrary.dll