Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-47240 SPIP: Structured Logging Framework for Apache Spark
  3. SPARK-50036

Include SPARK_LOG_SCHEMA in the context of repl shell

    XMLWordPrintableJSON

Details

    Description

      Before the Change:

      Users needed to import LOG_SCHEMA to read structured logs as a JSON data source:
      import org.apache.spark.util.LogUtils.LOG_SCHEMA

      val logDf = spark.read.schema(LOG_SCHEMA).json("path/to/logs")
       
      After the Change:

      • No Import Needed in REPL Shells: You can now use SPARK_LOG_SCHEMA directly in REPL environments like spark-shell and pyspark without importing it.
      • Renamed for Clarity: LOG_SCHEMA has been renamed to SPARK_LOG_SCHEMA to make its purpose more clear.

      Now, you can read structured logs without the import:
      val logDf = spark.read.schema(SPARK_LOG_SCHEMA).json("path/to/logs")
       

      Attachments

        Issue Links

          Activity

            People

              Gengliang.Wang Gengliang Wang
              Gengliang.Wang Gengliang Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: