gpt4 book ai didi

azure - 用于解析复杂数组的数据流派生列

转载 作者:行者123 更新时间:2023-12-03 05:11:24 25 4
gpt4 key购买 nike

可以帮助我通过派生列获取 ADF 数据流中以下复杂数组中的 (nth-1) 元素:

"Ranks": {
"3760901": [
6286064,
40635,
5712864,
567,
5712962,
711,
5713354,
-1
],
"21377132011": [
6351134,
1295,
6351382,
1332,
6352064,
3212,
6580356,
-1
],
"9000000000000000000": [
6547144,
8381,
6547914,
7775,
6548316,
8468,
6549346,
10031,
6580216,
-1
]
}

结果:对于 3760901 节点值,我期待 5712962,对于 21377132011 节点,我期待 3212,对于 9000000000000000000 我期待 10031。

节点是动态的,我无法进行硬编码。

最佳答案

我可以通过以下方法实现您的要求。

首先,我将您的 JSON 封装在 {} 中,并将其提供给数据流源。我选择了源选项-> JSON 设置->单个文档

这是源的数据预览:

enter image description here

然后我采用选择转换Ranks对象中提取列。

在选择转换中,使用基于规则的映射(转到“添加映射”->“基于规则的映射”)。给出以下配置。

enter image description here

选择的数据预览:

enter image description here

现在,我采用派生列从每个数组列中获取 (n-2) 个元素。

点击添加-> 添加列模式并使用下面的动态表达式。

($$ ? integer[])[minus(size(($$ ? integer[])),2)]

enter image description here

结果:

enter image description here

关于azure - 用于解析复杂数组的数据流派生列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76633629/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com