cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorvaldsson Justus <justus.thorvalds...@svenskaspel.se>
Subject SV: how to retrieve data from supercolumns by phpcassa ?
Date Fri, 13 Aug 2010 06:53:58 GMT
I don't use php so I don't know the method but

http://wiki.apache.org/cassandra/API
"get
ColumnOrSuperColumn get(string keyspace, string key, ColumnPath column_path, ConsistencyLevel
consistency_level)

Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException
is thrown. (This is the only method that can throw an exception under non-failure conditions.)
"
So don't use get if you want to specify a super column.

"get_slice
list<ColumnOrSuperColumn> get_slice(string keyspace, string key, ColumnParent column_parent,
SlicePredicate predicate, ConsistencyLevel consistency_level)
Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn
name pair) specified by the given SlicePredicate struct."

Is one way to do what you want. How this works in php I don't know but should be similar.


/Justus


-----Ursprungligt meddelande-----
Från: lisek [mailto:m.lisowski@powerprice.pl] 
Skickat: den 12 augusti 2010 15:49
Till: cassandra-user@incubator.apache.org
Ämne: how to retrieve data from supercolumns by phpcassa ?


Hi all,

I've got cassandra superlcolumn looking like that:

<ColumnFamily Name="users" CompareWith="TimeUUIDType"
ColumnType="Super" CompareSubcolumnsWith="BytesType" />

now in this columnfamily I've inserted something like that:

["client"] => array(1) {
  ["2a3909c0-a612-11df-b27e-346336336631"]=>
    array(3) {
      ["add_date"]=>
      string(10) "1281618279"
      ["lastname"]=>
      string(8) "blablabla"
      ["name"]=>
      string(6) "myname"
  }

}

my question is, how to get from "client" this one "2a3909c0-a612-11df-
b27e-346336336631" column? I was tryin to get->('client', '2a3909c0-
a612-11df-b27e-346336336631') - but with no results... maybe I should
convert this "2a3909c0-a612-11df-b27e-346336336631" somehow before I
put it to get() ?

or maybe I'm thinking wrong way...

regards 
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/how-to-retrieve-data-from-supercolumns-by-phpcassa-tp5416141p5416141.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Mime
View raw message