Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EBA3D10F79 for ; Mon, 7 Oct 2013 20:32:44 +0000 (UTC) Received: (qmail 65452 invoked by uid 500); 7 Oct 2013 20:32:44 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 65319 invoked by uid 500); 7 Oct 2013 20:32:44 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 65300 invoked by uid 99); 7 Oct 2013 20:32:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Oct 2013 20:32:42 +0000 Date: Mon, 7 Oct 2013 20:32:42 +0000 (UTC) From: "Brandon Williams (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6102) CassandraStorage broken for bigints and ints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13788529#comment-13788529 ] Brandon Williams commented on CASSANDRA-6102: --------------------------------------------- This part: {noformat} + // Don't want to create another TBase class, so use CfDef.populate_io_cache_on_flush + // to store flag of compact storage cql table. + if (cql3Table && !(parseType(cfDef.comparator_type) instanceof AbstractCompositeType)) + cfDef.setPopulate_io_cache_on_flush(true); + + // Don't want to create another TBase class, so use CfDef.replicate_on_write + // to store flag of cql table. + if (cql3Table) + cfDef.setReplicate_on_write(true); {noformat} Feels like a hack that is going to bite us down the road when those options really do get removed. > CassandraStorage broken for bigints and ints > -------------------------------------------- > > Key: CASSANDRA-6102 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6102 > Project: Cassandra > Issue Type: Bug > Components: Hadoop > Environment: Cassandra 1.2.9 & 1.2.10, Pig 0.11.1, OSX 10.8.x > Reporter: Janne Jalkanen > Assignee: Alex Liu > Attachments: 6102-1.2-branch.txt > > > I am seeing something rather strange in the way Cass 1.2 + Pig seem to handle integer values. > Setup: Cassandra 1.2.10, OSX 10.8, JDK 1.7u40, Pig 0.11.1. Single node for testing this. > First a table: > {noformat} > > CREATE TABLE testc ( > key text PRIMARY KEY, > ivalue int, > svalue text, > value bigint > ) WITH COMPACT STORAGE; > > insert into testc (key,ivalue,svalue,value) values ('foo',10,'bar',65); > > select * from testc; > key | ivalue | svalue | value > -----+--------+--------+------- > foo | 10 | bar | 65 > {noformat} > For my Pig setup, I then use libraries from different C* versions to actually talk to my database (which stays on 1.2.10 all the time). > Cassandra 1.0.12 (using cassandra_storage.jar): > {noformat} > testc = LOAD 'cassandra://keyspace/testc' USING CassandraStorage(); > dump testc > (foo,(svalue,bar),(ivalue,10),(value,65),{}) > {noformat} > Cassandra 1.1.10: > {noformat} > testc = LOAD 'cassandra://keyspace/testc' USING CassandraStorage(); > dump testc > (foo,(svalue,bar),(ivalue,10),(value,65),{}) > {noformat} > Cassandra 1.2.10: > {noformat} > (testc = LOAD 'cassandra://keyspace/testc' USING CassandraStorage(); > dump testc > foo,{(ivalue, > ),(svalue,bar),(value,A)}) > {noformat} > To me it appears that ints and bigints are interpreted as ascii values in cass 1.2.10. Did something change for CassandraStorage, is there a regression, or am I doing something wrong? Quick perusal of the JIRA didn't reveal anything that I could directly pin on this. > Note that using compact storage does not seem to affect the issue, though it obviously changes the resulting pig format. > In addition, trying to use Pygmalion > {noformat} > tf = foreach testc generate key, flatten(FromCassandraBag('ivalue,svalue,value',columns)) as (ivalue:int,svalue:chararray,lvalue:long); > dump tf > (foo, > ,bar,A) > {noformat} > So no help there. Explicitly casting the values to (long) or (int) just results in a ClassCastException. -- This message was sent by Atlassian JIRA (v6.1#6144)