Member since
12-27-2023
3
Posts
0
Kudos Received
0
Solutions
01-01-2024
09:29 PM
Your input means a lot, and I appreciate your assistance @DianaTorres, @SAMSAL and @joseomjr. Thank you all for sharing your knowledge and insights!
... View more
12-27-2023
10:13 PM
Hey there, I'm trying to create a nested JSON using SQL in NiFi, but the output I'm getting has the nested part as a string. Here's the query I'm using: SELECT
order_id,
JSON_ARRAYAGG(
JSON_OBJECT(
'order_Item_Seq_Id', order_Item_Seq_Id,
'product_Id', product_Id
)
) as order_item
FROM order_item
GROUP BY order_id; The output looks like this: [{
"order_id": "10000",
"order_item": "[{\"product_Id\": \"10007\", \"order_Item_Seq_Id\": \"00101\"}]"
}] But I want it to be a valid nested JSON like this: [
{
"order_id": "10000",
"order_item": [
{
"product_Id": "10007",
"order_Item_Seq_Id": "00101"
}
]
}
] I'm hoping for a solution using Apache NiFi or Jolt. Any help would be appreciated. Thank you!
... View more
Labels:
- Labels:
-
Apache NiFi