我可以在 Azure 流分析作业的同一输出中有多个查询吗?

Geo*_*yva 3 input azure output azure-stream-analytics

我可以在 Azure 流分析作业的同一输出中有多个查询吗?

例如

SELECT property1, property2 INTO Output1 WHERE Property3 ='Answer'
SELECT property4, property5 INTO Output1 WHERE Property3 ='Question'
Run Code Online (Sandbox Code Playgroud)

小智 5

首先联合结果并使用 WITH 为组合取别名,然后从该表中选择到输出中。

https://msdn.microsoft.com/en-us/azure/stream-analytics/reference/union-azure-stream-analytics

没有测试这个,但应该给出这个想法:

WITH Combined AS (
SELECT property1, property2 
FROM [input-hub] 
WHERE Property3 ='Answer'
UNION
SELECT property4, property5 
FROM [input-hub] 
WHERE Property3 ='Question'
)

SELECT * 
INTO [output-cosmos]
FROM Combined
Run Code Online (Sandbox Code Playgroud)