Forum: Building VoltDB Applications

Post: Loading data into VoltDB

Loading data into VoltDB
tcallaghan
Nov 5, 2010
Need to load data from flat files into VoltDB?

Linked from this post is an example application that shows how to load data from a file into VoltDB. It handles decimal, integer, string and timestamp data.

build.xml
Ant script. Requires an environment variable "VOLTDB" be defined and pointing to the location of the VoltDB jar and shared library. Modify the path to the filename to load and the server to connect to in the "client" target.

ddl.sql
DDL for example.

project.xml
Project file for example.

deployment.xml
Deployment information for example. Change hostcount, sitesperhost, leader, and kfactor for your environment.

src/com/ClientLoad.java
Client application to read file and call insert stored procedure.

src/com/procedures/InsertRow.java
Stored procedure to insert a row into load table.


Download the example application here.


Questions/comments?

-Tim
csvloader in VoltDB 2.7.2
ajgent
Jul 1, 2012
A CSV file loader has been added to the VoltDB kit that makes loading data from text files much easier. The csvloader shell command is available in VoltDB 2.7.2 and later and is documented in the Using VoltDB guide.