0

我刚刚创建了一个 Azure 流分析作业并配置了输入和输出,这个流分析作业将 Azure IoT 中心作为输入,它从 Azure IoT 开发工具包 MXChip 接收数据。但是我在输入作业拓扑详细信息中遇到错误,如下所示。

[4:10:13 PM] Fields referenced in query not found in input events
Fields Expected: TIME
Fields found: MESSAGEID, HUMIDITY
Missing fields: TIME

在此处输入图像描述

以下是我的查询。

WITH BasicOutput AS 
(
SELECT    
    messageId,
    System.TIMESTAMP AS TIME,
    deviceId,
    temperature,
    humidity,
    pressure,
    pointInfo,
    IoTHub,
    EventEnqueuedUtcTime,
    EventProcessedUtcTime,
    PartitionId,    
    count(*) AS Count
FROM
    Input TIMESTAMP By TIME
    GROUP BY TUMBLINGWINDOW(minute, 2), 
    messageId, 
    deviceId,
    temperature,
    humidity,
    pressure,
    pointInfo,
    IoTHub,
    EventEnqueuedUtcTime,
    EventProcessedUtcTime,
    PartitionId
)

SELECT * INTO SQLServerOutput FROM BasicOutput
SELECT * INTO AzureFunctionOutput FROM BasicOutput

你有没有遇到过这个问题?非常感谢任何帮助。

4

1 回答 1

1

我刚刚在 Google 中进行了一些搜索并找到了这个文档。阅读相同内容后,我将查询更新如下。

WITH BasicOutput AS 
(
SELECT    
    messageId,
    deviceId,
    temperature,
    humidity,
    pressure,
    pointInfo,
    IoTHub,
    EventEnqueuedUtcTime,
    EventProcessedUtcTime,
    PartitionId,    
    COUNT(*) AS Count
FROM
    Input TIMESTAMP By EventEnqueuedUtcTime
    GROUP BY TUMBLINGWINDOW(second, 2), 
    messageId, 
    deviceId,
    temperature,
    humidity,
    pressure,
    pointInfo,
    IoTHub,
    EventEnqueuedUtcTime,
    EventProcessedUtcTime,
    PartitionId
)

SELECT * INTO SQLServerOutput FROM BasicOutput
SELECT * INTO AzureFunctionOutput FROM BasicOutput

System.TIMESTAMP AS TIME,从我的选择中删除了并添加了TIMESTAMP By EventEnqueuedUtcTime. 它在此更改后开始工作。

于 2018-12-18T15:37:57.623 回答