请教:看到stream load 可以进行数据转 换麻烦大家伙帮我看看我写的有啥问题吗

Viewed 31

curl --location-trusted
-u root:abc123!@#
-H "label:134"
-H "Expect:100-continue"
-H "format:json"
-H "strip_outer_array:true"
-H "jsonpaths:["$.score1", "$.name", "$.create_date"]"
-H "columns:score = score1 + 1,name,create_date"
-T C:\Users\Administrator\Desktop\test.json
-XPUT http://192.168.150.104:8030/api/autotest/original_track_01/_stream_load

然后我的json 是
[
{"score1":95,"name":11,"create_date":"2024-1-1"},
{"score1":32,"name":22,"create_date":"2024-1-1"},
{"score1":66,"name":33,"create_date":"2024-1-1"}
]
然后 我的表的字段是 score name create_date
我想让他的score +1 然后再写进去
报错信息 是 "Message": "[ANALYSIS_ERROR]TStatus: errCode = 2, detailMessage = unknown reference column, column=score, reference=score1",

1 Answers

-H "columns:score = score1 + 1,name,create_date"
改为这个试试:
-H "columns:score1,score = score1 + 1,name,create_date"
具体参考stream load转换示例:stream load 指定列映射和值变换