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 3C314C3F4 for ; Wed, 13 Jun 2012 08:53:10 +0000 (UTC) Received: (qmail 56410 invoked by uid 500); 13 Jun 2012 08:53:07 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 56229 invoked by uid 500); 13 Jun 2012 08:53:07 -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 56215 invoked by uid 99); 13 Jun 2012 08:53:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 08:53:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a81.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 08:53:00 +0000 Received: from homiemail-a81.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a81.g.dreamhost.com (Postfix) with ESMTP id 5A1ECA806B for ; Wed, 13 Jun 2012 01:52:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; q=dns; s=thelastpickle.com; b=WgSdT5gI+c bwIepdJZ67xRSRoWGT+hGIFGX6bmZ5XcdFroOJtUC0FyVSvTIl/cgpIp3E/Exp9p ZVvJmP6pu4dmaOe63er6Xo2sqZhdgHr6mj9JAyeuIjCQOkHQ+vR+O8Trmc/GdUYZ GqPfCu5KsbYvd+vurAIph64XCwb9PVNgs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; s=thelastpickle.com; bh=30UvjtCXeDpv9/qQ vUnndzls/BU=; b=1hkSW6CUPm8NEP1378Bdfa6UQ7eOKwKQEJU2UppO4wLQ8IKl xz582gwV/68Ek92R5c3gLUuYwQqaq6q2Bb7xS/jizLF/e+iriUihTmqFhRW3r2LZ pI7J7G2RBW6ClrHqR4EaOiWrvjaS/tmIy/0IihSKnjym3vRLEP1XzBl/+Eg= Received: from [172.16.1.4] (unknown [203.86.207.101]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a81.g.dreamhost.com (Postfix) with ESMTPSA id BE152A8061 for ; Wed, 13 Jun 2012 01:52:37 -0700 (PDT) From: aaron morton Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/alternative; boundary="Apple-Mail=_11E2BF75-4E23-41A5-8F6D-38C62B399B40" Subject: Re: Odd problem with cli and display of value types Date: Wed, 13 Jun 2012 20:52:33 +1200 In-Reply-To: To: user@cassandra.apache.org References: Message-Id: <8E19DAB3-0CB7-42D6-8746-507B723FDB46@thelastpickle.com> X-Mailer: Apple Mail (2.1278) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_11E2BF75-4E23-41A5-8F6D-38C62B399B40 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The set with the type casts updates the client side column meta data = with the type (just like assume does). So after the first set the client = will act as if you said assume users validator as long; In this case it's not particularly helpful. Can you add a trivial ticket = to https://issues.apache.org/jira/browse/CASSANDRA to update the example = ? Thanks ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 13/06/2012, at 3:40 AM, Holger Hoffstaette wrote: >=20 > While trying to play around with 1.1.1 and secondary indexes I just > noticed something odd in cassandra-cli. Example straight from the = README: >=20 > --> show Mr. Smith >=20 > holger>cassandra-cli > [..] > [default@Users] list users; > Using default limit of 100 > Using default column limit of 100 > ------------------- > RowKey: jsmith > =3D> (column=3Dfirst, value=3DJohn, timestamp=3D1339507271651000) > =3D> (column=3Dlast, value=3DSmith, timestamp=3D1339507280745000) >=20 > 1 Row Returned. > Elapsed time: 0 msec(s). >=20 > --> Hello Mr. Smith with no age. > --> You should be 64 years old: >=20 > [default@Users] set Users[jsmith][age] =3D long(64); > Value inserted. > Elapsed time: 16 msec(s). >=20 > [default@Users] list users; > Using default limit of 100 > Using default column limit of 100 > ------------------- > RowKey: jsmith > =3D> (column=3Dage, value=3D64, timestamp=3D1339513585914000) > =3D> (column=3Dfirst, value=3DJohn, timestamp=3D1339507271651000) > =3D> (column=3Dlast, value=3DSmith, timestamp=3D1339507280745000) >=20 > 1 Row Returned. > Elapsed time: 0 msec(s). > [default@Users] >=20 > --> That worked, as expected. Exit & restart the cli >=20 > holger>cassandra-cli > [..] > [default@Users] list users; > Using default limit of 100 > Using default column limit of 100 > ------------------- > RowKey: jsmith > =3D> (column=3Dage, value=3D @, timestamp=3D1339513585914000) > =3D> (column=3Dfirst, value=3DJohn, timestamp=3D1339507271651000) > =3D> (column=3Dlast, value=3DSmith, timestamp=3D1339507280745000) >=20 > 1 Row Returned. > Elapsed time: 78 msec(s). > [default@Users] >=20 > // age=3D@ you say? >=20 > I understand of course that since the default validation class is set = to > UTF8 I should have inserted '64' as age and not the long(64) as given = in > the README - probably an oversight/bug/typo. The README uses 42 as = value, > which results in a * as output. To verify the behaviour I used 64, = which > is the ASCII value of @. >=20 > What I find more curious is that the cli displays the value in > human-readable form immediately after insertion, yet a new session > displays it in "native" form (as it should). Should it not always = display > the value according to the validation class, i.e. show the @ = immediately > after insertion? >=20 > thanks, > Holger >=20 >=20 --Apple-Mail=_11E2BF75-4E23-41A5-8F6D-38C62B399B40 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii The = set with the type casts updates the client side column meta data with = the type (just like assume does). So after the first set the client will = act as if you said

assume users validator as = long;

In this case it's not particularly = helpful. Can you add a trivial ticket to https://issues.ap= ache.org/jira/browse/CASSANDRA to update the example = ?

Thanks


http://www.thelastpickle.com

On 13/06/2012, at 3:40 AM, Holger Hoffstaette = wrote:


While trying to play around with 1.1.1 and = secondary indexes I just
noticed something odd in cassandra-cli. = Example straight from the README:

--> show Mr. = Smith

holger>cassandra-cli
[..]
[default@Users] list = users;
Using default limit of 100
Using default column limit of = 100
-------------------
RowKey: jsmith
=3D> (column=3Dfirst, = value=3DJohn, timestamp=3D1339507271651000)
=3D> (column=3Dlast, = value=3DSmith, timestamp=3D1339507280745000)

1 Row = Returned.
Elapsed time: 0 msec(s).

--> Hello Mr. Smith with = no age.
--> You should be 64 years old:

[default@Users] set = Users[jsmith][age] =3D long(64);
Value inserted.
Elapsed time: 16 = msec(s).

[default@Users] list users;
Using default limit of = 100
Using default column limit of = 100
-------------------
RowKey: jsmith
=3D> (column=3Dage, = value=3D64, timestamp=3D1339513585914000)
=3D> (column=3Dfirst, = value=3DJohn, timestamp=3D1339507271651000)
=3D> (column=3Dlast, = value=3DSmith, timestamp=3D1339507280745000)

1 Row = Returned.
Elapsed time: 0 msec(s).
[default@Users]

--> = That worked, as expected. Exit & restart the = cli

holger>cassandra-cli
[..]
[default@Users] list = users;
Using default limit of 100
Using default column limit of = 100
-------------------
RowKey: jsmith
=3D> (column=3Dage, = value=3D       @, = timestamp=3D1339513585914000)
=3D> (column=3Dfirst, value=3DJohn, = timestamp=3D1339507271651000)
=3D> (column=3Dlast, value=3DSmith, = timestamp=3D1339507280745000)

1 Row Returned.
Elapsed time: 78 = msec(s).
[default@Users]

// age=3D@ you say?

I = understand of course that since the default validation class is set = to
UTF8 I should have inserted '64' as age and not the long(64) as = given in
the README - probably an oversight/bug/typo. The README uses = 42 as value,
which results in a * as output. To verify the behaviour = I used 64, which
is the ASCII value of @.

What I find more = curious is that the cli displays the value in
human-readable form = immediately after insertion, yet a new session
displays it in = "native" form (as it should). Should it not always display
the value = according to the validation class, i.e. show the @ immediately
after = insertion?

thanks,
Holger


= --Apple-Mail=_11E2BF75-4E23-41A5-8F6D-38C62B399B40--