0
TypeError: StructType can not accept object 'str' in type <class 'str'>
我不是正確定義的架構:
schema = StructType([StructField('p', StringType(), False),StructField('h', StringType(), False)
,StructField('q', IntegerType(), False),StructField('r', IntegerType(), False)])
rdd = sc.parallelize(['str' , 'str' , 1 , 1])
sqlContext.createDataFrame(rdd, schema).show()
返回錯誤?排序是字符串,字符串,int,int,所以爲什麼不能用rdd = sc.parallelize(['str' , 'str' , 1 , 1])
進行初始化?