gather
Converts several columns into two columns key and value. key column will contain names of original columns, value column will contain values from original columns.
This operation is reverse to pivot
See column selectors for how to select the columns for this operation.
Configuration options:
explodeLists— gathered values of typeListwill be exploded into their elements, sowhere,cast,notNullandmapValueswill be applied to list elements instead of lists themselvescast— inform compiler about the expected type of gathered elements. This type will be passed towhereandmapKeyslambdasnotNull— skip gatherednullvalueswhere— filter gathered valuesmapKeys— transform gathered column names (keys)mapValues— transform gathered column values
Storage options:
into(keyColumn, valueColumn)— store gathered key-value pairs in two new columns with nameskeyColumnandvalueColumnkeysInto(keyColumn)— store only gathered keys (column names) in a new columnkeyColumnvaluesInto(valueColumn)— store only gathered values in a new columnvalueColumn