cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cathy Daw (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-2545) CQL: Syntax error performing batch updates
Date Sat, 23 Apr 2011 00:56:05 GMT
CQL: Syntax error performing batch updates
------------------------------------------

                 Key: CASSANDRA-2545
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2545
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 0.8 beta 1
            Reporter: Cathy Daw


*CQL Test Case*
{code}
//TEST CASE #1
BEGIN BATCH
UPDATE users SET gender = 'm', birth_year = '1981' WHERE KEY = 'user1';
UPDATE users SET gender = 'm', birth_year = '1982' WHERE KEY = 'user2';
UPDATE users SET gender = 'm', birth_year = '1983' WHERE KEY = 'user3';
APPLY BATCH	

//TEST CASE #2
BEGIN BATCH USING CONSISTENCY ZERO
UPDATE users SET state = 'TX' WHERE KEY = 'user1';
UPDATE users SET state = 'TX' WHERE KEY = 'user2';
UPDATE users SET state = 'TX' WHERE KEY = 'user3';

//ERROR
Bad Request: line 0:-1 mismatched input '<EOF>' expecting K_APPLY

APPLY BATCH	
{code}

*Test Setup*
{code}
CREATE COLUMNFAMILY users (
  KEY varchar PRIMARY KEY,
  password varchar,
  gender varchar,
  session_token varchar,
  state varchar,
  birth_year bigint);

INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3',
'f', 'CA', '1971');
INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user2', 'ch@ngem3',
'f', 'CA', '1972');
INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user3', 'ch@ngem3',
'f', 'CA', '1973');
{code}

*Documented Syntax*
{panel}
BEGIN BATCH [USING <CONSISTENCY>]
UPDATE CF1 SET name1 = value1, name2 = value2 WHERE KEY = keyname1;
UPDATE CF1 SET name3 = value3 WHERE KEY = keyname2;
UPDATE CF2 SET name4 = value4, name5 = value5 WHERE KEY = keyname3;
APPLY BATCH
{panel}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message