Ошибка передачи BSON-файла с помощью com.mongodb.util.JSONParseException - PullRequest
2 голосов
/ 08 апреля 2019

Я пытаюсь перенести файл BSON в Hive, файл BSON является дампом из MongoDB,

команда mongodump, как

mongodump -h $host -u $user -p $password -d $db -c $collection -o $output * * 1004 и я использовал банку как
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 в Hive?

...