티스토리 뷰

공부

[Python] Spark rdd foreach print

승가비 2020. 10. 3. 20:03
728x90
for row in df.rdd.collect():
    do_something(row)

driver

executor

 

https://stackoverflow.com/questions/36349281/how-to-loop-through-each-row-of-dataframe-in-pyspark

 

how to loop through each row of dataFrame in pyspark

E.g sqlContext = SQLContext(sc) sample=sqlContext.sql("select Name ,age ,city from user") sample.show() The above statement print entire table on terminal but i want to access each row in that t...

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Spark] to_json (need to spark 2.1)  (0) 2020.10.03
[Java] class field name to JSON  (0) 2020.10.03
[CSS] scrollbar visible  (0) 2020.10.03
[Python] MySQL charset='utf8'  (0) 2020.10.03
[Spring] RestTemplate Timeout 초과  (0) 2020.10.03
댓글