Skip to content

Instantly share code, notes, and snippets.

@amorton
Created November 5, 2012 21:38
Show Gist options
  • Save amorton/4020500 to your computer and use it in GitHub Desktop.
Save amorton/4020500 to your computer and use it in GitHub Desktop.
CQL 3 Question
# Create a table and add data in CQL 3
CREATE TABLE UserTweets
(
tweet_id bigint,
user_name text,
body text,
timestamp timestamp,
PRIMARY KEY (user_name, tweet_id)
);
INSERT INTO
UserTweets
(tweet_id, body, user_name, timestamp)
VALUES
(1, 'The Tweet', 'fred', 1352150816917);
# Select data in CQL 3
cqlsh:cass_college> select * from UserTweets;
user_name | tweet_id | body | timestamp
-----------+----------+-----------+--------------------------
fred | 1 | The Tweet | 2012-11-06 10:26:56+1300
# Read data in CLI - ERROR
[default@cass_college] get UserTweets['fred'];
=> (column=1:body, value=The Tweet, timestamp=1352151358193000)
invalid UTF8 bytes 0000013ad2781895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment