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

Add new method getOriginalMap in CaseInsensitiveStringMap

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      Currently, DataFrameReader/DataFrameReader supports setting Hadoop configurations via method `.option()`.
      E.g.
      ```
      class TestFileFilter extends PathFilter

      { override def accept(path: Path): Boolean = path.getParent.getName != "p=2" }

      withTempPath

      { dir => val path = dir.getCanonicalPath val df = spark.range(2) df.write.orc(path + "/p=1") df.write.orc(path + "/p=2") assert(spark.read.orc(path).count() === 4) val extraOptions = Map( "mapred.input.pathFilter.class" -> classOf[TestFileFilter].getName, "mapreduce.input.pathFilter.class" -> classOf[TestFileFilter].getName ) assert(spark.read.options(extraOptions).orc(path).count() === 2) }

      ```
      While Hadoop Configurations are case sensitive, the current data source V2 APIs are using `CaseInsensitiveStringMap` in TableProvider.
      To create Hadoop configurations correctly, I suggest adding a method `getOriginalMap` in `CaseInsensitiveStringMap`.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: