我需要从pipelinedRDD中提取一些数据,但在将其转换为Dataframe时,会出现以下错误:
Traceback (most recent call last):
File "/home/karan/Desktop/meds.py", line 42, in <module>
relevantToSymEntered(newrdd)
File "/home/karan/Desktop/meds.py", line 26, in relevantToSymEntered
mat = spark.createDataFrame(self,StructType([StructField("Prescribed
medicine",StringType), StructField(["Disease","ID","Symptoms
Recorded","Severeness"],ArrayType)]))
File "/home/karan/Downloads/spark-2.4.2-bin-
hadoop2.7/python/pyspark/sql/types.py", line 409, in __init__
"dataType %s should be an instance of %s" % (dataType, DataType)
AssertionError: dataType <class 'pyspark.sql.types.StringType'> should be an
instance of <class 'pyspark.sql.types.DataType'>
1。我的错误是不同类型的,它是TypeError,而我遇到了AssertionError的问题。在
我已经尝试过使用toDF(),但是它改变了列名,这是不可取的。在
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐