0

我想存储正在登录 App Ins 的所有自定义指标,移动到 SQL 数据库。

我已经在 App Ins 上启用了 cont 导出,它将 App Ins 自定义指标转储到 blob 中。

从这里想要一个我想要 Stream Analytic 转储 SQL Azure 中的数据。

问题是我无法在 SA 中编写转换查询。

我们将记录 100 个自定义指标。

我想像这样将它们存储在SQL中

Time        Metric           Value
-------------------------------------

我正在尝试通过查询来实现这一点:

SELECT 
    flat.PropertyName,
    flat.PropertyValue
INTO
    [outputdb-ai3]
FROM 
    [storage-ai] A
OUTER APPLY  
    GetRecordProperties(A.[context].[custom]) AS flat

但没有运气,请建议。

谢谢

4

1 回答 1

0

这是获得所需结果的查询。

SELECT
    Input.internal.data.id,
    Input.context.data.eventtime,
    recordProperty.PropertyName AS Name,
    recordProperty.PropertyValue.Value
INTO
    [outputdb]
FROM
    [storage-ai] AS Input TIMESTAMP BY Input.context.data.eventtime 
    CROSS APPLY GetElements(Input.[context].[custom].[metrics]) AS flat
    CROSS APPLY GetRecordProperties(Flat.ArrayValue) AS recordProperty
于 2016-05-19T17:46:01.007 回答