Quantcast

Row iteration over indexed clause

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Row iteration over indexed clause

Vivek Mishra-2
Hi,
Is it possible to iterate and fetch in chunks using thrift API by querying using "secondary indexes"?

-Vivek
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Row iteration over indexed clause

shimi

Yes.

use get_indexed_slices (http://wiki.apache.org/cassandra/API)

On Tue, Mar 13, 2012 at 2:12 PM, Vivek Mishra <[hidden email]> wrote:
Hi,
Is it possible to iterate and fetch in chunks using thrift API by querying using "secondary indexes"?

-Vivek

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Row iteration over indexed clause

Vivek Mishra-2
Thanks.

Attribute

Type

Default

Required

Description

expressions

list<IndexExpression>

n/a

Y

The list of IndexExpression objects which must contain one EQ IndexOperator among the expressions

start_key

binary

n/a

Y

Start the index query at the specified key - can be set to '', i.e., an empty byte array, to start with the first key

count

integer

100

Y

The number of results to which the index query will be constrained




How do i iterate using it? How do i ensure that it should not return me previous results(without i need to keep something in-memory)?

This is the method i am looking into:

get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level)

It does not have anything like count.


Thanks,
Vivek

On Tue, Mar 13, 2012 at 6:24 PM, Shimi Kiviti <[hidden email]> wrote:

Yes.

use get_indexed_slices (http://wiki.apache.org/cassandra/API)

On Tue, Mar 13, 2012 at 2:12 PM, Vivek Mishra <[hidden email]> wrote:
Hi,
Is it possible to iterate and fetch in chunks using thrift API by querying using "secondary indexes"?

-Vivek


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Row iteration over indexed clause

aaron morton
If you want 100 results per call, ask for 101. Use the first 100, when you get to the 101'st do not examine it's data. Instead use it's key as the start to get the next 101.

Cheers

-----------------
Aaron Morton
Freelance Developer
@aaronmorton

On 14/03/2012, at 2:03 AM, Vivek Mishra wrote:

Thanks.

Attribute
Type
Default
Required
Description
expressions
list<IndexExpression>
n/a
Y
The list of IndexExpression objects which must contain one EQ IndexOperator among the expressions
start_key
binary
n/a
Y
Start the index query at the specified key - can be set to '', i.e., an empty byte array, to start with the first key
count
integer
100
Y
The number of results to which the index query will be constrained



How do i iterate using it? How do i ensure that it should not return me previous results(without i need to keep something in-memory)?

This is the method i am looking into:

get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level)

It does not have anything like count.


Thanks,
Vivek

On Tue, Mar 13, 2012 at 6:24 PM, Shimi Kiviti <[hidden email]> wrote:

Yes.

use get_indexed_slices (http://wiki.apache.org/cassandra/API)

On Tue, Mar 13, 2012 at 2:12 PM, Vivek Mishra <[hidden email]> wrote:
Hi,
Is it possible to iterate and fetch in chunks using thrift API by querying using "secondary indexes"?

-Vivek



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Row iteration over indexed clause

Tyler Hobbs-2
Are you writing a new client for a language that doesn't have good drivers?  If not, most of the existing clients already break up the query into chunks, I think.

The pycassa implementation of this might be a useful reference: https://github.com/pycassa/pycassa/blob/master/pycassa/columnfamily.py#L561

On Wed, Mar 14, 2012 at 2:35 AM, aaron morton <[hidden email]> wrote:
If you want 100 results per call, ask for 101. Use the first 100, when you get to the 101'st do not examine it's data. Instead use it's key as the start to get the next 101.

Cheers

-----------------
Aaron Morton
Freelance Developer
@aaronmorton

On 14/03/2012, at 2:03 AM, Vivek Mishra wrote:

Thanks.

Attribute
Type
Default
Required
Description
expressions
list<IndexExpression>
n/a
Y
The list of IndexExpression objects which must contain one EQ IndexOperator among the expressions
start_key
binary
n/a
Y
Start the index query at the specified key - can be set to '', i.e., an empty byte array, to start with the first key
count
integer
100
Y
The number of results to which the index query will be constrained



How do i iterate using it? How do i ensure that it should not return me previous results(without i need to keep something in-memory)?

This is the method i am looking into:

get_indexed_slices(ColumnParent column_parent, IndexClause index_clause, SlicePredicate column_predicate, ConsistencyLevel consistency_level)

It does not have anything like count.


Thanks,
Vivek

On Tue, Mar 13, 2012 at 6:24 PM, Shimi Kiviti <[hidden email]> wrote:

Yes.

use get_indexed_slices (http://wiki.apache.org/cassandra/API)

On Tue, Mar 13, 2012 at 2:12 PM, Vivek Mishra <[hidden email]> wrote:
Hi,
Is it possible to iterate and fetch in chunks using thrift API by querying using "secondary indexes"?

-Vivek






--
Tyler Hobbs
DataStax

Loading...