Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache spark Spark-写入流不接受架构更改_Apache Spark_Pyspark - Fatal编程技术网

Apache spark Spark-写入流不接受架构更改

Apache spark Spark-写入流不接受架构更改,apache-spark,pyspark,Apache Spark,Pyspark,当我创建自己的DF并尝试在那里工作时,我尝试使用模式更改进行编写,但在这里失败 .. 我错过了什么。此外,我还想更改客户端事件时间的数据类型 from pyspark.sql.functions import col, to_date, struct def writeToBronze(sourceDataframe, bronzePath, streamName): (sourceDataframe #.withColumn(FILL_IN) #.filter(col(FI

当我创建自己的DF并尝试在那里工作时,我尝试使用模式更改进行编写,但在这里失败 .. 我错过了什么。此外,我还想更改客户端事件时间的数据类型

from pyspark.sql.functions import col, to_date, struct
def writeToBronze(sourceDataframe, bronzePath, streamName):
  (sourceDataframe
    #.withColumn(FILL_IN)
    #.filter(col(FILL_IN)
    .withColumn("eventParams", struct(
       col("eventParams.game_keyword"),
       col("eventParams.app_name"),
       col("eventParams.scoreAdjustment"),
       col("eventParams.platform"),
       col("eventParams.app_version"),
       col("eventParams.device_id"),
       col("eventParams.client_event_time").alias("eventDate"),
       col("eventParams.amount")))
    .filter(sourceDataframe.eventParams.client_event_time.isNotNull())
        
#FILL_IN
.writeStream                                                
.format("delta")        
.option("checkpointLocation", bronzePath + "/_checkpoint")
.option('overwriteSchema', 'true')
.queryName(streamName)
.outputMode("append") 
.start(bronzePath)

)

您的问题不清楚。您希望对架构进行哪些更改?涉及哪些数据类型?你遇到过什么错误?