SQL: INSERT in multi-property full-text index causes error (original) (raw)

ArcadeDB Version: ArcadeDB Server v23.3.1 (build da609e4/1680693032550/main)

JDK Version: Running on Mac OS X 12.6.4 - OpenJDK 64-Bit Server VM Homebrew

Expected behavior

Successful insert.

Actual behavior

Error on command execution (PostCommandHandler)

Error on command execution (PostCommandHandler)
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at com.arcadedb.index.lsm.LSMTreeIndex.convertKeys(LSMTreeIndex.java:597)
    at com.arcadedb.index.lsm.LSMTreeIndex.put(LSMTreeIndex.java:386)
    at com.arcadedb.database.DocumentIndexer.addToIndex(DocumentIndexer.java:71)
    at com.arcadedb.database.DocumentIndexer.createDocument(DocumentIndexer.java:60)
    at com.arcadedb.database.EmbeddedDatabase.createRecordNoLock(EmbeddedDatabase.java:795)
    at com.arcadedb.database.EmbeddedDatabase.lambda$createRecord$16(EmbeddedDatabase.java:741)
    at com.arcadedb.database.EmbeddedDatabase.executeInReadLock(EmbeddedDatabase.java:1326)
    at com.arcadedb.database.EmbeddedDatabase.createRecord(EmbeddedDatabase.java:740)
    at com.arcadedb.database.MutableDocument.save(MutableDocument.java:287)
    at com.arcadedb.graph.MutableVertex.save(MutableVertex.java:60)
    at com.arcadedb.graph.MutableVertex.save(MutableVertex.java:39)
    at com.arcadedb.query.sql.executor.SaveElementStep$1.next(SaveElementStep.java:59)
    at com.arcadedb.query.sql.executor.InsertExecutionPlan.executeInternal(InsertExecutionPlan.java:65)
    at com.arcadedb.query.sql.parser.InsertStatement.execute(InsertStatement.java:124)
    at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:85)
    at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:69)
    at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:97)
    at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1264)
    at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:421)
    at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:127)
    at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:88)
    at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:92)
    at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.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:1512)
    at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
    at java.base/java.lang.Thread.run(Thread.java:829)

Steps to reproduce

This error happens with a complex schema and JSON insert; unfortunately, I am currently unable to reproduce in simplified form. Anyway, here is some information on the set up:

CREATE INDEX ON doc (name,description,keywords) FULL_TEXT;

After the index is created, records are inserted, but none of the indexed properties are null (see #1063 ), but sometimes one or two are the empty string ''.

The same INSERTs work if I create three separate indexes before inserting:

CREATE INDEX ON doc (name) FULL_TEXT;
CREATE INDEX ON doc (description) FULL_TEXT;
CREATE INDEX ON doc (keywords) FULL_TEXT;

So, I assume this is related to the multi property nature of the index.