Forum Discussion

big_ozzie's avatar
big_ozzie
Copper Contributor
Jan 16, 2025

How do I unpivot with schema drift enabled?

I have a source without a pre-defined schema. I derive each column name using a column pattern expression:

Data preview shows what I expect (which is a file in a blob container):

I then have a Select step that selects each column and renames 'Marker name' to 'Marker_name22':

Data preview again shows what I expect (same columns with 'Marker name' renamed).

Now in the unpivot step, I would like to ungroup by the 'Marker_name22' column and unpivot all other columns, but the 'Marker_name22' column is not available:

I am unsure how to proceed from here. Thanks in advance for the help.

  • petevern's avatar
    petevern
    Brass Contributor

    What if you try to use a derived column instead of select for the renaming?

    In that case you're not renaming the existing column but create a new column based on the existing using the expression Marker_name22 = byName('Marker name')

    A guess that the select transformation explicitly defines the schema by specifying which columns to include and what their names are so overriding schema drift setting.

Resources