Skip to content
This repository has been archived by the owner on Feb 21, 2025. It is now read-only.

flattenjson

Rohit K. Chatterjee edited this page Nov 15, 2023 · 1 revision

The flattenjson operation extracts values for specified keys in a JSON column. The JSON column must contain a dictionary i.e. not a list or a scalar value.

Parameter Description
input_name The input model
output_name The output model
dest_schema The destination schema
columns_to_copy The source columns to be included in the output model
json_column The name of the JSON column in the input model
json_columns_to_copy The keys in the JSON column which are extracted into columns in the output model

Example

The input model

Column_1 Column_2 JSON_Column
Photo Robot { "color": "black", "weight": 200 }
Video Robot { "color": "white", "weight": 150 }

with the configuration

...
columns_to_copy:
  - Column_1
json_column: JSON_Column
json_columns_to_copy:
  - color
  - weight

would produce

Column_1 color weight
Photo black 200
Video white 150
Clone this wiki locally