blob: e717460aa58eec3f7333ca10ac9329e32789cd23 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>cqlsh: the CQL shell | Apache Cassandra Documentation</title>
<link rel="stylesheet" href="../../../../assets/css/site.css">
<link rel="schema.dcterms" href="https://purl.org/dc/terms/">
<meta name="dcterms.subject" content="Cassandra">
<meta name="dcterms.identifier" content="3.11">
<meta name="generator" content="Antora 2.3.4">
<link rel="icon" href="../../../../assets/img/favicon.ico" type="image/x-icon">
<script>
const script = document.createElement("script");
const domain = window.location.hostname;
script.type = "text/javascript";
script.src = "https://plausible.cassandra.apache.org/js/plausible.js";
script.setAttribute("data-domain",domain);
script.setAttribute("defer",'true');
script.setAttribute("async",'true');
document.getElementsByTagName("head")[0].appendChild(script);
</script> </head>
<body class="docs-wrapper article">
<div class="container mx-auto relative">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<meta property="og:type" content="website" />
<meta property="og:url" content="/" />
<meta property="og:site_name" content="Apache Cassandra" />
<header id="top-nav">
<div class="inner relative">
<div class="header-social-icons text-right">
<a href="https://twitter.com/cassandra?lang=en" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a>
<a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a>
<a href="https://www.youtube.com/c/PlanetCassandra" target="_blank" styles="margin-left: 20px;"><img src="../../../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a>
</div>
<div class="cf">
<div class="logo left"><a href="/"><img src="../../../../assets/img/logo-white-r.png" alt="Cassandra Logo"></a></div>
<div class="mobile-nav-icon right">
<img class="toggle-icon" src="../../../../assets/img/hamburger-nav.svg">
</div>
<ul class="main-nav nav-links right flex flex-vert-center flex-space-between">
<li>
<a class="nav-link hide-mobile">Get Started</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/cassandra-basics.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-basics.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Cassandra Basics
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/quickstart.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-rocket.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Quickstart
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/ecosystem.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-ecosystem.png" alt="cassandra basics icon">
</div>
<div class="sub-nav-text teal py-small">
Ecosystem
</div>
</a>
</li>
</ul>
</li>
<li><a class="nav-link" href="/doc/latest/">Documentation</a></li>
<li>
<a class="nav-link" href="/_/community.html">Community</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/community.html#code-of-conduct">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-welcome.png" alt="welcome icon">
</div>
<div class="sub-nav-text teal py-small">
Welcome
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#discussions">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-discussions.png" alt="discussions icon">
</div>
<div class="sub-nav-text teal py-small">
Discussions
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#project-governance">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-governance.png" alt="Governance icon">
</div>
<div class="sub-nav-text teal py-small">
Governance
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#how-to-contribute">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-contribute.png" alt="Contribute icon">
</div>
<div class="sub-nav-text teal py-small">
Contribute
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/community.html#meet-the-community">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-community.png" alt="Meet the Community icon">
</div>
<div class="sub-nav-text teal py-small">
Meet the Community
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/cassandra-catalyst-program.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-catalyst.png" alt="Catalyst icon">
</div>
<div class="sub-nav-text teal py-small">
Catalyst Program
</div>
</a>
</li>
<li class="pa-micro hide-mobile">
<a href="/_/events.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-events.png" alt="Events icon">
</div>
<div class="sub-nav-text teal py-small">
Events
</div>
</a>
</li>
</ul>
</li>
<li>
<a class="nav-link hide-mobile">Learn</a>
<ul class="sub-menu bg-white">
<li class="pa-micro">
<a href="/_/Apache-Cassandra-5.0-Moving-Toward-an-AI-Driven-Future.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-basics.png" alt="Basics icon">
</div>
<div class="sub-nav-text teal py-small">
Cassandra 5.0
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/case-studies.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-case-study.png" alt="Case Studies icon">
</div>
<div class="sub-nav-text teal py-small">
Case Studies
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/resources.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-resources.png" alt="Resources icon">
</div>
<div class="sub-nav-text teal py-small">
Resources
</div>
</a>
</li>
<li class="pa-micro">
<a href="/_/blog.html">
<div class="sub-nav-icon">
<img src="../../../../assets/img/sub-menu-blog.png" alt="Blog icon">
</div>
<div class="sub-nav-text teal py-small">
Blog
</div>
</a>
</li>
</ul>
</li>
<li><a class="nav-link btn btn--filled" href="/_/download.html">Download Now</a></li>
</ul>
</div>
</div>
</header>
<div class="hero hero--home grad">
<div class="eye"></div>
<div id="docs-content" class="text-center flex flex-center flex-column relative z2 ma-xlarge">
<h2>Cassandra Documentation</h2>
</div>
</div>
<div class="body px-medium py-medium container">
<div class="docs-nav-bar flex flex-space-between mb-medium">
<div id="mobile-docs-nav-burger" class="hidden">
<svg viewBox="0 0 24 24" width="36" height="36" stroke="#1c81a0" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
</div>
<div class="docs-nav-item relative">
<input id="search-input" type="text" placeholder="Search docs">
</div>
<div class="versions-wrapper">
<h4>Version:</h4>
<div class="nav-panel-explore" data-panel="explore">
<div id="version-toggle" class="context">
<span class="version">3.11</span>
</div>
<ul id="versions-list" class="components">
<li class="component">
<ul class="versions">
<li class="version is-latest">
<a href="../../../../_/index.html">master</a>
</li>
</ul>
</li>
<li class="component is-current">
<ul class="versions">
<li class="version">
<a href="../../../trunk/index.html">trunk</a>
</li>
<li class="version">
<a href="../../../5.0/index.html">5.0</a>
</li>
<li class="version is-latest">
<a href="../../../4.1/index.html">4.1</a>
</li>
<li class="version">
<a href="../../../4.0/index.html">4.0</a>
</li>
<li class="version is-current">
<a href="../../index.html">3.11</a>
</li>
</ul>
</li>
</ul>
</div>
</div> </div>
<div class="cf relative">
<nav class="nav docs-nav full-800">
<div class="nav-menu">
<ul class="nav-list">
<li class="nav-item is-active" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../../index.html">Main</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<span class="nav-line">
<a class="nav-link" href="../../../../_/glossary.html">Glossary</a>
</span>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<a class="nav-link" href="../../../../_/bugs.html">How to report bugs</a>
</span>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<a class="nav-link" href="../../../../_/contactus.html">Contact us</a>
</span>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item is-active" data-depth="0">
<ul class="nav-list">
<li class="nav-item is-current-path is-active" data-depth="1">
<span class="nav-line">
<button class="nav-toggle"></button>
<span class="nav-text">Cassandra</span>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../getting_started/index.html">Getting Started</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../getting_started/installing.html">Installing Cassandra</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../getting_started/configuring.html">Configuring Cassandra</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../getting_started/querying.html">Inserting and querying</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../getting_started/drivers.html">Client drivers</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../getting_started/production.html">Production recommendations</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../architecture/index.html">Architecture</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../architecture/overview.html">Overview</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../architecture/dynamo.html">Dynamo</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../architecture/storage_engine.html">Storage engine</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../architecture/guarantees.html">Guarantees</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../data_modeling/index.html">Data modeling</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/intro.html">Introduction</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_conceptual.html">Conceptual data modeling</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_rdbms.html">RDBMS design</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_queries.html">Defining application queries</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_logical.html">Logical data modeling</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_physical.html">Physical data modeling</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_refining.html">Evaluating and refining data models</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_schema.html">Defining database schema</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../data_modeling/data_modeling_tools.html">Cassandra data modeling tools</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../cql/index.html">Cassandra Query Language (CQL)</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/definitions.html">Definitions</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/types.html">Data types</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/ddl.html">Data definition (DDL)</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/dml.html">Data manipulation (DML)</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/operators.html">Operators</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/indexes.html">Secondary indexes</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/mvs.html">Materialized views</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/functions.html">Functions</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/json.html">JSON</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/security.html">Security</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/triggers.html">Triggers</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/appendices.html">Appendices</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/changes.html">Changes</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/SASI.html">SASI</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../cql/cql_singlefile.html">Single file of CQL information</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../configuration/index.html">Configuration</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_yaml_file.html">cassandra.yaml</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_rackdc_file.html">cassandra-rackdc.properties</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_env_sh_file.html">cassandra-env.sh</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_topo_file.html">cassandra-topologies.properties</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_cl_archive_file.html">commitlog-archiving.properties</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_logback_xml_file.html">logback.xml</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../configuration/cass_jvm_options_file.html">jvm-* files</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../operating/index.html">Operating</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="#operating/snitch.adoc">Snitches</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/topo_changes.html">Topology changes</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/repair.html">Repair</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/hints.html">Hints</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/bloom_filters.html">Bloom filters</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/compression.html">Compression</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/cdc.html">Change Data Capture (CDC)</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/backups.html">Backups</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/bulk_loading.html">Bulk loading</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/metrics.html">Metrics</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/security.html">Security</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/hardware.html">Hardware</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/audit_logging.html">Audit logging</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../operating/compaction/index.html">Compaction</a>
</span>
</li>
</ul>
</li>
<li class="nav-item is-current-path is-active" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="index.html">Tools</a>
</span>
<ul class="nav-list">
<li class="nav-item is-current-page is-active" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="cqlsh.html">cqlsh: the CQL shell</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="nodetool/nodetool.html">nodetool</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="sstable/index.html">SSTable tools</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="cassandra_stress.html">cassandra-stress</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../troubleshooting/index.html">Troubleshooting</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../troubleshooting/finding_nodes.html">Finding misbehaving nodes</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../troubleshooting/reading_logs.html">Reading Cassandra logs</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../troubleshooting/use_nodetool.html">Using nodetool</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../troubleshooting/use_tools.html">Using external tools to deep-dive</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<button class="nav-toggle"></button>
<a class="nav-link" href="../../../../_/development/index.html">Development</a>
</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/gettingstarted.html">Getting started</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/ide.html">Building and IDE integration</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/testing.html">Testing</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/patches.html">Contributing code changes</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/code_style.html">Code style</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/how_to_review.html">Review checklist</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/how_to_commit.html">How to commit</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/documentation.html">Working on documentation</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/ci.html">Jenkins CI environment</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/dependencies.html">Dependency management</a>
</span>
</li>
<li class="nav-item" data-depth="3">
<span class="nav-line">
<a class="nav-link" href="../../../../_/development/release_process.html">Release process</a>
</span>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<a class="nav-link" href="../faq/index.html">FAQ</a>
</span>
</li>
<li class="nav-item" data-depth="2">
<span class="nav-line">
<a class="nav-link" href="../plugins/index.html">Plug-ins</a>
</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<aside class="toc sidebar">
<div class="toc-menu"></div>
</aside>
<main class="article default-main full-800" data-ceiling="topbar">
<div class="article-banner">
<p>A newer version of this documentation is available.</p>
<a class="btn" href="../../../4.1/cassandra/tools/cqlsh.html">View Latest</a>
</div>
<div class="article-header">
<nav class="crumbs" aria-label="breadcrumbs">
<ul>
<li class="crumb">Cassandra</li>
<li class="crumb"><a href="index.html">Tools</a></li>
<li class="crumb"><a href="cqlsh.html">cqlsh: the CQL shell</a></li>
</ul>
</nav>
<div class="tools" role="navigation">
<ul>
<li class="tool edit"><a href="file:///home/jenkins/working/cassandra/doc/modules/cassandra/pages/tools/cqlsh.adoc" title="Edit Page" target="_blank" rel="noopener">Edit</a></li>
</ul>
</div>
</div>
<article class="doc">
<h1 class="page">cqlsh: the CQL shell</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><code>cqlsh</code> is a command-line interface for interacting with Cassandra using CQL (the Cassandra Query Language).
It is shipped with every Cassandra package, and can be found in the bin/ directory alongside the cassandra
executable.
<code>cqlsh</code> is implemented with the Python native protocol driver, and connects to the single specified node.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="compatibility"><a class="anchor" href="#compatibility"></a><a class="link" href="#compatibility">Compatibility</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p><code>cqlsh</code> is compatible with Python 2.7.</p>
</div>
<div class="paragraph">
<p>In general, a given version of <code>cqlsh</code> is only guaranteed to work with the
version of Cassandra that it was released with.
In some cases, <code>cqlsh</code> may work with older or newer versions of Cassandra, but this is not
officially supported.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="optional-dependencies"><a class="anchor" href="#optional-dependencies"></a><a class="link" href="#optional-dependencies">Optional Dependencies</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p><code>cqlsh</code> ships with all essential dependencies. However, there are some
optional dependencies that can be installed to improve the capabilities
of <code>cqlsh</code>.</p>
</div>
<div class="sect2">
<h3 id="pytz"><a class="anchor" href="#pytz"></a><a class="link" href="#pytz">pytz</a></h3>
<div class="paragraph">
<p>By default, <code>cqlsh</code> displays all timestamps with a UTC timezone.
To support display of timestamps with another timezone, install
the <a href="http://pytz.sourceforge.net/">pytz</a> library.
See the <code>timezone</code> option in <a href="#cql/tools/cqlsh.adoc#cqlshrc" class="page unresolved">cqlshrc</a> for specifying a timezone to
use.</p>
</div>
</div>
<div class="sect2">
<h3 id="cython"><a class="anchor" href="#cython"></a><a class="link" href="#cython">cython</a></h3>
<div class="paragraph">
<p>The performance of cqlsh&#8217;s <code>COPY</code> operations can be improved by
installing <a href="http://cython.org/">cython</a>. This will compile the python
modules that are central to the performance of <code>COPY</code>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="cqlshrc"><a class="anchor" href="#cqlshrc"></a><a class="link" href="#cqlshrc">cqlshrc</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>cqlshrc</code> file holds configuration options for <code>cqlsh</code>.
By default, the file is locagted the user&#8217;s home directory at <code>~/.cassandra/cqlsh</code>, but a
custom location can be specified with the <code>--cqlshrc</code> option.</p>
</div>
<div class="paragraph">
<p>Example config values and documentation can be found in the
<code>conf/cqlshrc.sample</code> file of a tarball installation.
You can also view the latest version of the
<a href="https://github.com/apache/cassandra/blob/trunk/conf/cqlshrc.sample">cqlshrc file online</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="command-line-options"><a class="anchor" href="#command-line-options"></a><a class="link" href="#command-line-options">Command Line Options</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Usage:</p>
</div>
<div class="paragraph">
<p><code>cqlsh [options] [host [port]]</code></p>
</div>
<div class="paragraph">
<p>Options:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>-C</code> <code>--color</code></dt>
<dd>
<p>Force color output</p>
</dd>
<dt class="hdlist1"><code>--no-color</code></dt>
<dd>
<p>Disable color output</p>
</dd>
<dt class="hdlist1"><code>--browser</code></dt>
<dd>
<p>Specify the browser to use for displaying cqlsh help. This can be one
of the <a href="https://docs.python.org/2/library/webbrowser.html">supported
browser names</a> (e.g. <code>firefox</code>) or a browser path followed by <code>%s</code>
(e.g. <code>/usr/bin/google-chrome-stable %s</code>).</p>
</dd>
<dt class="hdlist1"><code>--ssl</code></dt>
<dd>
<p>Use SSL when connecting to Cassandra</p>
</dd>
<dt class="hdlist1"><code>-u</code> <code>--user</code></dt>
<dd>
<p>Username to authenticate against Cassandra with</p>
</dd>
<dt class="hdlist1"><code>-p</code> <code>--password</code></dt>
<dd>
<p>Password to authenticate against Cassandra with, should be used in
conjunction with <code>--user</code></p>
</dd>
<dt class="hdlist1"><code>-k</code> <code>--keyspace</code></dt>
<dd>
<p>Keyspace to authenticate to, should be used in conjunction with
<code>--user</code></p>
</dd>
<dt class="hdlist1"><code>-f</code> <code>--file</code></dt>
<dd>
<p>Execute commands from the given file, then exit</p>
</dd>
<dt class="hdlist1"><code>--debug</code></dt>
<dd>
<p>Print additional debugging information</p>
</dd>
<dt class="hdlist1"><code>--encoding</code></dt>
<dd>
<p>Specify a non-default encoding for output (defaults to UTF-8)</p>
</dd>
<dt class="hdlist1"><code>--cqlshrc</code></dt>
<dd>
<p>Specify a non-default location for the <code>cqlshrc</code> file</p>
</dd>
<dt class="hdlist1"><code>-e</code> <code>--execute</code></dt>
<dd>
<p>Execute the given statement, then exit</p>
</dd>
<dt class="hdlist1"><code>--connect-timeout</code></dt>
<dd>
<p>Specify the connection timeout in seconds (defaults to 2s)</p>
</dd>
<dt class="hdlist1"><code>--python /path/to/python</code></dt>
<dd>
<p>Specify the full path to Python interpreter to override default on
systems with multiple interpreters installed</p>
</dd>
<dt class="hdlist1"><code>--request-timeout</code></dt>
<dd>
<p>Specify the request timeout in seconds (defaults to 10s)</p>
</dd>
<dt class="hdlist1"><code>-t</code> <code>--tty</code></dt>
<dd>
<p>Force tty mode (command prompt)</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect1">
<h2 id="special-commands"><a class="anchor" href="#special-commands"></a><a class="link" href="#special-commands">Special Commands</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>In addition to supporting regular CQL statements, <code>cqlsh</code> also supports a
number of special commands that are not part of CQL. These are detailed
below.</p>
</div>
<div class="sect2">
<h3 id="consistency"><a class="anchor" href="#consistency"></a><a class="link" href="#consistency"><code>CONSISTENCY</code></a></h3>
<div class="paragraph">
<p><code>Usage</code>: <code>CONSISTENCY &lt;consistency level&gt;</code></p>
</div>
<div class="paragraph">
<p>Sets the consistency level for operations to follow. Valid arguments
include:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>ANY</code></p>
</li>
<li>
<p><code>ONE</code></p>
</li>
<li>
<p><code>TWO</code></p>
</li>
<li>
<p><code>THREE</code></p>
</li>
<li>
<p><code>QUORUM</code></p>
</li>
<li>
<p><code>ALL</code></p>
</li>
<li>
<p><code>LOCAL_QUORUM</code></p>
</li>
<li>
<p><code>LOCAL_ONE</code></p>
</li>
<li>
<p><code>SERIAL</code></p>
</li>
<li>
<p><code>LOCAL_SERIAL</code></p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="serial-consistency"><a class="anchor" href="#serial-consistency"></a><a class="link" href="#serial-consistency"><code>SERIAL CONSISTENCY</code></a></h3>
<div class="paragraph">
<p><code>Usage</code>: <code>SERIAL CONSISTENCY &lt;consistency level&gt;</code></p>
</div>
<div class="paragraph">
<p>Sets the serial consistency level for operations to follow. Valid
arguments include:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>SERIAL</code></p>
</li>
<li>
<p><code>LOCAL_SERIAL</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The serial consistency level is only used by conditional updates
(<code>INSERT</code>, <code>UPDATE</code> and <code>DELETE</code> with an <code>IF</code> condition). For those, the
serial consistency level defines the consistency level of the serial
phase (or “paxos” phase) while the normal consistency level defines the
consistency for the “learn” phase, i.e. what type of reads will be
guaranteed to see the update right away. For example, if a conditional
write has a consistency level of <code>QUORUM</code> (and is successful), then a
<code>QUORUM</code> read is guaranteed to see that write. But if the regular
consistency level of that write is <code>ANY</code>, then only a read with a
consistency level of <code>SERIAL</code> is guaranteed to see it (even a read with
consistency <code>ALL</code> is not guaranteed to be enough).</p>
</div>
</div>
<div class="sect2">
<h3 id="show-version"><a class="anchor" href="#show-version"></a><a class="link" href="#show-version"><code>SHOW VERSION</code></a></h3>
<div class="paragraph">
<p>Prints the <code>cqlsh</code>, Cassandra, CQL, and native protocol versions in use.
Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">cqlsh&gt; SHOW VERSION
[cqlsh 5.0.1 | Cassandra 3.8 | CQL spec 3.4.2 | Native protocol v4]</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="show-host"><a class="anchor" href="#show-host"></a><a class="link" href="#show-host"><code>SHOW HOST</code></a></h3>
<div class="paragraph">
<p>Prints the IP address and port of the Cassandra node that <code>cqlsh</code> is
connected to in addition to the cluster name. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">cqlsh&gt; SHOW HOST
Connected to Prod_Cluster at 192.0.0.1:9042.</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="show-session"><a class="anchor" href="#show-session"></a><a class="link" href="#show-session"><code>SHOW SESSION</code></a></h3>
<div class="paragraph">
<p>Pretty prints a specific tracing session.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>: <code>SHOW SESSION &lt;session id&gt;</code></p>
</div>
<div class="paragraph">
<p>Example usage:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">cqlsh&gt; SHOW SESSION 95ac6470-327e-11e6-beca-dfb660d92ad8
Tracing session: 95ac6470-327e-11e6-beca-dfb660d92ad8
activity | timestamp | source | source_elapsed | client
-----------------------------------------------------------+----------------------------+-----------+----------------+-----------
Execute CQL3 query | 2016-06-14 17:23:13.979000 | 127.0.0.1 | 0 | 127.0.0.1
Parsing SELECT * FROM system.local; [SharedPool-Worker-1] | 2016-06-14 17:23:13.982000 | 127.0.0.1 | 3843 | 127.0.0.1
...</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="source"><a class="anchor" href="#source"></a><a class="link" href="#source"><code>SOURCE</code></a></h3>
<div class="paragraph">
<p>Reads the contents of a file and executes each line as a CQL statement
or special cqlsh command.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>: <code>SOURCE &lt;string filename&gt;</code></p>
</div>
<div class="paragraph">
<p>Example usage:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">cqlsh&gt; SOURCE '/home/calvinhobbs/commands.cql'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="capture"><a class="anchor" href="#capture"></a><a class="link" href="#capture"><code>CAPTURE</code></a></h3>
<div class="paragraph">
<p>Begins capturing command output and appending it to a specified file.
Output will not be shown at the console while it is captured.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">CAPTURE '&lt;file&gt;';
CAPTURE OFF;
CAPTURE;</code></pre>
</div>
</div>
<div class="paragraph">
<p>That is, the path to the file to be appended to must be given inside a
string literal. The path is interpreted relative to the current working
directory. The tilde shorthand notation (<code>'~/mydir'</code>) is supported for
referring to <code>$HOME</code>.</p>
</div>
<div class="paragraph">
<p>Only query result output is captured. Errors and output from cqlsh-only
commands will still be shown in the cqlsh session.</p>
</div>
<div class="paragraph">
<p>To stop capturing output and show it in the cqlsh session again, use
<code>CAPTURE OFF</code>.</p>
</div>
<div class="paragraph">
<p>To inspect the current capture configuration, use <code>CAPTURE</code> with no
arguments.</p>
</div>
</div>
<div class="sect2">
<h3 id="help"><a class="anchor" href="#help"></a><a class="link" href="#help"><code>HELP</code></a></h3>
<div class="paragraph">
<p>Gives information about cqlsh commands. To see available topics, enter
<code>HELP</code> without any arguments. To see help on a topic, use
<code>HELP &lt;topic&gt;</code>. Also see the <code>--browser</code> argument for controlling what
browser is used to display help.</p>
</div>
</div>
<div class="sect2">
<h3 id="tracing"><a class="anchor" href="#tracing"></a><a class="link" href="#tracing"><code>TRACING</code></a></h3>
<div class="paragraph">
<p>Enables or disables tracing for queries. When tracing is enabled, once a
query completes, a trace of the events during the query will be printed.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">TRACING ON
TRACING OFF</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="paging"><a class="anchor" href="#paging"></a><a class="link" href="#paging"><code>PAGING</code></a></h3>
<div class="paragraph">
<p>Enables paging, disables paging, or sets the page size for read queries.
When paging is enabled, only one page of data will be fetched at a time
and a prompt will appear to fetch the next page. Generally, it&#8217;s a good
idea to leave paging enabled in an interactive session to avoid fetching
and printing large amounts of data at once.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">PAGING ON
PAGING OFF
PAGING &lt;page size in rows&gt;</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="expand"><a class="anchor" href="#expand"></a><a class="link" href="#expand"><code>EXPAND</code></a></h3>
<div class="paragraph">
<p>Enables or disables vertical printing of rows. Enabling <code>EXPAND</code> is
useful when many columns are fetched, or the contents of a single column
are large.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">EXPAND ON
EXPAND OFF</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="login"><a class="anchor" href="#login"></a><a class="link" href="#login"><code>LOGIN</code></a></h3>
<div class="paragraph">
<p>Authenticate as a specified Cassandra user for the current session.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">LOGIN &lt;username&gt; [&lt;password&gt;]</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="exit"><a class="anchor" href="#exit"></a><a class="link" href="#exit"><code>EXIT</code></a></h3>
<div class="paragraph">
<p>Ends the current session and terminates the cqlsh process.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">EXIT
QUIT</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="clear"><a class="anchor" href="#clear"></a><a class="link" href="#clear"><code>CLEAR</code></a></h3>
<div class="paragraph">
<p>Clears the console.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">CLEAR
CLS</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="describe"><a class="anchor" href="#describe"></a><a class="link" href="#describe"><code>DESCRIBE</code></a></h3>
<div class="paragraph">
<p>Prints a description (typically a series of DDL statements) of a schema
element or the cluster. This is useful for dumping all or portions of
the schema.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">DESCRIBE CLUSTER
DESCRIBE SCHEMA
DESCRIBE KEYSPACES
DESCRIBE KEYSPACE &lt;keyspace name&gt;
DESCRIBE TABLES
DESCRIBE TABLE &lt;table name&gt;
DESCRIBE INDEX &lt;index name&gt;
DESCRIBE MATERIALIZED VIEW &lt;view name&gt;
DESCRIBE TYPES
DESCRIBE TYPE &lt;type name&gt;
DESCRIBE FUNCTIONS
DESCRIBE FUNCTION &lt;function name&gt;
DESCRIBE AGGREGATES
DESCRIBE AGGREGATE &lt;aggregate function name&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>In any of the commands, <code>DESC</code> may be used in place of <code>DESCRIBE</code>.</p>
</div>
<div class="paragraph">
<p>The <code>DESCRIBE CLUSTER</code> command prints the cluster name and partitioner:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">cqlsh&gt; DESCRIBE CLUSTER
Cluster: Test Cluster
Partitioner: Murmur3Partitioner</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <code>DESCRIBE SCHEMA</code> command prints the DDL statements needed to
recreate the entire schema. This is especially useful for dumping the
schema in order to clone a cluster or restore from a backup.</p>
</div>
</div>
<div class="sect2">
<h3 id="copy-to"><a class="anchor" href="#copy-to"></a><a class="link" href="#copy-to"><code>COPY TO</code></a></h3>
<div class="paragraph">
<p>Copies data from a table to a CSV file.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">COPY &lt;table name&gt; [(&lt;column&gt;, ...)] TO &lt;file name&gt; WITH &lt;copy option&gt; [AND &lt;copy option&gt; ...]</code></pre>
</div>
</div>
<div class="paragraph">
<p>If no columns are specified, all columns from the table will be copied
to the CSV file. A subset of columns to copy may be specified by adding
a comma-separated list of column names surrounded by parenthesis after
the table name.</p>
</div>
<div class="paragraph">
<p>The <code>&lt;file name&gt;</code> should be a string literal (with single quotes)
representing a path to the destination file. This can also the special
value <code>STDOUT</code> (without single quotes) to print the CSV to stdout.</p>
</div>
<div class="paragraph">
<p>See <code>shared-copy-options</code> for options that apply to both <code>COPY TO</code> and
<code>COPY FROM</code>.</p>
</div>
<div class="sect3">
<h4 id="options-for-copy-to"><a class="anchor" href="#options-for-copy-to"></a><a class="link" href="#options-for-copy-to">Options for <code>COPY TO</code></a></h4>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>MAXREQUESTS</code></dt>
<dd>
<p>The maximum number token ranges to fetch simultaneously. Defaults to
6.</p>
</dd>
<dt class="hdlist1"><code>PAGESIZE</code></dt>
<dd>
<p>The number of rows to fetch in a single page. Defaults to 1000.</p>
</dd>
<dt class="hdlist1"><code>PAGETIMEOUT</code></dt>
<dd>
<p>By default the page timeout is 10 seconds per 1000 entries in the page
size or 10 seconds if pagesize is smaller.</p>
</dd>
<dt class="hdlist1"><code>BEGINTOKEN</code>, <code>ENDTOKEN</code></dt>
<dd>
<p>Token range to export. Defaults to exporting the full ring.</p>
</dd>
<dt class="hdlist1"><code>MAXOUTPUTSIZE</code></dt>
<dd>
<p>The maximum size of the output file measured in number of lines;
beyond this maximum the output file will be split into segments. -1
means unlimited, and is the default.</p>
</dd>
<dt class="hdlist1"><code>ENCODING</code></dt>
<dd>
<p>The encoding used for characters. Defaults to <code>utf8</code>.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect2">
<h3 id="copy-from"><a class="anchor" href="#copy-from"></a><a class="link" href="#copy-from"><code>COPY FROM</code></a></h3>
<div class="paragraph">
<p>Copies data from a CSV file to table.</p>
</div>
<div class="paragraph">
<p><code>Usage</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs" data-lang="none">COPY &lt;table name&gt; [(&lt;column&gt;, ...)] FROM &lt;file name&gt; WITH &lt;copy option&gt; [AND &lt;copy option&gt; ...]</code></pre>
</div>
</div>
<div class="paragraph">
<p>If no columns are specified, all columns from the CSV file will be
copied to the table. A subset of columns to copy may be specified by
adding a comma-separated list of column names surrounded by parenthesis
after the table name.</p>
</div>
<div class="paragraph">
<p>The <code>&lt;file name&gt;</code> should be a string literal (with single quotes)
representing a path to the source file. This can also the special value
<code>STDIN</code> (without single quotes) to read the CSV data from stdin.</p>
</div>
<div class="paragraph">
<p>See <code>shared-copy-options</code> for options that apply to both <code>COPY TO</code> and
<code>COPY FROM</code>.</p>
</div>
<div class="sect3">
<h4 id="options-for-copy-to-2"><a class="anchor" href="#options-for-copy-to-2"></a><a class="link" href="#options-for-copy-to-2">Options for <code>COPY TO</code></a></h4>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>INGESTRATE</code></dt>
<dd>
<p>The maximum number of rows to process per second. Defaults to 100000.</p>
</dd>
<dt class="hdlist1"><code>MAXROWS</code></dt>
<dd>
<p>The maximum number of rows to import. -1 means unlimited, and is the
default.</p>
</dd>
<dt class="hdlist1"><code>SKIPROWS</code></dt>
<dd>
<p>A number of initial rows to skip. Defaults to 0.</p>
</dd>
<dt class="hdlist1"><code>SKIPCOLS</code></dt>
<dd>
<p>A comma-separated list of column names to ignore. By default, no
columns are skipped.</p>
</dd>
<dt class="hdlist1"><code>MAXPARSEERRORS</code></dt>
<dd>
<p>The maximum global number of parsing errors to ignore. -1 means
unlimited, and is the default.</p>
</dd>
<dt class="hdlist1"><code>MAXINSERTERRORS</code></dt>
<dd>
<p>The maximum global number of insert errors to ignore. -1 means
unlimited. The default is 1000.</p>
</dd>
<dt class="hdlist1"><code>ERRFILE</code> =</dt>
<dd>
<p>A file to store all rows that could not be imported, by default this
is <code>import_&lt;ks&gt;_&lt;table&gt;.err</code> where <code>&lt;ks&gt;</code> is your keyspace and
<code>&lt;table&gt;</code> is your table name.</p>
</dd>
<dt class="hdlist1"><code>MAXBATCHSIZE</code></dt>
<dd>
<p>The max number of rows inserted in a single batch. Defaults to 20.</p>
</dd>
<dt class="hdlist1"><code>MINBATCHSIZE</code></dt>
<dd>
<p>The min number of rows inserted in a single batch. Defaults to 2.</p>
</dd>
<dt class="hdlist1"><code>CHUNKSIZE</code></dt>
<dd>
<p>The number of rows that are passed to child worker processes from the
main process at a time. Defaults to 1000.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<h4 id="shared-copy-options"><a class="anchor" href="#shared-copy-options"></a><a class="link" href="#shared-copy-options">Shared COPY Options</a></h4>
<div class="paragraph">
<p>Options that are common to both <code>COPY TO</code> and <code>COPY FROM</code>.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>NULLVAL</code></dt>
<dd>
<p>The string placeholder for null values. Defaults to <code>null</code>.</p>
</dd>
<dt class="hdlist1"><code>HEADER</code></dt>
<dd>
<p>For <code>COPY TO</code>, controls whether the first line in the CSV output file
will contain the column names. For COPY FROM, specifies whether the
first line in the CSV input file contains column names. Defaults to
<code>false</code>.</p>
</dd>
<dt class="hdlist1"><code>DECIMALSEP</code></dt>
<dd>
<p>The character that is used as the decimal point separator. Defaults to
<code>.</code>.</p>
</dd>
<dt class="hdlist1"><code>THOUSANDSSEP</code></dt>
<dd>
<p>The character that is used to separate thousands. Defaults to the
empty string.</p>
</dd>
<dt class="hdlist1"><code>BOOLSTYlE</code></dt>
<dd>
<p>The string literal format for boolean values. Defaults to
<code>True,False</code>.</p>
</dd>
<dt class="hdlist1"><code>NUMPROCESSES</code></dt>
<dd>
<p>The number of child worker processes to create for <code>COPY</code> tasks.
Defaults to a max of 4 for <code>COPY FROM</code> and 16 for <code>COPY TO</code>. However,
at most (num_cores - 1) processes will be created.</p>
</dd>
<dt class="hdlist1"><code>MAXATTEMPTS</code></dt>
<dd>
<p>The maximum number of failed attempts to fetch a range of data (when
using <code>COPY TO</code>) or insert a chunk of data (when using <code>COPY FROM</code>)
before giving up. Defaults to 5.</p>
</dd>
<dt class="hdlist1"><code>REPORTFREQUENCY</code></dt>
<dd>
<p>How often status updates are refreshed, in seconds. Defaults to 0.25.</p>
</dd>
<dt class="hdlist1"><code>RATEFILE</code></dt>
<dd>
<p>An optional file to output rate statistics to. By default, statistics
are not output to a file.</p>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</article>
</main>
</div>
</div>
<footer class="grad grad--two flex-center pb-xlarge">
<div class="inner text-center z2 relative">
<h2 class="white py-small">Get started with Cassandra, fast.</h2>
<a id="footer-cta" href="/_/quickstart.html" class="btn btn--filled ma-medium">Quickstart Guide</a>
</div>
<div class="inner flex flex-distribute-items mt-xlarge z2 relative">
<div class="col-2">
<div id="footer-logo" class="logo logo--footer mb-medium"><img src="../../../../assets/img/logo-white-r.png" alt="Cassandra Logo"></div>
<p>Apache Cassandra<img src="../../../../assets/img/registered.svg" alt="®" style="width:18px;"> powers mission-critical deployments with improved performance and unparalleled levels of scale in the cloud.</p>
<div class="footer-social-icons">
<a href="https://twitter.com/cassandra?lang=en" target="_blank"><img src="../../../../assets/img/twitter-icon-circle-white.svg" alt="twitter icon" width="24"></a>
<a href="https://www.linkedin.com/company/apache-cassandra/" target="_blank"><img src="../../../../assets/img/LI-In-Bug.png" alt="linked-in icon" width="24"></a>
<a href="https://www.youtube.com/c/PlanetCassandra" target="_blank"><img src="../../../../assets/img/youtube-icon.png" alt="youtube icon" width="24"></a>
</div>
</div>
<div class="col-2 flex flex-center">
<ul class="columns-2">
<li class="mb-small"><a href="/">Home</a></li>
<li class="mb-small"><a href="/_/cassandra-basics.html">Cassandra Basics</a></li>
<li class="mb-small"><a href="/_/quickstart.html">Quickstart</a></li>
<li class="mb-small"><a href="/_/ecosystem.html">Ecosystem</a></li>
<li class="mb-small"><a href="/doc/latest/">Documentation</a></li>
<li class="mb-small"><a href="/_/community.html">Community</a></li>
<li class="mb-small"><a href="/_/case-studies.html">Case Studies</a></li>
<li class="mb-small"><a href="/_/resources.html">Resources</a></li>
<li class="mb-small"><a href="/_/blog.html">Blog</a></li>
</ul>
</div>
</div>
</footer>
<div class="lower-footer bg-white pa-medium">
<div class="flex flex-row flex-vert-center">
<div class="pr-medium"><img src="../../../../assets/img//feather-small.png" alt="ASF" width="20"></div>
<div class="pr-medium"><a href="http://www.apache.org/" target="_blank">Foundation</a></div>
<div class="pr-medium"><a href="https://www.apache.org/events/current-event.html" target="_blank">Events</a></div>
<div class="pr-medium"><a href="https://www.apache.org/licenses/" target="_blank">License</a></div>
<div class="pr-medium"><a href="https://www.apache.org/foundation/thanks" target="_blank">Thanks</a></div>
<div class="pr-medium"><a href="https://www.apache.org/security" target="_blank">Security</a></div>
<div class="pr-medium"><a href="https://privacy.apache.org/policies/privacy-policy-public.html" target="_blank">Privacy</a></div>
<div class="pr-medium"><a href="https://www.apache.org/foundation/sponsorship" target="_blank">Sponsorship</a></div>
</div>
<p class="my-medium">© 2009-<script>document.write(new Date().getFullYear())</script> <a href="https://apache.org" target="_blank">The Apache Software Foundation</a> under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation.</p>
</div>
<div id="fade" class="hidden"></div>
<div id="modal" class="hidden">
<div id="close-modal" class="cursor-pointer"><svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" class="css-i6dzq1"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></div>
<div id="mod-content" class="vid-mod-content resp-container"></div>
</div>
<script src="../../../../assets/js/site.js"></script>
<script async src="../../../../assets/js/vendor/highlight.js"></script>
<script src="../../../../assets/js/vendor/lunr.js"></script>
<script src="../../../../assets/js/vendor/search.js" id="search-script" data-base-path="../../../.." data-page-path="/Cassandra/3.11/cassandra/tools/cqlsh.html"></script>
<script async src="../../../../assets/../search-index.js"></script>
<script>
jQuery(function(){
var windowW = $(window).width();
$(document)
.on('click','.mobile-nav-icon',function(){
$('.main-nav').fadeIn();
})
.on('click','.main-nav',function(){
if(windowW <= 1000){
$(this).fadeOut();
}
})
.on('click','#version-toggle',function(){
$(this).toggleClass('active');
$(this).next().fadeToggle();
})
.on('click','#mobile-docs-nav-burger', function(){
$(this).toggleClass('active');
$('.docs-nav').toggleClass('active');
});
var url = window.location.pathname;
var isQuickstart = url.includes('quickstart.html');
if(isQuickstart){
var footerCTA = document.getElementById('footer-cta');
footerCTA.innerHTML = 'Get latest updates';
footerCTA.setAttribute('href', '/_/blog.html');
}
});
</script>
</div>
</body>
</html>