Apache Cassandra 1.1 Documentation

SOURCE

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

Executes a file containing CQL statements.

Synopsis

SOURCE '<file>';

Description

To execute the contents of a file, specify the path of the file relative to the current directory. Enclose the file name in single quotation marks. The shorthand notation in this example is supported for referring to $HOME:

Example

SOURCE '<USER_HOME>/mydir/myfile.txt';

The output for each statement, if there is any, appears in turn, including any error messages. Errors do not abort execution of the file.

Alternatively, use the --file option to execute a file while starting CQL.

CQL Commands

CQL Commands CQL Shell Commands
ALTER TABLE ASSUME
ALTER KEYSPACE CAPTURE
BATCH COPY
CREATE TABLE DESCRIBE
CREATE INDEX EXIT
CREATE KEYSPACE SHOW
DELETE SOURCE
DROP TABLE  
DROP INDEX  
DROP KEYSPACE  
INSERT  
SELECT  
TRUNCATE  
UPDATE  
USE