Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CC78010499 for ; Wed, 3 Jul 2013 18:16:39 +0000 (UTC) Received: (qmail 85202 invoked by uid 500); 3 Jul 2013 18:16:37 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 84837 invoked by uid 500); 3 Jul 2013 18:16:37 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 84829 invoked by uid 99); 3 Jul 2013 18:16:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 18:16:36 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=FROM_12LTRDOM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of oberman@civicscience.com) Received: from [209.85.220.46] (HELO mail-pa0-f46.google.com) (209.85.220.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 18:16:30 +0000 Received: by mail-pa0-f46.google.com with SMTP id fa11so493330pad.33 for ; Wed, 03 Jul 2013 11:15:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=XFdwlstpxT7NSNTOIvcxzdfo+YllLOlSyw9dw9/AYcY=; b=HtOmDn6tvDaOTC/6fqWEVu65qlKsVSEcjjxg7qDaavZ68iQdWWMqL70P+pJCQAYSS8 79C3HefcudQb2EABsVmFPQXlTI8qLf1lL652F5U5ZrND8Eazs6r7D4DyY1MKEnwT10fN nEATdBUFU8dviVcrTGKCmcc/J6HcNp4X3rYlIJCt8fLe/l0gQZ0ccaSLKJna5I/SEEA+ ZIRoQEZaX8NaeZBCvCz6mA9Z7TbnKi8FNRzIBK499tCt4z01yqVHwhspL9z/93a1GWS8 gHj/HLUGcAQ/X96p05ddEtLOgngEKRQGs77+ebc6mriM08+rNCnuwQO8byWgZAPNe/fx uI3g== X-Received: by 10.66.246.133 with SMTP id xw5mr1251470pac.114.1372875349548; Wed, 03 Jul 2013 11:15:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.44.40 with HTTP; Wed, 3 Jul 2013 11:15:29 -0700 (PDT) X-Originating-IP: [71.206.217.47] From: William Oberman Date: Wed, 3 Jul 2013 14:15:29 -0400 Message-ID: Subject: cqlsh + existing cf's + query To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=047d7b15ad2b87fbcf04e09f73b0 X-Gm-Message-State: ALoCoQlD9/KMaDhhxQe5j3KIxbWNI7aG9fTNvzpeFJwrKu/cuOr7OvqUR4PGxnT9YrPeYfzFnZWp X-Virus-Checked: Checked by ClamAV on apache.org --047d7b15ad2b87fbcf04e09f73b0 Content-Type: text/plain; charset=ISO-8859-1 I've been running cassandra a while, and have used the PHP api and cassandra-cli, but never gave cqlsh a shot. I'm not quite getting it. My most simple CF is a dumping ground for testing things created as: create column family stats; I was putting random stats I was computing in it. All keys, column names & column values are really ascii. Using cqlsh (1.1.12, default shell so CQL 2.0 I believe), I did: USE my_keyspace_name; ASSUME stats(KEY) VALUES are text, NAMES are text, VALUES are text; SELECT * from stats LIMIT 10; Looks great. But, then I try to do: SELECT * from stats WHERE KEY='KNOWN_KEY_NAME'; I get: Bad Request: cannot parse 'KNOWN_KEY_NAME' as hex bytes If I do the hex value for KNOWN_KEY_NAME, it works. E.g. SELECT * from stats WHERE KEY='various_0-9a-f_chars'; I can't find a "TO_HEX(string)" built in function for SQL. Am I doing something wrong? DESCRIBE TABLE stats; CREATE TABLE stats ( KEY blob PRIMARY KEY ) WITH comment='' AND comparator=blob AND read_repair_chance=1.000000 AND gc_grace_seconds=864000 AND default_validation=blob AND min_compaction_threshold=4 AND max_compaction_threshold=32 AND replicate_on_write='false' AND compaction_strategy_class='SizeTieredCompactionStrategy'; --047d7b15ad2b87fbcf04e09f73b0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I've been running cassandra a while, and have used the= PHP api and cassandra-cli, but never gave cqlsh a shot.

I'm not quite getting it. =A0My most simple CF is a dumping grou= nd for testing things created as:
create column family stats;
I was putting ra= ndom stats I was computing in it. =A0All keys, column names & column va= lues are really ascii. =A0

Using cqlsh= (1.1.12, default shell so CQL 2.0 I believe), I did:
USE my_keyspace_name;
ASSUME stats(KEY) VALUES a= re text, NAMES are text, VALUES are text;
SELECT * from= stats LIMIT 10;

Looks great. =A0B= ut, then I try to do:
SELECT * from stats WHERE KEY=3D'KNOWN_KEY_NAME';

I get:
Bad Request:= cannot parse 'KNOWN_KEY_NAME' as hex bytes

If I do the hex value for KNOWN_KEY_NAME, it works. =A0E.g.
SELECT * from stats WHERE KEY=3D'various_0-9a-f_chars';
<= div style>
I can't find a "TO_HEX(string)"= ; built in=A0function=A0for SQL. =A0Am I doing something wrong?

DESCRIBE TABLE stats;
<= br>
CREATE TABLE stats (
=A0 KEY blob PRIMAR= Y KEY
) WITH
=A0 comment=3D'' AND
=A0= comparator=3Dblob AND
=A0 read_repair_chance=3D1.000000 AND
=A0 gc_grace_seconds= =3D864000 AND
=A0 default_validation=3Dblob AND
=A0 min= _compaction_threshold=3D4 AND
=A0 max_compaction_threshold=3D32 A= ND
=A0 replicate_on_write=3D'false' AND
=A0 compaction_strategy_class=3D'SizeTieredCompactionStrategy'= ;



--047d7b15ad2b87fbcf04e09f73b0--