Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-19013

FIWARE.Question.Tech.QuantumLeap truncating float data from Orion Context Broker.

    Details

      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":

      { "type": "DateTime", "value": "2021-12-01T16:33:13.00Z" }

      }
      },
      "activePowerS": {
      "type": "Number",
      "value": 0.5747,
      "metadata": {
      "timestamp":

      { "type": "DateTime", "value": "2021-12-01T16:33:13.00Z" }

      }
      },
      "activePowerT": {
      "type": "Number",
      "value": 0.4297,
      "metadata": {
      "timestamp":

      { "type": "DateTime", "value": "2021-12-01T16:33:13.00Z" }

      }
      },

      .......

      }

      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": [

      { "idPattern": ".*", "type": "StreetlightControlCabinet" }

      ],
      "condition":

      { "attrs": [ "activePowerR", "activePowerS", "activePowerT", ... ] }

      },
      "notification": {
      "http":

      { "url": "http://quantumleap:8668/v2/notify" }

      ,
      "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

          People

          • Assignee:
            smartsdk_martel MARTEL
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: