Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3317

MongoDB: group by doesn't work with MongoDB 2.6.3

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 8.9.1
    • Misc. Connectors
    • Hide

      Import this JSON File:

      {
      "BackupType" : "DBBackup",
      "Date" : "29-1-2015",
      "test": [{
      "TeiidArray": [
      { "_id":

      { "$oid" : "541087c3f706400030000002" }

      ,
      "FirstName": "Eugene",
      "Score": [ "Korean", "100", "Medium" ],
      "LastName": "T",
      "CustomerID": 1 },
      { "_id":

      { "$oid" : "541089051c4d5a0030000001" }

      ,
      "FirstName": "Stas",
      "Score": [ "Japanese", "50", "Advance" ],
      "LastName": "C",
      "CustomerID": 2 },
      { "_id":

      { "$oid" : "5410c969516cd50064000001" }

      ,
      "FirstName": "Sally",
      "Score": [ "Russian", "90", "Advance" ],
      "LastName": "F",
      "CustomerID": 3 } ]}]}

      Create Schema like:

      CREATE FOREIGN TABLE TeiidArray (
      ID String PRIMARY KEY,
      FirstName varchar(25),
      LastName varchar(25),
      Score object[]
      ) OPTIONS(UPDATABLE 'TRUE');

      Run the following sql:

      select "FirstName"
      from "MongoDB_Array_263"."TeiidArray"
      group by "FirstName"
      order by "FirstName"
      limit 1000

      Exception:

      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.rangeCheck(ArrayList.java:604)
      at java.util.ArrayList.get(ArrayList.java:382)
      at org.teiid.translator.mongodb.MongoDBQueryExecution.next(MongoDBQueryExecution.java:132)
      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:386)
      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:204)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209)
      at $Proxy182.more(Unknown Source)
      at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301)
      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

      Show
      Import this JSON File: { "BackupType" : "DBBackup", "Date" : "29-1-2015", "test": [{ "TeiidArray": [ { "_id": { "$oid" : "541087c3f706400030000002" } , "FirstName": "Eugene", "Score": [ "Korean", "100", "Medium" ], "LastName": "T", "CustomerID": 1 }, { "_id": { "$oid" : "541089051c4d5a0030000001" } , "FirstName": "Stas", "Score": [ "Japanese", "50", "Advance" ], "LastName": "C", "CustomerID": 2 }, { "_id": { "$oid" : "5410c969516cd50064000001" } , "FirstName": "Sally", "Score": [ "Russian", "90", "Advance" ], "LastName": "F", "CustomerID": 3 } ]}]} Create Schema like: CREATE FOREIGN TABLE TeiidArray ( ID String PRIMARY KEY, FirstName varchar(25), LastName varchar(25), Score object[] ) OPTIONS(UPDATABLE 'TRUE'); Run the following sql: select "FirstName" from "MongoDB_Array_263"."TeiidArray" group by "FirstName" order by "FirstName" limit 1000 Exception: Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.teiid.translator.mongodb.MongoDBQueryExecution.next(MongoDBQueryExecution.java:132) at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:386) at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:204) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209) at $Proxy182.more(Unknown Source) at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301) at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110) at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58) at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274) at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

      Running group by sql through exception:

      select "FirstName"
      from "MongoDB_Array_263"."TeiidArray"
      group by "FirstName"
      order by "FirstName"
      limit 1000

      Exception:

      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.rangeCheck(ArrayList.java:604)
      at java.util.ArrayList.get(ArrayList.java:382)
      at org.teiid.translator.mongodb.MongoDBQueryExecution.next(MongoDBQueryExecution.java:132)
      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:386)
      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:204)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209)
      at $Proxy182.more(Unknown Source)
      at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:301)
      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)
      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)
      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:274)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

              rhn-engineering-rareddy Ramesh Reddy
              mchantibco Ivan Chan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: