CQL3 can return LongType and Int32Type columns as null #75

Closed
edweip3 opened this Issue Oct 11, 2012 · 1 comment

Projects

None yet

2 participants

@edweip3
Contributor
edweip3 commented Oct 11, 2012

in CQL3, when you select a row, if the row has bigint or int columns, and the row does not contain values for those columns, FluentCassandra will get an exception trying to convert null to long or int. Here are some CQL3 statements to reproduce.

create a column family using CQL3:
CREATE TABLE test (
userid ascii,
stringfield text,
intfield int,
PRIMARY KEY (userid)
);

insert a row without the intfield:
INSERT INTO test (userid, stringfield) VAULES ('id1', 'some text');

select the inserted row with:
SELECT * FROM test where userid='id1';

if you run the above statements with FluentCassandra using CQL3, you will get an exception.

The fix would be to check if the column is null, if it is null, return the value 0. I can send you a pull request.

Contributor

Can you work up a pull request and submit it?

@nberardi nberardi closed this Oct 11, 2012
@nberardi nberardi was assigned Oct 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment