https://delta.io logo
l

Lucas Zago

02/22/2023, 8:24 PM
Guys, when I want union two dfs, and sometimes their schema get changed what is the best practice to do it ?
l

Lennart Skogmo

02/22/2023, 8:37 PM
Curious about this one myself. When strictly dealing with dataframes I guess the answer would be to use the most effective method to compare the dataframe schemas and add the missing columns as null values before the union.
c

Christopher Grant

02/22/2023, 9:06 PM
spark (non-delta) questions belong in #random unionByName with allowMissingColumns should work!
l

Lucas Zago

02/22/2023, 10:11 PM
@Christopher Grant sorry, by that Thanks for sharing the solution
c

Christopher Grant

02/22/2023, 10:12 PM
all good
3 Views