Is there better way to display entire Spark SQL DataFrame?

后端 未结 7 854
轻奢々
轻奢々 2021-01-30 20:53

I would like to display the entire Apache Spark SQL DataFrame with the Scala API. I can use the show() method:

myDataFrame.show(Int.MaxValue)
         


        
7条回答
  •  别跟我提以往
    2021-01-30 21:41

    In java I have tried it with two ways. This is working perfectly for me:

    1.

    data.show(SomeNo);
    

    2.

    data.foreach(new ForeachFunction() {
                    public void call(Row arg0) throws Exception {
                        System.out.println(arg0);
                    }
                });
    

提交回复
热议问题