How to show full column content in a Spark Dataframe?

前端 未结 14 2158
萌比男神i
萌比男神i 2020-12-07 07:46

I am using spark-csv to load data into a DataFrame. I want to do a simple query and display the content:

val df = sqlContext.read.format(\"com.databricks.spa         


        
14条回答
  •  感情败类
    2020-12-07 08:23

    The following answer applies to a Spark Streaming application.

    By setting the "truncate" option to false, you can tell the output sink to display the full column.

    val query = out.writeStream
              .outputMode(OutputMode.Update())
              .format("console")
              .option("truncate", false)
              .trigger(Trigger.ProcessingTime("5 seconds"))
              .start()
    

提交回复
热议问题