Skip to content

Commit ce2c086

Browse files
committed
Using java.io.Writer
1 parent ed57c8e commit ce2c086

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,12 @@ class QueryExecution(val sparkSession: SparkSession, val logical: LogicalPlan) {
259259
* Dumps debug information about query execution into the specified file.
260260
*/
261261
def toFile(path: String): Unit = {
262+
val maxFields = SparkEnv.get.conf.getInt(Utils.MAX_TO_STRING_FIELDS,
263+
Utils.DEFAULT_MAX_TO_STRING_FIELDS)
262264
val filePath = new Path(path)
263265
val fs = FileSystem.get(filePath.toUri, sparkSession.sessionState.newHadoopConf())
264266
val writer = new BufferedWriter(new OutputStreamWriter(fs.create(filePath)))
265-
val maxFields = SparkEnv.get.conf.getInt(Utils.MAX_TO_STRING_FIELDS,
266-
Utils.DEFAULT_MAX_TO_STRING_FIELDS)
267+
267268
try {
268269
SparkEnv.get.conf.set(Utils.MAX_TO_STRING_FIELDS, Int.MaxValue.toString)
269270
writer.write("== Parsed Logical Plan ==\n")

0 commit comments

Comments
 (0)