]
Steven Hawkins resolved TEIID-5766.
-----------------------------------
Fix Version/s: 12.3
Resolution: Done
Added logic to skip the import logic for empty lists.
MongoDB import fails when collection contains an empty array
------------------------------------------------------------
Key: TEIID-5766
URL:
https://issues.jboss.org/browse/TEIID-5766
Project: Teiid
Issue Type: Bug
Components: Server
Affects Versions: 8.12.17.6_4
Reporter: Marc Shirley
Assignee: Steven Hawkins
Priority: Major
Fix For: 12.3
MongoDB import fails with error like [1] when collection returns an empty array in the
first doc.
[1]
14:32:38,167 WARN [org.teiid.RUNTIME] (teiid-async-threads - 1) TEIID50036 VDB
importVDB.1 model "importVDBSrcModel" metadata failed to load. Reason:Index: 0,
Size: 0: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657) [rt.jar:1.8.0_171]
at java.util.ArrayList.get(ArrayList.java:433) [rt.jar:1.8.0_171]
at
org.teiid.translator.mongodb.MongoDBMetadataProcessor.addColumn(MongoDBMetadataProcessor.java:149)
at
org.teiid.translator.mongodb.MongoDBMetadataProcessor.addTable(MongoDBMetadataProcessor.java:115)
at
org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:72)
at
org.teiid.translator.mongodb.MongoDBMetadataProcessor.process(MongoDBMetadataProcessor.java:48)
at org.teiid.translator.ExecutionFactory.getMetadata(ExecutionFactory.java:950)
[teiid-api-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at
org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeMetadataRepository.java:96)
[teiid-engine-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at
org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:62)
[teiid-engine-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at
org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
[teiid-engine-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at org.teiid.jboss.VDBService$6.run(VDBService.java:395)
[teiid-jboss-integration-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at org.teiid.jboss.VDBService$7.run(VDBService.java:446)
[teiid-jboss-integration-8.12.17.6_4-redhat-64-2.jar:8.12.17.6_4-redhat-64-2]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[rt.jar:1.8.0_171]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[rt.jar:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_171]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)