传输bson文件时出错,返回“com.mongodb.util.jsonparseexception”

bqjvbblv  于 2021-05-29  发布在  Hadoop
关注(0)|答案(0)|浏览(340)

我正在尝试将bson文件传输到配置单元,bson文件是从mongodb转储的,
mongodump命令 mongodump -h $host -u $user -p $password -d $db -c $collection -o $output ,
我用jar做的 add jar mongo-hadoop-core-2.0.2.jar;add jar mongo-hadoop-hive-2.0.0.jar;add mongo-java-driver-3.2.2.jar; 当我像这样执行hivesql时

create external table sfim_logs_dump (
        id string
        ,ts bigint
        ,reqts string
        ) 
        row format serde 'com.mongodb.hadoop.hive.bsonserde' 
        with serdeproperties(
       'mongo.columns.mapping' = '{"id":"_id","ts":"ts","reqts":"reqts"}')
        stored as inputformat 'com.mongodb.hadoop.mapred.bsonfileinputformat' 
        outputformat 'com.mongodb.hadoop.hive.output.hivebsonfileoutputformat' 
        location '$hdfspath'

错误就像

com.mongodb.util.JSONParseException:
                at com.mongodb.util.JSONParser.read(JSON.java:302)
                at com.mongodb.util.JSONParser.parseObject(JSON.java:263)
                at com.mongodb.util.JSONParser.parse(JSON.java:228)
                at com.mongodb.util.JSONParser.parse(JSON.java:156)
                at com.mongodb.util.JSON.parse(JSON.java:98)
                at com.mongodb.util.JSON.parse(JSON.java:79)
                at com.mongodb.hadoop.hive.BSONSerDe.initialize(BSONSerDe.java:110)
                at org.apache.hadoop.hive.serde2.SerDeUtils.initializeSerDe(SerDeUtils.java:526)

请帮我解决这个问题?如何将bson文件传输到配置单元中?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题