How to force DataFrame evaluation in Spark

后端 未结 4 862
感情败类
感情败类 2020-11-28 15:27

Sometimes (e.g. for testing and bechmarking) I want force the execution of the transformations defined on a DataFrame. AFAIK calling an action like count does n

4条回答
  •  独厮守ぢ
    2020-11-28 15:31

    I prefer to use df.save.parquet(). This does add disc I/o time that you can estimate and subtract out later, but you are positive that spark performed each step you expected and did not trick you with lazy evaluation.

提交回复
热议问题