更新字段中的流分析问题
Stream Analytics problem in update fields
我在更新流分析查询中的字段时遇到问题。
查询如下:
SELECT * INTO CosmosDBTelemetry FROM IOTHub WHERE type like 't%' or type is null
SELECT * INTO CosmosDBEvents FROM IOTHub WHERE type = 'event'
在 CosmosDBTelemetry 中,我必须用另一个字段的值更改 deviceId 值。
换句话说,我想创建一个新项目,其中包含我输入的几个字段。
谁能帮帮我?
提前致谢。
西蒙
首先,正如@silent 在评论中提到的,流分析与 Azure Cosmos DB 的集成允许您根据给定的文档 ID 列在容器中插入或更新记录。这也称为更新插入。更多详情,请参考此link.
其次,恐怕用ASA来实现你的需求是不合适的。 ASA 更倾向于从源收集数据,而不是清理或修改目标中的数据。您可以了解 Azure Function Cosmos DB Trigger。它可以监控 cosmos db 并在任何数据流入数据库时根据其他值修改列。
如果您的新列是静态的,您可以在 ASA.Please 中使用 Reference Data Input 参见以下场景:
If your reference data is not expected to change, then support for
static reference data is enabled by specifying a static path in the
input configuration. Azure Stream Analytics picks up the blob from the
specified path. {date} and {time} substitution tokens aren't required.
Because reference data is immutable in Stream Analytics, overwriting a
static reference data blob is not recommended.
我在更新流分析查询中的字段时遇到问题。 查询如下:
SELECT * INTO CosmosDBTelemetry FROM IOTHub WHERE type like 't%' or type is null
SELECT * INTO CosmosDBEvents FROM IOTHub WHERE type = 'event'
在 CosmosDBTelemetry 中,我必须用另一个字段的值更改 deviceId 值。
换句话说,我想创建一个新项目,其中包含我输入的几个字段。
谁能帮帮我?
提前致谢。
西蒙
首先,正如@silent 在评论中提到的,流分析与 Azure Cosmos DB 的集成允许您根据给定的文档 ID 列在容器中插入或更新记录。这也称为更新插入。更多详情,请参考此link.
其次,恐怕用ASA来实现你的需求是不合适的。 ASA 更倾向于从源收集数据,而不是清理或修改目标中的数据。您可以了解 Azure Function Cosmos DB Trigger。它可以监控 cosmos db 并在任何数据流入数据库时根据其他值修改列。
如果您的新列是静态的,您可以在 ASA.Please 中使用 Reference Data Input 参见以下场景:
If your reference data is not expected to change, then support for static reference data is enabled by specifying a static path in the input configuration. Azure Stream Analytics picks up the blob from the specified path. {date} and {time} substitution tokens aren't required. Because reference data is immutable in Stream Analytics, overwriting a static reference data blob is not recommended.