Skip to content

Commit

Permalink
[SC-86844] Refactor alterDeltaTableCommands
Browse files Browse the repository at this point in the history
Refactor schemaEqual method in alterDeltaTableCommands.

GitOrigin-RevId: de64cae3c1a032c54bf2624e7aaf1897bdb12d09
  • Loading branch information
jackierwzhang authored and Yaohua628 committed Oct 28, 2021
1 parent 1732170 commit c1fce21
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,11 @@ case class AlterTableSetLocationDeltaCommand(

private def schemasEqual(
oldMetadata: actions.Metadata, newMetadata: actions.Metadata): Boolean = {
oldMetadata.schema == newMetadata.schema &&
oldMetadata.partitionSchema == newMetadata.partitionSchema
import DeltaColumnMapping._
dropColumnMappingMetadata(oldMetadata.schema) ==
dropColumnMappingMetadata(newMetadata.schema) &&
dropColumnMappingMetadata(oldMetadata.partitionSchema) ==
dropColumnMappingMetadata(newMetadata.partitionSchema)
}

// TODO: remove when the new Spark version is releases that has the withNewChildInternal method
Expand Down

0 comments on commit c1fce21

Please sign in to comment.