Details
-
Type:
Monitor
-
Status: Closed
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: FIWARE-TECH-HELP
-
Labels:
Description
Created question in FIWARE Q/A platform on 01-12-2021 at 17:12
Please, ANSWER this question AT https://stackoverflow.com/questions/70188885/quantumleap-truncating-float-data-from-orion-context-broker
Question:
QuantumLeap truncating float data from Orion Context Broker
Description:
We are using the Orion Context broker and now in combination with QuantumLeap and CrateDB. we are not so familiar QuantumLeap and need help with something that we find to be strange.
In the Context Broker we have entity with data:
{
"id": "SC-5C0272FFFE8C206C",
"type": "StreetlightControlCabinet",
"activePowerR": {
"type": "Number",
"value": 0.7456,
"metadata": {
"timestamp":
}
},
"activePowerS": {
"type": "Number",
"value": 0.5747,
"metadata": {
"timestamp":
}
},
"activePowerT": {
"type": "Number",
"value": 0.4297,
"metadata": {
"timestamp":
}
},
.......
}
All three attributes has Number values and comes from "IoT agent MQTT/JSON".
Quantum Leap has subscription to Context Broker:
{
"description": "QL - StreetlightControlCabinet",
"subject": {
"entities": [
],
"condition":
},
"notification": {
"http":
,
"metadata": ["dateCreated", "dateModified", "timestamp"],
"attrs": [
"activePowerR",
"activePowerS",
"activePowerT",
.....
]
}
}
The QuantumLeap (V0.5) creates CrateDB data series with floating point value type only if first value in the serie is fractional (like 0.7456).
If first value in serie can be converted to integer without loosing of precision (like 0, 1.0, 2.0, etc), the QuantumLeap will create the data series with integer base type in CrateDB.
As result, all following incoming data will truncated to integers in the database.
So this is strange since in the QuantumLeap sources we found that a "Number" attribute type should always be mapped to "float" datatype in CrateDB.
Anyone that may have an explanantion what the issue can be?
Activity
- All
- Comments
- History
- Activity
- Transitions
2021-12-08 05:31|CREATED monitor | # answers= 0, accepted answer= False