Github user ueshin commented on a diff in the pull request: https://github.com/apache/spark/pull/20214#discussion_r161123911 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala --- @@ -237,13 +237,19 @@ class Dataset[T] private[sql]( private[sql] def showString( _numRows: Int, truncate: Int = 20, vertical: Boolean = false): String = { val numRows = _numRows.max(0).min(Int.MaxValue - 1) - val takeResult = toDF().take(numRows + 1) + val newDf = toDF() + val castExprs = newDf.schema.map { f => f.dataType match { + // Since binary types in top-level schema fields have a specific format to print, + // so we do not cast them to strings here. + case BinaryType => s"${f.name}" + case udt: UserDefinedType[_] => s"${f.name}" + case _ => s"CAST(`${f.name}` AS STRING)" + --- End diff -- nit: remove an extra line.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org