Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18347#discussion_r123322259
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/console.scala 
---
    @@ -60,5 +70,23 @@ class ConsoleSinkProvider extends StreamSinkProvider 
with DataSourceRegister {
         new ConsoleSink(parameters)
       }
     
    +  def createRelation(
    +      sqlContext: SQLContext,
    +      mode: SaveMode,
    +      parameters: Map[String, String],
    +      data: DataFrame): BaseRelation = {
    +    // Number of rows to display, by default 20 rows
    +    val numRowsToShow = 
parameters.get("numRows").map(_.toInt).getOrElse(20)
    +
    +    // Truncate the displayed data if it is too long, by default it is true
    +    val isTruncated = 
parameters.get("truncate").map(_.toBoolean).getOrElse(true)
    +
    +    data.sparkSession.createDataFrame(
    --- End diff --
    
    You can just call `data.showInternal(numRowsToShow, isTruncated)`. This is 
a hack in ConsoleSink to avoid using a wrong planner. That's not a problem in 
the batch DataFrames.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to