AnsweredAssumed Answered

MapR DB Document Exsists Exception

Question asked by Velumani on Apr 15, 2016
Latest reply on Apr 15, 2016 by maprcommunity


     I am getting document existing exception when I try to insert a simple document in MapR DB table using OJAI. There are no entries in that table. Below is the code snippet.




          Table table = MapRDB.getTable("/tables/MasterDataMapping"); // get the table  

          System.out.println(" Table Name : " + table.getName());

          System.out.println(" Table Path : " + table.getPath());

          System.out.println(" Table Infos : " + Arrays.toString(table.getTabletInfos()));


          DBDocument doc = MapRDB.newDocument().set("key", "value").set("_id", "1");



And the console output is



=============== TABLE INFO ===============

Table Name : MasterDataMapping

Table Path : /tables/MasterDataMapping

Table Infos : [TabletInfoImpl [condition=[RowkeyRange [startRow=, stopRow=]], locations=[maprdemo], estimatedSize=0, estimatedNumRows=0]]



Exception in thread "main" com.mapr.db.exceptions.DocumentExistsException: A row with key "\x031" already exist in the table

  at com.mapr.db.impl.MapRDBTableImpl._insert(

  at com.mapr.db.impl.MapRDBTableImpl.insert(

  at com.mapr.db.impl.MapRDBTableImpl.insert(

  at com.mapr.db.importer.streamParser.<init>(

  at com.mapr.db.importer.ojaiImport.main(


Any help is highly appreciable. Thanks in Advace