I have created a vertices.csv file that contains some porperties:
id,lookup,status,list
1,"0000","ACTIVE","["AAAA","BBBB"]"
but I am having trouble getting the list to be recognized, if formatted as above, the importing will throw an array out of bounds error:
<ArcadeDB_0> Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandExecutionException: Error on importing database
at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:73)
at com.arcadedb.query.sql.executor.SingleOpExecutionPlan.executeInternal(SingleOpExecutionPlan.java:92)
at com.arcadedb.query.sql.parser.SimpleExecStatement.execute(SimpleExecStatement.java:66)
at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:73)
at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:107)
at com.arcadedb.database.LocalDatabase.command(LocalDatabase.java:1348)
at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:472)
at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:134)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:113)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:100)
at com.arcadedb.server.http.handler.AbstractServerHttpHandler.handleRequest(AbstractServerHttpHandler.java:127)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.arcadedb.integration.importer.ImportException:
Error on parsing source 'file://doc.csv (compressed=false size=25)'
at com.arcadedb.integration.importer.Importer.load(Importer.java:69)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:62)
... 17 more
Caused by: java.lang.IndexOutOfBoundsException: Index 4 out of bounds for length 4
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at com.arcadedb.integration.importer.format.CSVImporterFormat.analyze(CSVImporterFormat.java:523)
at com.arcadedb.integration.importer.SourceDiscovery.getSchema(SourceDiscovery.java:70)
at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:93)
at com.arcadedb.integration.importer.Importer.load(Importer.java:56)
if i format the list as "[""AAAA"",""BBBB""]"
it will be parsed, but interpreted as a list of a single element, the documentation doesn’t seem to have an example of importing with a list.
All variations I have tried result either in an import error or malformed list of strings, I would like to import the list with all elements separated so that the query select list[0] from
vertice where lookup = '0000'
will give me “AAAA”.
Ricardo Alves is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.