Forum Discussion

dinkar's avatar
dinkar
New Contributor
2 years ago

How to know the all column names(input columns) using expression in mapper

I want to know list of all input columns in the pipeline using expression in mapper. Please help

5 Replies

  • dinkar's avatar
    dinkar
    New Contributor

    When I write $.keys() its showing all columns for all the rows..its leads to performance issue. need only first row with only column names.

  • Can you talk more broadly about the problem you're trying to solve? If you went with this approach, then you could avoid doing for each row by routing a single document into the Mapper that finds the documents properties/column names.

    • dinkar's avatar
      dinkar
      New Contributor

      I want to know list of columns using expression in mapper snap.
      - When I write $.keys() expression its fetching all the columns for all the rows which to performance issue. I need only first document or first row.

      • tlikarish's avatar
        tlikarish
        Employee

        How are you using those columns downstream from the mapper? One performance improvement would be to only do the call to $.keys() once and use that information. However if you need to join it with each document, then I'm not sure that would improve anything. If you only use it in some kind of load/write operation, then maybe that would be an improvement for you.

  • dinkar's avatar
    dinkar
    New Contributor

    when we use $.keys()  above 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.