Configuring Export

written by vdbdev on January 30, 2014 with no comments

VoltDB’s export feature connects VoltDB to a downstream OLAP system
so that you can use VoltDB for data correlation, data quality, filtering,
real time enrichment – and pass completed records downstream to your
OLAP / HDFS for historical analytics and archival.

Export is easy to use. There are 3 steps to enabling export functionality
in your VoltDB application. Declare an export table in your DDL file.
Enable export in the deployment.xml configuration file. Use standard
SQL INSERT statements to write data to the export table either via ad-hoc
sql or VoltDB stored procedures.

An example of using export is available in the VoltDB distribution kit:
doc/tutorials/auction demonstrates how to configure and use export.

Add an Export table the DDL

Export tables are declared in the DDL using standard CREATE TABLE syntax
and then declared as export tables via the VoltDB EXPORT DDL declaration.

Note that export tables are INSERT only. The VoltDB planner will reject
attempts to SELECT from or UPDATE export tables.

CREATE TABLE BID_EXPORT (
  BIDID INTEGER DEFAULT '0' NOT NULL,
  ITEMID INTEGER DEFAULT '0' NOT NULL,
  BIDDERID INTEGER DEFAULT '0' NOT NULL,
  BIDTIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
  BIDPRICE FLOAT DEFAULT NULL,
);

PARTITION TABLE BID_EXPORT ON COLUMN ITEMID;
EXPORT TABLE BID_EXPORT;

Enable the export feature in deployment.xml

To enable export, add an export configuration element to deployment.xml
specifying the export target and some conditional parameters. Here’s an
example that configures export to write export table contents to CSV
files.

<deployment>
    <cluster hostcount="1" sitesperhost="1" kfactor="0" />
    <httpd enabled="true">
        <jsonapi enabled="true" />
    </httpd>
    <export enabled="true" target="file">
        <configuration>
            <property name="type">csv</property>
            <property name="nonce">MyExport</property>
            <property name="period">5</property>
        </configuration>
    </export>
</deployment>

VoltDB export documentation

Export is described in depth in the Using VoltDB guide. Please see the
Exporting Live Data chapter for further help.