how to create a BAT file to be used in monetdb bulk load from a Java program

698 Views Asked by At

I have a file with a list of string (one cloumn). File example

sdfsdfsdf
hfhfhfghf
dfgdggdfg
pookokkoo

base on the documentation on monetdb web site, I have to create a BAT file.

How do I convert my file with strings into a BAT file ready to be imported in monetdb? How do I do this from Java?

Thanks,

monetdb site doc http://www.monetdb.org/Documentation/Cookbooks/SQLrecipies/BinaryBulkLoad

2

There are 2 best solutions below

2
On BEST ANSWER

From the Documentation:

For variable length strings, the file should have one C-based string value per line, terminated by a newline, and it is processed without escape character conversion.

Since this is exactly the format that you have, you can use it directly.

A technical note on the side: Strings in MonetDB are dictionary compressed which makes it really hard to generate the binary representation "by hand".

0
On

The MonetDB's documentation says: "Copying binary files: Migration of tables between MonetDB/SQL instances can be sped up using the binary COPY INTO/FROM format. See the recipe for this functionality.", however, it does not say how I can dump the data in binary format. How can I do it? I expected something like: "copy binary from TABLE to "file(s)"; and then "copy binary into TABLE from ('file(s)');