arcadedb icon indicating copy to clipboard operation
arcadedb copied to clipboard

SQL: `IMPORT DATABASE` fails for missing CSV values

Open gramian opened this issue 2 years ago • 0 comments

ArcadeDB Version: ArcadeDB Server v23.7.1-SNAPSHOT (build 2ed2834735647841ad33d9b76408221bfc96055d/1690912950007/main)

OS and JDK Version: Running on Mac OS X 12.6.5 - OpenJDK 64-Bit Server VM 11.0.19 (Homebrew)

Expected behavior

Import of documents

Actual behavior

Cannot execute command Error on parsing source 'null'
Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandExecutionException: Error on importing database
	at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:69)
	at com.arcadedb.query.sql.executor.SingleOpExecutionPlan.executeInternal(SingleOpExecutionPlan.java:91)
	at com.arcadedb.query.sql.parser.SimpleExecStatement.execute(SimpleExecStatement.java:64)
	at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:73)
	at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:101)
	at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1299)
	at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:451)
	at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:123)
	at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:91)
	at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:98)
	at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:124)
	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:829)
Caused by: com.arcadedb.integration.importer.ImportException: Error on parsing source 'null'
	at com.arcadedb.integration.importer.Importer.load(Importer.java:63)
	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:61)
	... 17 more
Caused by: java.lang.NullPointerException
	at com.arcadedb.integration.importer.AnalyzedEntity.setRowSize(AnalyzedEntity.java:66)
	at com.arcadedb.integration.importer.format.CSVImporterFormat.analyze(CSVImporterFormat.java:521)
	at com.arcadedb.integration.importer.SourceDiscovery.getSchema(SourceDiscovery.java:70)
	at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:81)
	at com.arcadedb.integration.importer.Importer.load(Importer.java:54)
	... 22 more

Steps to reproduce

Import via SQL from Studio:

IMPORT DATABASE file://vertices.csv;

with CSV file:

Id,First Name,Last Name
0,Jay,Miner
1,Elon,Musk
2,Steve,Jobs
3,Isaac,Newton
4,Nikola,Tesla
5,,Einstein

gramian avatar Aug 07 '23 08:08 gramian