1

I want to combine these two JSON into one using matillion ETL for snowflake

JSON statement 1:

[{                                          
    "StepId": 1,
    "ParameterFileGroup": 1,
    "ParameterGroup": 1,
    "Parameter": 4,
    "Filter": "",
    "SortKey": "",
    "Skip": -1,                            
    "ParameterFileGroup": 1,
    "ParameterGroup": 1,

JSON statement 2:

{
        "ConditionId": 4,
        "Threshold": "37",
        "ActionPlan": 3,
        "TriggerAction": 5
}

the result I want:

[{                                          
    "StepId": 1,
    "ParameterFileGroup": 1,
    "ParameterGroup": 1,
    "Parameter": 4,
    "Filter": "",
    "SortKey": "",
    "Skip": -1,                            
    "ParameterFileGroup": 1,
    "ParameterGroup": 1,
{
        "ConditionId": 4,
        "Threshold": "37",
        "ActionPlan": 3,
        "TriggerAction": 5
}}
]
Useme Alehosaini
  • 2,998
  • 6
  • 18
  • 26
Gowtham_7
  • 217
  • 1
  • 8
  • 3
    The result you want is not valid JSON - so are you sure that's what you want to produce? – NickW Dec 24 '20 at 18:22
  • 1
    @NickW yeah it’s not a valid json! But the requirement is that I want to merge two json statements in matillion ETL for snowflake – Gowtham_7 Dec 25 '20 at 14:44
  • So you want to create a column that contains the combined text of these 2 statements, rather than a valid JSON statement? If so, just use standard string manipulation techniques: concatenation, substring, etc. – NickW Dec 26 '20 at 08:56

1 Answers1

1

Assuming these are in 2 columns: JSON1, JSON2. Use the calculator component. add a new calculation called: JSON3. The calculation is: "JSON1" || '\r' || "JSON2" || '\r' || '}]'

enter image description here

peterb
  • 697
  • 3
  • 11