Pentaho:从JSON输入文件

时间:2017-11-30 21:04:26

标签: pentaho pentaho-cde pentaho-data-integration

我从SFTP获取一个JSON文件并尝试将其插入到oracle中,但在预览部分中,我只获得一行,并且只有一行插入到表中。我已经尝试修改为数字以预览行为10000但没有任何效果。

{ “POSTAL_CODE”: “XX”, “build_id”: “XX”, “类别”:[], “闭合”:假 “closed_reasons”:[], “电子邮件”:[ “XX”], “external_link”:{ “脸谱”:[], “喊叫”:[ “”]}, “HQ”:假, “位置”:{ “LAT”:XXXXX “LON”:XXXXX}, “地铁”: “Cxxxxx,IL”,“naics_codes”:[{“category_code”:“XX”,“category_description”:“XX”},{“category_code”:“XX”,“category_description”:“xxxxx”},{“category_code “:”XX“,”category_description“:”xxxxx“},{”category_code“:xxxxx”,“category_description”:“XX”}],“name”:“XX”,“place_id”:“XX”,“ place_ids “:[” XXX “ ”XX“], ”sic_codes“:[{ ”category_code“: ”XX“, ”category_description“: ”XX“},{ ”category_code“: ”XX“, ”category_description“:” XX“}]}

2 个答案:

答案 0 :(得分:0)

您的示例json是:

{
"postal_code":"XX",
"build_id":"XX",
"categories":[],
"closed":false,
"closed_reasons":[],
"email":["XX"],
"external_link":{
    "facebook":[],
    "yelp":[""]
},
"hq":false,
"location":{
    "lat":xxxxx,
    "lon":xxxxx
},
"metro":"Cxxxxx, IL",
"naics_codes":[
    {
        "category_code":"XX",
        "category_description":"XX"
    },
    {
        "category_code":"XX",
        "category_description":"xxxxx "
    },
    {
        "category_code":"XX",
        "category_description":"xxxxx "
    },
    {
        "category_code":xxxxx",
        "category_description":"XX"
    }
],
"name":"XX",
"place_id":"XX",
"place_ids":["xxx","xx"],
"sic_codes":[
    {
        "category_code":"XX",
        "category_description":"XX"
    },
    {
        "category_code":"XX",
        "category_description":"XX"
    }
]

}

因此,如果这是您从SFTP服务器获得的响应中的总值,Pentaho表现良好,因为它只有一条记录。如果您希望PDI识别该json中的字段并拆分它的内容,则需要在" Path"中指定每个字段的路径。字段"字段" " Json输入"上的标签步骤

答案 1 :(得分:0)

尝试如下使用输入的json文件:

var p = document.getElementsById("test");
p.outerHTML = myVal;