【发布时间】:2023-02-06 15:43:09
【问题描述】:
我在用JOLTTransformJsonNifi 中的处理器。
我的输入是:
[
{
"col_name": "time",
"data_type": "timestamp",
"is_nullable": true
},
{
"col_name": "otherData",
"data_type": "string",
"is_nullable": false
}
]
我正在使用下面的规格:
[
{
"operation": "shift",
"spec": {
"*": {
"col_name": "name",
"data_type": "type[0]",
"is_nullable": {
"true": "type[1]",
"false": "type[1]"
}
}
}
},
{
"operation": "default",
"spec": {
"*": {
"type[1]": "notnull"
}
}
}
]
预期产出是 :
{
"type": "record",
"name": "table_name",
"fields": [
{
"name": "time",
"type": [
"timestamp",
"null"
]
},
{
"name": "otherData",
"type": [
"string",
"notnull"
]
}
]
}
但是将下面的作为当前结果通过组合数组中的所有值,例如:
{
"name": [
"time",
"otherData"
],
"type": [
[
"timestamp",
"int"
],
null
]
}
有人可以帮助我错过了什么吗?
【问题讨论】:
标签: json bigdata transform etl apache-nifi