Repository navigation
SQL: IMPORT DATABASE fails for CSV #1061
Copy link
Copy link
Closed
Milestone
Description
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
A type with properties a, b, c.
Actual behavior
Details
Error on parsing source 'null'2023-05-01 07:20:29.654 INFO [SourceDiscovery] <ArcadeDB_0> Analyzing url: file:///path/to/test.csv...
2023-05-01 07:20:29.656 INFO [CSVImporterFormat] <ArcadeDB_0> Reading header from 1st line in data file: [a, b, c]
2023-05-01 07:20:29.658 INFO [SourceDiscovery] <ArcadeDB_0> Recognized format CSV (parsingLimitBytes=9,54MB parsingLimitEntries=0)
2023-05-01 07:20:29.659 INFO [Importer] <ArcadeDB_0> Checking schema...- Status update: parsed 0 (0/sec) - 0 documents (0/sec) - 0 vertices (0/sec) - 0 edges (0/sec) - 0 skipped edges - 0 linked edges (0/sec - 0%)
<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:69)
at com.arcadedb.query.sql.executor.SingleOpExecutionPlan.executeInternal(SingleOpExecutionPlan.java:91)
at com.arcadedb.query.sql.parser.SimpleExecStatement.execute(SimpleExecStatement.java:63)
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: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)
... 18 more
Caused by: java.lang.IllegalArgumentException: Record type 'DATABASE' is not supported
at com.arcadedb.integration.importer.AbstractImporter.updateDatabaseSchema(AbstractImporter.java:252)
at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:87)
at com.arcadedb.integration.importer.Importer.load(Importer.java:54)
... 23 more
Steps to reproduce
Given a simple test.csv file like:
a,b,c
1,2,3
4,5,6
7,8,9
the following command causes this error:
IMPORT DATABASE file:///path/to/test.csv
Tested in studio using an absolute path to the CSV.
Reactions are currently unavailable
Activity
ZachMurray commentedon May 22, 2023
I think I'm having the same issue on Windows.
lvca commentedon Jun 12, 2023
Reproduced.
fix: import database with CSV files
lvca commentedon Jun 12, 2023
Fixed. Tried with this:
The
documentTypesetting tells with Document type to use, otherwise "Document" is used.gramian commentedon Jun 12, 2023
Works for me. Very cool!
@ZachMurray & @mmoselerhcfs it would be great if you could test, too.
fix: import database with CSV files