Skip to content

Parsing Column With JSON Format Into Multiple Columns

In Treasure Console, trying to import data from external sources using our connectors will not parse columns with JSON format. For example, the items column in the following is JSON formatted. Preview data from Treasure Console does not parse JSON columns into multiple columns.

To parse into multiple columns

  1. In Treasure CLI, use the expand_json filter function, see Expanding JSON filter for more information. Add the filter section with type expand_json to your load.yml. For example:
in:
...
filters:
  - type: expand_json
    json_column_name: item
    root: "$."
    expanded_columns:
      - {name: "total_count", type: double}
      - {name: "object", type: string}
      - {name: "data", type: double}
      - {name: "created_at", type: timestamp, format: "%Y-%m-%d", timezone: "UTC"}
 out:
 ...  
  1. Install the TD Toolbelt (CLI).

  2. Based on the import connectors you use, refer to their corresponding configurations. Review Integrations by Technology Vertical.