Sponsored

Showing posts with label spark. Show all posts
Showing posts with label spark. Show all posts

Wednesday, March 31, 2021

Reorder Columns in Spark DataFrame with Select() and Scala


Sometimes, when dealing with a Spark data frame it may be necessary to reorder columns in a certain order. For example, to keep data consistent when trying to union two or more data frames with the same schema but different order of columns. Let's explore how that can be done relatively easy using a select() Spark SQL function.