Why does my dataset have empty rows in the result preview? Problem with dataset in IoT Analytics.

0

I'm editing my JSON report through the IoT Analytics pipeline by adding attributes but when I look at the dataset and look at the content it shows the values I expect except for some blank lines and that's the thing I don't understand. Why am I getting blank lines with no values? *

Here is the incoming message to the pipeline

{
  "mType": "iqrfSensor_ReadSensorsWithTypes",
  "data": {
    "msgId": "testEmbedSensor",
    "rsp": {
      "nAdr": 1,
      "hwpId": 2,
      "rCode": 0,
      "dpaVal": 85,
      "result": {
        "sensors": [
          {
            "id": "TEMPERATURE",
            "type": 1,
            "name": "Temperature",
            "shortName": "t",
            "value": 27.5,
            "unit": "°C",
            "decimalPlaces": 4
          },
          {
            "id": "TEMPERATURE",
            "type": 1,
            "name": "Temperature",
            "shortName": "t",
            "value": 27,
            "unit": "°C",
            "decimalPlaces": 4
          },
          {
            "id": "BINARYDATA7",
            "type": 129,
            "name": "Binary data7",
            "shortName": "bin7",
            "value": 55,
            "unit": "?",
            "decimalPlaces": 0,
            "breakdown": [
              {
                "id": "BINARYDATA7",
                "type": 129,
                "name": "Light indicator",
                "shortName": "light",
                "unit": "%",
                "decimalPlaces": 1,
                "value": 56.7
              }
            ]
          },
          {
            "id": "BINARYDATA7",
            "type": 129,
            "name": "Binary data7",
            "shortName": "bin7",
            "value": 46,
            "unit": "?",
            "decimalPlaces": 0,
            "breakdown": [
              {
                "id": "BINARYDATA7",
                "type": 129,
                "name": "Potentiometer",
                "shortName": "pot",
                "unit": "%",
                "decimalPlaces": 1,
                "value": 63.8
              }
            ]
          }
        ],
        "sensorIndexes": [
          0,
          1,
          2,
          3
        ]
      }
    },
    "raw": [
      {
        "request": "01.00.5e.01.ff.ff.0f.00.00.00",
        "requestTs": "2023-06-07T14:59:18.076+02:00",
        "confirmation": "01.00.5e.01.ff.ff.ff.58.01.08.01",
        "confirmationTs": "2023-06-07T14:59:18.102+02:00",
        "response": "01.00.5e.81.02.00.00.55.01.b8.01.01.b0.01.81.37.81.2e",
        "responseTs": "2023-06-07T14:59:18.353+02:00"
      }
    ],
    "insId": "iqrfgd2-default",
    "statusStr": "ok",
    "status": 0
  }
}

And here is outcoing message from pipeline activities

{
  "mType": "iqrfSensor_ReadSensorsWithTypes",
  "data": {
    "msgId": "testEmbedSensor",
    "rsp": {
      "nAdr": 1,
      "hwpId": 2,
      "rCode": 0,
      "dpaVal": 85,
      "result": {
        "sensors": [
          {
            "id": "TEMPERATURE",
            "type": 1,
            "name": "Temperature",
            "shortName": "t",
            "value": 27.5,
            "unit": "°C",
            "decimalPlaces": 4
          },
          {
            "id": "TEMPERATURE",
            "type": 1,
            "name": "Temperature",
            "shortName": "t",
            "value": 27,
            "unit": "°C",
            "decimalPlaces": 4
          },
          {
            "id": "BINARYDATA7",
            "type": 129,
            "name": "Binary data7",
            "shortName": "bin7",
            "value": 55,
            "unit": "?",
            "decimalPlaces": 0,
            "breakdown": [
              {
                "id": "BINARYDATA7",
                "type": 129,
                "name": "Light indicator",
                "shortName": "light",
                "unit": "%",
                "decimalPlaces": 1,
                "value": 56.7
              }
            ]
          },
          {
            "id": "BINARYDATA7",
            "type": 129,
            "name": "Binary data7",
            "shortName": "bin7",
            "value": 46,
            "unit": "?",
            "decimalPlaces": 0,
            "breakdown": [
              {
                "id": "BINARYDATA7",
                "type": 129,
                "name": "Potentiometer",
                "shortName": "pot",
                "unit": "%",
                "decimalPlaces": 1,
                "value": 63.8
              }
            ]
          }
        ],
        "sensorIndexes": [
          0,
          1,
          2,
          3
        ]
      }
    },
    "raw": [
      {
        "request": "01.00.5e.01.ff.ff.0f.00.00.00",
        "requestTs": "2023-06-07T14:59:18.076+02:00",
        "confirmation": "01.00.5e.01.ff.ff.ff.58.01.08.01",
        "confirmationTs": "2023-06-07T14:59:18.102+02:00",
        "response": "01.00.5e.81.02.00.00.55.01.b8.01.01.b0.01.81.37.81.2e",
        "responseTs": "2023-06-07T14:59:18.353+02:00"
      }
    ],
    "insId": "iqrfgd2-default",
    "statusStr": "ok",
    "status": 0
  },
  "name1": "Temperature",
  "unit4": "%",
  "name2": "Temperature",
  "unit3": "%",
  "name4": "Potentiometer",
  "unit2": "°C",
  "name3": "Light indicator",
  "value1": 27.5,
  "time": "2023-06-07T14:59:18.353+02:00",
  "value3": 56.7,
  "unit1": "°C",
  "value2": 27,
  "value4": 63.8
}

I use new SQL statement in my dataset then before * old statement: SELECT * FROM 'my/topic' * new statement: SELECT name1,unit1,value1,name2,unit2,value2,name3,unit3,value3,name4,unit4,value4,time,__dt FROM 'my/topic' * Here is Result preview in dataset Enter image description here

MikMar
feita há um ano73 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas