1 Answer
1
Hello,
My understanding is that you are not able to parsing super type data. Please do correct me if my understanding varies from your query.
I conducted the test in the following format and confirmed that parsing works normally. I have corrected the syntax error in some parentheses in the JSON data form, and inform you that the data was parsed through JSON_PARSE.
I'm forwarding you my test query.
SET enable_case_sensitive_identifier TO true;
drop table testparse;
create table testparse(super_json super);
insert into testparse values(JSON_PARSE('{
"SS": [{
"data": [{
"label": "checksum",
"value": "2553"
},
{
"label": "numSettings",
"value": "10"
}],
"metadata": {
"type": "SS"
}
}],
"SHV": [{
"data": {
"label": "rawPayload",
"value": "544d555f544553545630332c32315f30345f32325f3031"
}
}],
"TT": [{
"data": [{
"label": "trailerId",
"value": "0"
},
{
"label": "highTempThreshold",
"value": "115"
},
{
"label": "highPressureThreshold",
"value": "97"
},
{
"label": "lowPressureThreshold",
"value": "48"
}],
"metadata": {
"type": "TT"
}
}],
"BS1": [{
"data": [{
"label": "frontRight",
"value": "58",
"units": "%",
"type": "Brake Pad Thickness Remaining"
},
{
"label": "rearLeft",
"value": "92",
"units": "%",
"type": "Brake Pad Thickness Remaining"
},
{
"label": "frontLeft",
"value": "15",
"units": "%",
"type": "Brake Pad Thickness Remaining"
},
{
"label": "rearRight",
"value": "100",
"units": "%",
"type": "Brake Pad Thickness Remaining"
}],
"metadata": {
"label": "BS1_0",
"index": "0",
"type": "BMS"
}
}],
"BC1": [{
"data": [{
"label": "parkingBrakeStatus",
"value": "UNLOCK"
},
{
"label": "frontLeftServiceBrakePressure",
"value": "69.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "frontLeftParkingBrakePressure",
"value": "103.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "frontRightServiceBrakePressure",
"value": "345.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "frontRightParkingBrakePressure",
"value": "379.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "rearLeftServiceBrakePressure",
"value": "552.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "rearLeftParkingBrakePressure",
"value": "586.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "rearRightServiceBrakePressure",
"value": "896.00",
"units": "kPa",
"type": "Pressure"
},
{
"label": "rearRightParkingBrakePressure",
"value": "931.00",
"units": "kPa",
"type": "Pressure"
}],
"metadata": {
"label": "BC1_0",
"index": "0",
"type": "BMS"
}
}],
"SHS1": [{
"data": {
"label": "rawPayload",
"value": "0001c607"
}
}],
"SHN": [{
"data": {
"label": "sensorHubS/N",
"value": "6.14336.10496"
},
"metadata": {
"type": "SHN"
}
}]
}'));
select * from testparse;
Result :
select super_json, super_json."BS1" from testparse;
super_json | BS1
{"SS":[{"data":[{"label":"che... | [{"data":...
I trust that the above information will be useful for you. Please feel free to reach out to me if you have any questions or issues regarding this, and I will gladly assist with them as well.
answered 9 days ago
Relevant content
- asked 9 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago