How to suppress parquet log messages in Spark?

后端 未结 6 815
南方客
南方客 2021-01-04 00:40

How to stop such messages from coming on my spark-shell console.

5 May, 2015 5:14:30 PM INFO: parquet.hadoop.InternalParquetRecordReader: at row 0. reading n         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 00:46

    The solution from SPARK-8118 issue comment seem to work:

    You can disable the chatty output by creating a properties file with these contents:

    org.apache.parquet.handlers=java.util.logging.ConsoleHandler
    java.util.logging.ConsoleHandler.level=SEVERE
    

    And then passing the path of the file to Spark when the application is submitted. Assuming the file lives in /tmp/parquet.logging.properties (of course, that needs to be available on all worker nodes):

    spark-submit \
         --conf spark.driver.extraJavaOptions="-Djava.util.logging.config.file=/tmp/parquet.logging.properties" \`
          --conf spark.executor.extraJavaOptions="-Djava.util.logging.config.file=/tmp/parquet.logging.properties" \
          ... 
    

    Credits go to Justin Bailey.

提交回复
热议问题