基于一个条件,即如果两个表中的客户名称匹配,则其中一个表中的少数列应分配为**null
。我有所有匹配条件的输入,但我无法将所需列设置为null
**
输入:
[
{
"IN_num": "3",
"In_Details": "404 error",
"customer_name": "vivo",
"customer_location": "hyd",
"customer_ID": "1003"
},
{
"IN_num": "2",
"In_Details": "404 error",
"customer_name": "MI",
"customer_location": "hyd",
"customer_ID": "1002"
},
{
"IN_num": "1",
"In_Details": "notworking",
"customer_name": "Nokia",
"customer_location": "Hyd",
"customer_ID": "1001"
}
]
字符串
我已经尝试创建一个假的null值,并将其分配给所需的键,但我仍然得到了键已经存在的值。
我的规格:
[
{
"operation": "modify-overwrite-beta",
"spec": {
"*": {
"N1": [
"=isNull(@(1,customer_ID))",
"NuLl"
],
"N2": [
"=isNull(@(1,customer_location))",
"NotNuLl"
],
"Condition": "=concat(@(1,N1),'_',@(1,N2))",
"test": null
}
}
},
{
"operation": "shift",
"spec": {
"*": {
"IN_num": "[&1].IN_num",
"In_Details": "[&1].In_Details",
"customer_name": "[&1].customer_name",
"test": "[&1].test",
"customer_location": "[&1].customer_location",
"Condition": {
"NuLl_NotNuLl": {
"@2,test": "customer_location"
}
}
}
}
}
]
型
在这里,customer location有一个现有值,但我希望将其打印为“"。
我得到的输出:
[
{
"IN_num": "3",
"In_Details": "404 error",
"customer_name": "vivo",
"test": null,
"customer_location": "hyd"
},
{
"IN_num": "2",
"In_Details": "404 error",
"customer_name": "MI",
"test": null,
"customer_location": "hyd"
},
{
"IN_num": "1",
"In_Details": "notworking",
"customer_name": "Nokia",
"test": null,
"customer_location": "Hyd"
}
]
型
对于关键字““customer_location”,我希望值为“”或null。
如何进行这件事?
1条答案
按热度按时间91zkwejq1#
我不确定你的预期结果。如果你正在寻找一个条件,如if else语句,那么下面的规范可以帮助你。
字符串
的数据
让我们知道如果你正在寻找不同的东西。