diff options
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala b/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala index 82130b5459..b237a07c72 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala @@ -84,6 +84,21 @@ private[sql] case class ParquetRelation( private[sql] object ParquetRelation { def enableLogForwarding() { + // Note: the parquet.Log class has a static initializer that + // sets the java.util.logging Logger for "parquet". This + // checks first to see if there's any handlers already set + // and if not it creates them. If this method executes prior + // to that class being loaded then: + // 1) there's no handlers installed so there's none to + // remove. But when it IS finally loaded the desired affect + // of removing them is circumvented. + // 2) The parquet.Log static initializer calls setUseParentHanders(false) + // undoing the attempt to override the logging here. + // + // Therefore we need to force the class to be loaded. + // This should really be resolved by Parquet. + Class.forName(classOf[parquet.Log].getName()) + // Note: Logger.getLogger("parquet") has a default logger // that appends to Console which needs to be cleared. val parquetLogger = java.util.logging.Logger.getLogger("parquet") |