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 A54EEE3D0 for ; Fri, 1 Feb 2013 18:02:28 +0000 (UTC) Received: (qmail 84352 invoked by uid 500); 1 Feb 2013 18:02:26 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 84328 invoked by uid 500); 1 Feb 2013 18:02:26 -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 84320 invoked by uid 99); 1 Feb 2013 18:02:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 18:02:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=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-a82.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 18:02:20 +0000 Received: from homiemail-a82.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTP id 14F1B282074 for ; Fri, 1 Feb 2013 10:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=8E5MHfLS+4yJtzE4qRNYqHrXDH 0=; b=BWFCn4LpIHfm0AS84GOJ8DORfU/l2kgOUbZbAxuPMtO7kpMRYkWi0QG2RQ tZGJ7Bzpwh880d8DctFNU1S0BqRpCKk/xaBEygrwbbiPbayfp4uYAzIiHKqiu4+/ F/txVsXY9aE84LDdZD/9mQwILqwzfz+PO+aAJAO7y9CG5KqRQ= Received: from [172.16.1.8] (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-a82.g.dreamhost.com (Postfix) with ESMTPSA id 7F23928205F for ; Fri, 1 Feb 2013 10:01:59 -0800 (PST) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_485ADE49-B5F9-4A88-8760-BF6BAB960F27" Message-Id: <37CBBDD3-E334-47FC-A893-596A1706B1E4@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: JDBC : CreateresultSet fails with null column in CqlResultSet Date: Sat, 2 Feb 2013 07:01:58 +1300 References: <2E0E82ED-9AAB-4FCA-858E-7F8EE5073932@computing.dundee.ac.uk> To: user@cassandra.apache.org In-Reply-To: <2E0E82ED-9AAB-4FCA-858E-7F8EE5073932@computing.dundee.ac.uk> X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_485ADE49-B5F9-4A88-8760-BF6BAB960F27 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I think = http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/issues/list = is the place to raise the issue.=20 Can you update the mail thread with the ticket as well? Thanks ----------------- Aaron Morton Freelance Cassandra Developer New Zealand @aaronmorton http://www.thelastpickle.com On 1/02/2013, at 3:25 AM, Andy Cobley = wrote: > As you may be aware I've been trying to track down a problem using = JDBC 1.1.2 with Cassandra 1.2.0 I was getting a null pointer exception = in the result set. I've done some digging into the JDBC driver and = found the following. >=20 > In CassandraResultSet.java the new result set is Instantiated in=20 >=20 > CassandraResultSet(Statement statement, CqlResult resultSet, String = keyspace) >=20 > I decided to trace the result set with the following code: >=20 > rowsIterator =3D resultSet.getRowsIterator(); > System.out.println("-------------------------------"); > while(rowsIterator.hasNext()){ > CqlRow row =3D rowsIterator.next(); > curRowKey =3D row.getKey(); > System.out.println("Row Key "+curRowKey); > List cols =3D row.getColumns(); > Iterator iterator; > iterator =3D cols.iterator(); =20 > while (iterator.hasNext()){ > Column col=3D(Column)iterator.next(); > String Name=3D new String(col.getName()); > String Value =3D new String(col.getValue()); > System.out.println("Col "+Name+ " : "+Value); > } > } >=20 > This produced the following output: >=20 > ------------------------------- > Row Key [B@617e53c9 > Col key : jsmith > Col :=20 > Col =08password : ch@ngem3a > Row Key [B@2caee320 > Col key : jbrown > Col :=20 > Col =06gender : male > ------------------------------- >=20 > As you can see there is a black column at position 2 in each of the = rows. As this resultset has come from the Cassandra thrift client ( I = believe) the problem amy lay there. There is no blank column defined by = my SQL create statements I believe.=20 >=20 > If I'm correct here, should I raise a ticket with JDBC or Cassandra ? = (for now I've patched my local JDBC driver so it doesn't create a = TypedColumn if the result set produces a null column) >=20 > Andy >=20 >=20 > The University of Dundee is a Scottish Registered Charity, No. = SC015096. >=20 >=20 --Apple-Mail=_485ADE49-B5F9-4A88-8760-BF6BAB960F27 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii I = think http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/issues/= list is the place to raise the = issue. 

Can you update the mail thread with the = ticket as well?

Thanks

http://www.thelastpickle.com

On 1/02/2013, at 3:25 AM, Andy Cobley <acobley@computing.dundee.ac= .uk> wrote:

As you may = be aware I've been trying to track down a problem using JDBC 1.1.2 with = Cassandra 1.2.0  I was getting a null pointer exception in the = result set.  I've done some digging into the JDBC driver  and = found the following.

In CassandraResultSet.java the new result = set is Instantiated in

CassandraResultSet(Statement statement, = CqlResult resultSet, String keyspace)

I decided to trace the = result set with the following code:

rowsIterator =3D = resultSet.getRowsIterator();
=        System.out.println("------------= -------------------");
=        while(rowsIterator.hasNext()){           CqlRow = row =3D rowsIterator.next();
=           curRowKey =3D = row.getKey();
=           System.out.pri= ntln("Row Key "+curRowKey);
=           List<Column= > cols =3D row.getColumns();
=           Iterator<Co= lumn> iterator;
=           iterator =3D = cols.iterator();     
=   while (iterator.hasNext()){
=       Column = col=3D(Column)iterator.next();
=       String Name=3D new = String(col.getName());
=             &n= bsp; String Value =3D new String(col.getValue());
=       System.out.println("Col "+Name+ " : = "+Value);
=        }
=        }

This produced the = following output:

-------------------------------
Row Key = [B@617e53c9
Col key : jsmith
Col :
Col =08password : = ch@ngem3a
Row Key [B@2caee320
Col key : jbrown
Col :
Col = =06gender : male
-------------------------------

As you can = see there is a black column at position 2 in each of the rows.  As = this resultset has come from the Cassandra thrift client ( I believe) = the problem amy lay there.  There is no blank column defined by my = SQL create statements I believe.

If I'm correct here, should I = raise a ticket with JDBC or Cassandra ? (for now I've patched my local = JDBC driver so it doesn't create a TypedColumn if the result set = produces a null column)

Andy


The University of Dundee = is a Scottish Registered Charity, No. = SC015096.



= --Apple-Mail=_485ADE49-B5F9-4A88-8760-BF6BAB960F27--