CSV File Format
About this task
The following sample data set can be used to complete the tutorial or you can use your own data file and DDL. Download the Boston Property Assessment FY2016 (45.6MB) sample data set (courtesy of Analyze Boston). This package contains a schema (boston_property_assessment_fy2016.schema.sq) file and a data file (BOSTON_PROPERTY_ASSESSMENT_FY2016.cvs).
Procedure
Move your data
Move the data file to the Db2 Warehouse SaaS or Db2 as a Service landing zone. This landing zone stages your CSV file before it's ingested into the database. You need your database credentials. You can get these credentials from the console by clicking Connect in the side navigation bar.
- Move the data file to the landing zone of the target database by running the following lift
put
command:
% lift put --file <path-to-csv-file>/BOSTON_PROPERTY_ASSESSMENT_FY2016.csv --target-user <target-user-name> --target-password <target-password> --target-host <target-database-host-name> - Load the data set CSV file into the target database by running the following lift load
command:
% lift load --filename BOSTON_PROPERTY_ASSESSMENT_FY2016.csv --target-schema <your-schema-name> --target-table BOSTON_PROPERTY_ASSESSMENT_FY2016 --header-row --remove --file-origin user --target-user <target-user-name> --target-password <target-password> --target-host <target-database-host-name>The
--header-rowoption specifies that the first row of the data set contains the column headings. The `--file-origin` user option specifies that this CSV file is user-generated and was not extracted using the lift extract command.You're done. You can now run SQL queries on the sample data set from the database console.