Loading data without a configuration file

Load CSV or JSON data with a dsbulk load command.

Tip: The dsbulk command examples often show a parameter such as -url filename.csv or -url filename.json. Optionally, you can load or unload data from/to compressed CSV or JSON files. For details, refer to the --connector.(csv|json).compression option.

Load CSV or JSON data with a dsbulk load command.

Load data from a local file

Load data from a local file export.csv with headers into keyspace ks1 and table table1:

Apollo

dsbulk load -url export.csv -k ks1 -t table1 \ 
-b "path/to/secure-connect-database_name.zip" -u database_user -p database_password -header true

DSE/DDAC

dsbulk load -url export.csv -k ks1 -t table1 -h '10.200.1.3, 10.200.1.4' -header true

url can designate the path to a resource, such as a local file, or a web URL from which to read/write data.

Specify an external data source

Specify an external source of data. For DSE/DDAC, you can indicate a port for the cluster hosts:

Apollo

dsbulk load -url https://svr/data/export.csv -k ks1 -t table1 \ 
-b "path/to/secure-connect-database_name.zip" -u database_user -p database_password

DSE/DDAC

dsbulk load -url https://svr/data/export.csv -k ks1 -t table1 -h '10.200.1.3, 10.200.1.4' -port 9876

Specify a file with URLs

Specify a file that contains a list of multiple, well-formed URLs for the CSV or JSON data files to load:

Apollo

dsbulk load --connector.json.urlfile "my/local/multiple-input-data-urls.txt" -k ks1 -t table1 \ 
-b "path/to/secure-connect-database_name.zip" -u database_user -p database_password

DSE/DDAC

dsbulk load --connector.json.urlfile "my/local/multiple-input-data-urls.txt" -k ks1 -t table1 -h '10.200.1.3'

Load CSV data from stdin

Load CSV data from stdin as it is generated from a loading script generate_data. The data is loaded to the keyspace ks1 and table table1. If not specified, the field names are read from a header row in the input file.

Apollo

generate_data | dsbulk load -url stdin:/ -k ks1 -t table1 \ 
-b "path/to/secure-connect-database_name.zip" -u database_user -p database_password

DSE/DDAC

generate_data | dsbulk load -url stdin:/ -k ks1 -t table1