Updating a dataframe column in spark

前端 未结 5 1614
庸人自扰
庸人自扰 2020-11-28 02:55

Looking at the new spark dataframe api, it is unclear whether it is possible to modify dataframe columns.

How would I go about changing a value in row x

5条回答
  •  孤独总比滥情好
    2020-11-28 03:28

    DataFrames are based on RDDs. RDDs are immutable structures and do not allow updating elements on-site. To change values, you will need to create a new DataFrame by transforming the original one either using the SQL-like DSL or RDD operations like map.

    A highly recommended slide deck: Introducing DataFrames in Spark for Large Scale Data Science.

提交回复
热议问题