MAPI COPY INTO from stream
Hi, I'm trying to bulk load data into monetdb through COPY INTO statement on the fly. I've created an aggregator script that will create a session and send chunk of data using MAPI interface. Like this: "sCOPY INTO foo FROM STDIN USING DELIMITERS ',','\\n';" //+ "\n" + "100,10,0,'10'\n" + "\n" I've been following this example: http://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.java (haven't tested) I planned to add as part of the monetdb nodejs module: https://github.com/MonetDB/monetdb-nodejs/issues/1 but seems to be out of the scope of that repository. Sadly I'm not getting any error just doesn't work. What's the correct way ? Thanks.
If you try using the NodeJS module for this, try sending these queries to a MapiConnection object (low level), not a MonetDBConnection object (high level). The MonetDBConnection object that you are trying to use packs everything in between an 's' and a ';', including the data you want stored in your table. So you would get something like this (not tested): MapiConnection = require("monetdb/src/mapi-connection.js"); var conn = new MapiConnection(..your db options here..); conn.connect(); conn.request("sCOPY INTO foo FROM STDIN USING DELIMITERS ',', '\\n';"); conn.request("100,10,0,'10'\\n"); If you cannot get this to work, please show your attempt. On 02-03-16 05:37, Gustavo Brian wrote:
Hi,
I'm trying to bulk load data into monetdb through COPY INTO statement on the fly. I've created an aggregator script that will create a session and send chunk of data using MAPI interface. Like this: "sCOPY INTO foo FROM STDIN USING DELIMITERS ',','\\n';" //+ "\n" + "100,10,0,'10'\n" + "\n"
I've been following this example: http://dev.monetdb.org/hg/MonetDB/file/tip/java/example/SQLcopyinto.java (haven't tested) I planned to add as part of the monetdb nodejs module: https://github.com/MonetDB/monetdb-nodejs/issues/1 but seems to be out of the scope of that repository.
Sadly I'm not getting any error just doesn't work. What's the correct way ?
Thanks. _______________________________________________ users-list mailing list users-list@monetdb.org https://www.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Gustavo Brian
-
Robin Cijvat