Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Tutorial: Loading data into Amazon Keyspaces using cqlsh

Focus mode
Tutorial: Loading data into Amazon Keyspaces using cqlsh - Amazon Keyspaces (for Apache Cassandra)

This tutorial guides you through the process of migrating data from Apache Cassandra to Amazon Keyspaces using the cqlsh COPY FROM command. The cqlsh COPY FROM command is useful to quickly and easily upload small datasets to Amazon Keyspaces for academic or test purposes. For more information about how to migrate production workloads, see Offline migration process: Apache Cassandra to Amazon Keyspaces. In this tutorial, you'll complete the following steps:

Prerequisites – Set up an AWS account with credentials, create a JKS trust store file for the certificate, and configure cqlsh to connect to Amazon Keyspaces.

  1. Create source CSV and target table – Prepare a CSV file as the source data and create the target keyspace and table in Amazon Keyspaces.

  2. Prepare the data – Randomize the data in the CSV file and analyze it to determine the average and maximum row sizes.

  3. Set throughput capacity – Calculate the required write capacity units (WCUs) based on the data size and desired load time, and configure the table's provisioned capacity.

  4. Configure cqlsh parameters – Determine optimal values for cqlsh COPY FROM parameters like INGESTRATE, NUMPROCESSES, MAXBATCHSIZE, and CHUNKSIZE to distribute the workload evenly.

  5. Run the cqlsh COPY FROM command – Run the cqlsh COPY FROM command to upload the data from the CSV file to the Amazon Keyspaces table, and monitor the progress.

Troubleshooting – Resolve common issues like invalid requests, parser errors, capacity errors, and cqlsh errors during the data upload process.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.