display函数不在pySpark中用jupyter noteb显示输出

2024-09-26 18:16:26 发布

您现在位置:Python中文网/ 问答频道 /正文

请告诉我为什么我的代码没有错误,但是结果没有用display()函数生成流式查询?在

我是这样读取数据的:

streamingInputDF = (`spark.readStream.schema(Schema1).csv("C:/Users/X550/Desktop/sadegh2")

应用模型预创建:

^{pr2}$

问题是:

streamPredictions = (stream.groupBy("Survived", "prediction").count().sort("Survived", "prediction")) 

结果如下:

streamPredictions.isStreaming------->output is True
display(streamPredictions)---------->only show col name without value

Tags: csv函数代码schema错误display流式读取数据

热门问题