Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Call ParquetFileFormat.ensureParquetLogRedirection when deserializing
ParquetFileFormat
  • Loading branch information
Michael Allman committed Nov 9, 2016
commit 696ebc0eb2f763c9245dc98903a62158d1b4d9d8
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.sql.execution.datasources.parquet

import java.io.ObjectInputStream
import java.net.URI
import java.util.logging.{Logger => JLogger}

Expand Down Expand Up @@ -64,6 +65,14 @@ class ParquetFileFormat
// call.
ParquetFileFormat.ensureParquetLogRedirection

// Java serialization will not call the default constructor. Make sure we call
// ParquetFileFormat.ensureParquetLogRedirection in deserialization by implementing this hook
// method.
private def readObject(in: ObjectInputStream): Unit = {
in.defaultReadObject
ParquetFileFormat.ensureParquetLogRedirection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also call ensureParquetLogRedirection from some main class right? e.g. class Executor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried to keep this code isolated to the parquet implementation.

}

override def shortName(): String = "parquet"

override def toString: String = "ParquetFormat"
Expand Down