Invalid JSON output

Hi ! I am seeing some invalid JSON output from simple JSON schemas : Schema :
{
"fields": [
{
"name": "event",
"type": "json",
"required": true
}
]
}
{
"fields": [
{
"name": "event",
"type": "json",
"required": true
}
]
}
Query : INSERT INTO test_v6_sink SELECT * FROM test_v6_stream; Events:
{
"event": {
"test": "THIS IS A NEW TEST"
}
},
{
"event": "{\"test\":1}"
},
{
"invalid": {}
}
]
{
"event": {
"test": "THIS IS A NEW TEST"
}
},
{
"event": "{\"test\":1}"
},
{
"invalid": {}
}
]
Output JSON file:
{"event":{"test":"THIS IS A NEW TEST"}}
{"event":}
{"event":{"test":"THIS IS A NEW TEST"}}
{"event":}
Pipeline ID: 3c644d03d8de4cbb90beb201781f5bad
2 Replies
Micah Wylde
Micah Wylde2mo ago
Thanks for reporting, we're investigating Hi @stard91 — tahnks again for the report. This issue turned out to be a failure to preserve escapes in strings when parsed as JSON. It's now fixed. Note however that JSON schema fields are meant to be used against actual JSON, not quoted JSON strings — in your example, "{"test":1}" will end up as a JSON string rather than as JSON.
stard91
stard91OP2mo ago
Hi @Micah | Data Platform , thanks! Yes this was just to test the output, I would not expect it to parse stringified JSON

Did you find this page helpful?