Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-30509

Deprecation log warning is not printed in Avro schema inferring

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      The bug can be reproduced by the test:

        test("log a warning of ignoreExtension deprecation") {
          val logAppender = new LogAppender
          withTempPath { dir =>
            Seq(("a", 1, 2), ("b", 1, 2), ("c", 2, 1), ("d", 2, 1))
              .toDF("value", "p1", "p2")
              .repartition(2)
              .write
              .format("avro")
              .option("header", true)
              .save(dir.getCanonicalPath)
            withLogAppender(logAppender) {
              spark
                .read
                .format("avro")
                .option(AvroOptions.ignoreExtensionKey, false)
                .option("header", true)
                .load(dir.getCanonicalPath)
                .count()
            }
            val deprecatedEvents = logAppender.loggingEvents
              .filter(_.getRenderedMessage.contains(
                s"Option ${AvroOptions.ignoreExtensionKey} is deprecated"))
            assert(deprecatedEvents.size === 1)
          }
        }
      

      Attachments

        Issue Links

          Activity

            People

              maxgekk Max Gekk
              maxgekk Max Gekk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: