Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5088

Error when reading DBRef column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.10.0
    • Execution - Data Types
    • None
    • drill 1.9.0
      mongo 3.2

    Description

      In a mongo database with DBRef, when a DBRef is inserted in the first line of a mongo's collection drill query failed :

      0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
      Error: SYSTEM ERROR: CodecConfigurationException: Can't find a codec for class com.mongodb.DBRef.
      

      Simple example to reproduce:
      In mongo instance

      db.contact2.drop();
      db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8938"), "account" : DBRef("contact", ObjectId("999cbf116b69060001fd8611")) });
      

      In drill :

      0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
      Error: SYSTEM ERROR: CodecConfigurationException: Can't find a codec for class com.mongodb.DBRef.
      
      
      [Error Id: 2944d766-e483-4453-a706-3d481397b186 on Analytics-Biznet:31010] (state=,code=0)
      

      If the first line doesn't contain de DBRef, drill will querying correctly :
      In a mongo instance :

      db.contact2.drop();
      db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8939") });
      db.contact2.insert({ "_id" : ObjectId("582081d96b69060001fd8938"), "account" : DBRef("contact", ObjectId("999cbf116b69060001fd8611")) });
      

      In drill :

      0: jdbc:drill:zk=local> select * from mongo.mydb.contact2;
      +--------------------------------------+---------------------------------------------------------------+
      |                 _id                  |                            account                            |
      +--------------------------------------+---------------------------------------------------------------+
      | {"$oid":"582081d96b69060001fd8939"}  | {"$id":{}}                                                    |
      | {"$oid":"582081d96b69060001fd8938"}  | {"$ref":"contact","$id":{"$oid":"999cbf116b69060001fd8611"}}  |
      +--------------------------------------+---------------------------------------------------------------+
      2 rows selected (0,563 seconds)
      

      Attachments

        Issue Links

          Activity

            People

              cshi Chunhui Shi
              guillaumec Guillaume Champion
              Gautam Parai Gautam Parai
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: