Sap Hana - Import statement
Usage
IMPORT FROM CSV FILE '/dir/import.csv' INTO SCHEMA."IMPORT_TABLE"
THREADS 1 -- default 1, max 256.
BATCH 10000 -- number_of_records_of_each_commit
TABLE LOCK -- Uses table locks for fast import of column store tables.
NO TYPE CHECK -- Specifies that the record will be inserted without checking the type of each field.
SKIP FIRST 1 ROW -- SKIP FIRST <number_of_rows_to_skip> ROW
COLUMN LIST IN FIRST ROW -- Column list is stored in the first row of the CSV import file.
COLUMN LIST ( <column_name_list> ) -- The ordering must match the order in the CSV file and the columns name in the target table.
WITH RECORD DELIMITED BY '\n'
FIELD DELIMITED BY ','
OPTIONALLY ENCLOSED BY '"'
ERROR LOG '/data/data.err'
TIME FORMAT 'YYYY-MM-DD HH24:MI:SS'
DATE FORMAT 'YYYY-MM-DD'
FAIL ON INVALID DATA -- command will fail unless all the entries have imported successfully
WITH SCHEMA FLEXIBILITY -- Creates missing columns based on the column names in the header row of CSV;
Statement 'IMPORT FROM CSV FILE '/dir/import.csv' INTO ...'
successfully executed in 212 ms 526 µs (server processing time: 204 ms 73 µs) - Rows Affected: 0
When failed
From Studio:
java.sql.SQLWarning: some of rows have failed to be imported:
Partial failure occurs in importing /pathToMyFile.csv
Thread
In the details of the thread in the administration tool
Thread ID: 27915
Calling: 8759, 19511, 27650, 27652, 27839, 27841, 27994, 28245, 28271, 28273
Configuration
The indexserver parameter configuration
Enable
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'system')
set ('import_export', 'enable_csv_import_path_filter') = 'false'
with reconfigure
Authorize Path
ALTER SYSTEM ALTER CONFIGURATION ('indexserver.ini', 'system')
set ('import_export', 'csv_import_path_filter') = '/A;/B'
with reconfigure
Support
http://wiki.scn.sap.com/wiki/display/inmemory/Common+Import+Errors