After I failed with my attemt to established a JDBC Connection to DateHub I try to use the datehub Microservice instead.
I try to use the datahub microservice to query the data.I use the “High-performance API” which have the format-option (as the doc say Cumulocity IoT DataHub - OpenAPI Specification). In reality the parameter do nothing. I send as format: "PANDAS"
but the result I get back look like the default forma, what is awkward to parse.
My Query:
{"sql":"SELECT * FROM txxxxxxxxDataLake.\"pw-hmi\".txxxxxxxx.\"measurements_State_Offline\" WHERE source=241481197242","limit":1,"format":"PANDAS"}
The result have this format:
{
"columns":[
"dir0",
"dir1",
"dir2",
"dir3",
"id",
"creationTime",
"creationTimeOffset",
"creationTimeWithOffset",
"YEAR",
"MONTH",
"DAY",
"time",
"timeOffset",
"timeWithOffset",
"source",
"type",
"Activity_Idle.series_times.unit",
"Activity_Idle.series_times.value"
],
"data":[
[
"chunk_P1_598_618_1701302400000_1701561600000_46597706",
"0_2023",
"0_11",
"0_30",
"1343464808",
"2023-11-30T05:53:44.532",
0,
"2023-11-30T05:53:44.532",
"2023",
"11",
"30",
"2023-11-30T05:53:13.966",
0,
"2023-11-30T05:53:13.966",
"881342014107",
"Activity_Idle",
"sec",
147915.0
]
]
}
The PANDAS-Format from the documentation looks much cleaner and better to parse with normal object mapper.