inconsistent counter value?

2011-08-13 Thread Boris Yen
I posted a comment for Cassandra-3006 after 0.8.4 is released, but it seems
not be noticed there, so I re-post here, wondering if anyone could help.
---
Follow the same steps posted on Cassandra-3006, after step 11, I check the
counter on .152, the counter values changes from 1001 to 200. And then I
follow the steps 12 and 13. The counter value of .151 is still 1001, but the
counter value of .152 is still 200. After  changing the consistencylevel to
quorum and do the read again, this time the counter value of .152 became
1001.
I am kind of confused, because at step 10, I can get 1001 on both nodes, how
come the value of .152 changes to 200 when .151 is down. Is this the right
behavior of current design?

Regards
Boris


CQL: No indexed column error when < or <= in WHERE clause

2011-08-13 Thread Jens Hartung
Hi together,

first, I'm using Cassandra Version 0.8.4 and access it via CQL 1.0.3.

When I select data from Cassandra with = in WHERE clause, everything works 
fine, but when using <= or < in WHERE clause, I always get following Exception:

java.sql.SQLException: No indexed columns present in by-columns clause with 
"equals" operator
at 
org.apache.cassandra.cql.jdbc.CassandraStatement.executeQuery(CassandraStatement.java:242)
at 
columnfamily.queries.CassandraQueries.singleColumnSelect(CassandraQueries.java:147)
...

My select-statement: "SELECT number FROM station WHERE number <= 8210;"

Output of describe keyspace (within cli):
ColumnFamily: station
  Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
  Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
  Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type
  Row cache size / save period in seconds: 0.0/0
  Key cache size / save period in seconds: 20.0/14400
  Memtable thresholds: 0.2109375/1440/45 (millions of ops/minutes/MB)
  GC grace seconds: 864000
  Compaction min/max thresholds: 4/32
  Read repair chance: 1.0
  Replicate on write: true
  Built indexes: [station.station_number_idx]
  Column Metadata:
[...]
Column Name: number
  Validation Class: org.apache.cassandra.db.marshal.LongType
  Index Name: station_number_idx
  Index Type: KEYS
[...]

Are the <, <=, >=, > operators not supported at this time?

Greetings
Jens
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!   
Jetzt informieren: http://www.gmx.net/de/go/freephone


thrift c++ insert Exception [Column value is required]

2011-08-13 Thread Hassapis Constantinos
Hi all,

I'm using Cassandra 0.8.3 and thrift for c++ and I can't insert column in
a column family. Starting from an empty keyspace first I add a new
keyspace and then a new column family and that works fine but I can't
insert a column.
The code that I have written is:

transport->open();
KsDef ks_def;

ks_def.name = "test_keyspace";
ks_def.replication_factor = 0;
ks_def.strategy_class = "LocalStrategy";
std::string res;

cout << "add keyspace.." << endl;
client.system_add_keyspace( res, ks_def);
client.set_keyspace("test_keyspace");

cout << "add column family.." << endl;
CfDef cf_def;
cf_def.keyspace= "test_keyspace";
cf_def.name = "cf_name_test";
client.system_add_column_family( res, cf_def );

const string& key="test_key";
const string value="valu_";

ColumnParent cparent;
cparent.column_family = "cf_name_test";

Column c;
c.name =  "column_namess";
c.value =  value;
c.timestamp = getTS();

cout << "insert key value:"<< c.value << endl;
client.insert( key, cparent, c, ConsistencyLevel::ONE);

cout << "drop column family" << endl;
client.system_drop_column_family( res, "cf_name_test");

cout << "drop keyspace" << endl;
client.system_drop_keyspace( res, "test_keyspace");

transport->close();

and I recive the bellow Exception: Default TException.  [Column value is
required] as you can see from the source code I have fill the value of the
column.

thank you in advance for your help.
Konstantinos Chasapis
p.s please cc me in the reply.





Re: CQL: No indexed column error when < or <= in WHERE clause

2011-08-13 Thread Jonathan Ellis
This is covered in
http://www.datastax.com/dev/blog/whats-new-cassandra-07-secondary-indexes

On Sat, Aug 13, 2011 at 2:49 PM, Jens Hartung  wrote:
> Hi together,
>
> first, I'm using Cassandra Version 0.8.4 and access it via CQL 1.0.3.
>
> When I select data from Cassandra with = in WHERE clause, everything works 
> fine, but when using <= or < in WHERE clause, I always get following 
> Exception:
>
> java.sql.SQLException: No indexed columns present in by-columns clause with 
> "equals" operator
>        at 
> org.apache.cassandra.cql.jdbc.CassandraStatement.executeQuery(CassandraStatement.java:242)
>        at 
> columnfamily.queries.CassandraQueries.singleColumnSelect(CassandraQueries.java:147)
> ...
>
> My select-statement: "SELECT number FROM station WHERE number <= 8210;"
>
> Output of describe keyspace (within cli):
> ColumnFamily: station
>      Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type
>      Default column value validator: org.apache.cassandra.db.marshal.UTF8Type
>      Columns sorted by: org.apache.cassandra.db.marshal.UTF8Type
>      Row cache size / save period in seconds: 0.0/0
>      Key cache size / save period in seconds: 20.0/14400
>      Memtable thresholds: 0.2109375/1440/45 (millions of ops/minutes/MB)
>      GC grace seconds: 864000
>      Compaction min/max thresholds: 4/32
>      Read repair chance: 1.0
>      Replicate on write: true
>      Built indexes: [station.station_number_idx]
>      Column Metadata:
>        [...]
>        Column Name: number
>          Validation Class: org.apache.cassandra.db.marshal.LongType
>          Index Name: station_number_idx
>          Index Type: KEYS
>        [...]
>
> Are the <, <=, >=, > operators not supported at this time?
>
> Greetings
> Jens
> --
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com


Re: thrift c++ insert Exception [Column value is required]

2011-08-13 Thread Jonathan Ellis
In C++ you need to set .__isset.fieldname on optional fields (e.g.
.__isset.value).

2011/8/13 Hassapis Constantinos :
> Hi all,
>
> I'm using Cassandra 0.8.3 and thrift for c++ and I can't insert column in
> a column family. Starting from an empty keyspace first I add a new
> keyspace and then a new column family and that works fine but I can't
> insert a column.
> The code that I have written is:
>
>                transport->open();
>                KsDef ks_def;
>
>                ks_def.name = "test_keyspace";
>                ks_def.replication_factor = 0;
>                ks_def.strategy_class = "LocalStrategy";
>                std::string res;
>
>                cout << "add keyspace.." << endl;
>                client.system_add_keyspace( res, ks_def);
>                client.set_keyspace("test_keyspace");
>
>                cout << "add column family.." << endl;
>                CfDef cf_def;
>                cf_def.keyspace= "test_keyspace";
>                cf_def.name = "cf_name_test";
>                client.system_add_column_family( res, cf_def );
>
>                const string& key="test_key";
>                const string value="valu_";
>
>                ColumnParent cparent;
>                cparent.column_family = "cf_name_test";
>
>                Column c;
>                c.name =  "column_namess";
>                c.value =  value;
>                c.timestamp = getTS();
>
>                cout << "insert key value:"<< c.value << endl;
>                client.insert( key, cparent, c, ConsistencyLevel::ONE);
>
>                cout << "drop column family" << endl;
>                client.system_drop_column_family( res, "cf_name_test");
>
>                cout << "drop keyspace" << endl;
>                client.system_drop_keyspace( res, "test_keyspace");
>
>                transport->close();
>
> and I recive the bellow Exception: Default TException.  [Column value is
> required] as you can see from the source code I have fill the value of the
> column.
>
> thank you in advance for your help.
> Konstantinos Chasapis
> p.s please cc me in the reply.
>
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com