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

    https://github.com/apache/spark/pull/15566#discussion_r84816321
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -351,8 +351,13 @@ case class AlterTableAddPartitionCommand(
             "ALTER TABLE ADD PARTITION is not allowed for tables defined using 
the datasource API")
         }
         val parts = partitionSpecsAndLocs.map { case (spec, location) =>
    +      val normalizedSpec = PartitioningUtils.normalizePartitionSpec(
    +        spec,
    +        table.partitionColumnNames,
    +        table.identifier.quotedString,
    +        sparkSession.sessionState.conf.resolver)
           // inherit table storage format (possibly except for location)
    -      CatalogTablePartition(spec, table.storage.copy(locationUri = 
location))
    +      CatalogTablePartition(normalizedSpec, table.storage.copy(locationUri 
= location))
    --- End diff --
    
    Btw, I noticed a number of missing case conversions when combining this 
with https://github.com/apache/spark/pull/15515/files. They seem to be mostly 
from CatalogTablePartitions listed from the hive metastore.
    
    Since this is hard to test until that is merged, maybe add a TODO in 
`HiveClientImpl:836` to do this normalization for partition specs read from the 
metastore?


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