Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15863#discussion_r87700361
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
 ---
    @@ -314,8 +311,7 @@ case class DataSource(
                 catalogTable.get,
                 catalogTable.get.stats.map(_.sizeInBytes.toLong).getOrElse(0L))
             } else {
    -          new InMemoryFileIndex(
    -            sparkSession, globbedPaths, options, partitionSchema)
    +          new InMemoryFileIndex(sparkSession, globbedPaths, options, 
partitionSchema)
    --- End diff --
    
    `InMemoryFileIndex` should use the original one because it extends 
`PartitioningAwareFileIndex` which uses the following line.
    ```scala
    protected val hadoopConf = 
sparkSession.sessionState.newHadoopConfWithOptions(parameters)
    ```
    
    Eventually, it created another **case-sensitive** Map from the 
`CaseInsensitiveMap`. In that case, it will fail to retrieve data from that map 
because the key value is changed as lowercases already in `CaseInsensitiveMap`.
    ```scala
    def newHadoopConfWithOptions(options: Map[String, String]): Configuration = 
{
        val hadoopConf = newHadoopConf()
        options.foreach { case (k, v) =>
          if ((v ne null) && k != "path" && k != "paths") {
            hadoopConf.set(k, v)
          }
        }
        hadoopConf
      }
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to