2
,我有以下格式的名稱tuppleSlides一個二維表:保存2D名單成數據幀階火花
List(List(10,4,2,4,5,2,6,2,5,7), List(10,4,2,4,5,2,6,2,5,7), List(10,4,2,4,5,2,6,2,5,7), List(10,4,2,4,5,2,6,2,5,7))
我已經創建了下面的模式:
val schema = StructType(
Array(
StructField("1", IntegerType, true),
StructField("2", IntegerType, true),
StructField("3", IntegerType, true),
StructField("4", IntegerType, true),
StructField("5", IntegerType, true),
StructField("6", IntegerType, true),
StructField("7", IntegerType, true),
StructField("8", IntegerType, true),
StructField("9", IntegerType, true),
StructField("10", IntegerType, true))
)
和我創建一個這樣的數據幀:
val tuppleSlidesDF = sparkSession.createDataFrame(tuppleSlides, schema)
但它甚至不會編譯。我想如何正確地做到這一點?
謝謝。
哈,這裏我寫'toTuple10','fromSeq'是要走的路 –