Github user tdas commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15951#discussion_r89010923
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala
 ---
    @@ -291,22 +360,24 @@ case class DataSource(
                 throw new AnalysisException(s"Path does not exist: $qualified")
               }
               // Sufficient to check head of the globPath seq for non-glob 
scenario
    -          if (checkFilesExist && !fs.exists(globPath.head)) {
    +          // Don't need to check once again if files exist in streaming 
mode
    +          if (!isStreaming && !fs.exists(globPath.head)) {
                 throw new AnalysisException(s"Path does not exist: 
${globPath.head}")
               }
               globPath
             }.toArray
     
    -        // If they gave a schema, then we try and figure out the types of 
the partition columns
    -        // from that schema.
    -        val partitionSchema = userSpecifiedSchema.map { schema =>
    -          StructType(
    -            partitionColumns.map { c =>
    -              // TODO: Case sensitivity.
    -              schema
    -                  .find(_.name.toLowerCase() == c.toLowerCase())
    -                  .getOrElse(throw new AnalysisException(s"Invalid 
partition column '$c'"))
    -            })
    +        val (schema, inferredPartitionColumns) = 
getOrInferFileFormatSchema(format)
    +        val dataSchema = if (isStreaming) {
    +          schema
    +        } else {
    +          StructType(schema.dropRight(inferredPartitionColumns.length))
    --- End diff --
    
    nvm. with justPartitioning param, its more confusing as it is right now. so 
I like this suggestion


---
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