AWS IoT SQL: What happens if I SELECT a JSON payload key that doesn't exist?

0

Hi,

Let's assume I have the following AWS IoT SQL statement:

SELECT device, room, value FROM 'topic/subtopic'

and this runs over the following incoming payload:

{
"device": "sensor1",
"value": 34
}

Will the resulting output from this SQL statement be:

{
"device": "sensor1",
"room": "",
"value": 34
}

or

{
"device": "sensor1",
"room": "null",
"value": 34
}

or:

{
"device": "sensor1",
"value": 34
}

or something else entirely? Or would the rule raise a parsing error or the like?

cgddrd
質問済み 10ヶ月前266ビュー
1回答
1
承認された回答

Hi. It will be:

{
  "device": "sensor1",
  "value": 34
}

BTW, it's is quite easy to test things like this by creating a rule with a republish action, and then trying it out with the test client in the console.

profile pictureAWS
エキスパート
Greg_B
回答済み 10ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ