使用 JSON 的 ADF 解析转换

ADF Parse Transformation with JSON

我有以下 JSON 对象:

    {
    "comments_count": 0,
    "impressions": 2838,
    "lifetime_snapshot.followers_count": 14993,
    "likes": 10,
    "net_follower_growth": -3,
    "post_content_clicks": 19,
    "post_media_views": 415,
    "shares_count": 1,
    "video_views": 415
    }

在 Azure 数据工厂解析转换中,我使用以下表达式创建了一个复杂对象:

    (impressions as integer,
    likes as integer,
    comments_count as integer,
    lifetime_snapshot as (snap as (followers_count as integer)),
    net_follower_growth as integer,
    post_content_clicks as integer,
    post_media_views as integer,
    shares_count as integer,
    video_views as integer)

在“数据预览”选项卡中,我得到了所有正确的整数值,除了 followers_count 是 NULL。

获取 lifetime_snapshot.followers_count 字段值的正确语法是什么?

请试试这个语法:

(
    impressions as integer,
    likes as integer,
    comments_count as integer,
    {lifetime_snapshot.followers_count} as integer,
    net_follower_growth as integer,
    post_content_clicks as integer,
    post_media_views as integer,
    shares_count as integer,
    video_views as integer
)

数据预览: