Hello , i have a scala code that generates string in csv format( comma seperated) . how can i directly insert the record into map D using my code.?
Not clear exactly what “using my code” means as I don’t know what your code can do beyond generate csv.
Option 1. Just write csv to a file and use regular
COPY FROM to load into MapD
Options 2. So i am going to start by saying I have not tried thrift from scala so you will be on your own here. Assuming you can generate Thrift bindings in your scala world, then you could instead of genrating csv in your file just push the data direct across into MapD via the
insert_table ... API’s, I would recommend
insert_table_columnar_binary as a good starting point.
Option 3. If the direct binding prove to be complicated, you could use the java jdbc drivers from scala and do the equivalent of a bulk insert via jdbc as your program generates data. I have not tried calling to jdbc from scala but I have been told it is possible.
Hope one of these options help