Forum Discussion

dinkar's avatar
dinkar
New Contributor
2 years ago

Need all the columns pipeline using expression in mapper snap.

when we use $.keys() below image which is showing list of columns for all the records which leads to performance issue (for example we have 1 lakh records, it will check for all 1 lakh records) ... Need only first row columns... Please help with expression which gives all columns for only 1 record.

 

3 Replies

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    The pipeline below contains a script to flatten the data completely by iterating through every level of the JSON structure. You’ll probably need to include a counter to stop (or start) at certain point to adapt the solution according to your issue.

    Python flatten data_2022_06_06 (1).slp (7.1 KB)

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    This is some kind of partial flattening of the data, which can be achieved with a Script. If this is the only part that needs to be modified, than it can also be transformed with an expression, but if the data contains more objects that are needed to be flattened out, than I suggest you to use Script.