4. Creating a Database and Loading Data : Loading Data : Load Data with COPY VWLOAD Statement
 
Share this page                  
Load Data with COPY VWLOAD Statement
The COPY...VWLOAD statement copies the contents of a file to a table using the VWLOAD operator. This operation is similar to using vwload --cluster on the command line, except that the load can be done from within a multi-statement transaction instead of in a separate session.
Bulk load the data from multiple files into mytable table. Columns in the data file are delimited with a vertical bar, records are delimited by a new line, and null values are identified as NULL:
COPY mytable() VWLOAD FROM 'hdfs://namenode:8020/path/to/data/mytable_1.txt', 'hdfs://namenode:8020/path/to/data/mytable_2.txt' WITH INSERTMODE=BULK, FDELIM='|', RDELIM='\n', NULLVALUE='NULL', WORK_DIR = '/home/users/temp'