You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Daniel Hölbling-Inzko <da...@bitmovin.com> on 2017/09/26 07:17:03 UTC
Datastax Driver Mapper & Secondary Indexes
Hi,
I am currently moving an application from SQL to Cassandra using Java. I
successfully got the DataStax driver and the mapper up and running, but
can't seem to figure out how to set secondary indexes through the mapper.
I also can't seem to find anything related to indexes in the mapper sources
- am I missing something or is this missing from the client library?
greetings Daniel
Re: Datastax Driver Mapper & Secondary Indexes
Posted by Nicolas Henneaux <Ni...@arhs-developments.com>.
If you just use the Cassandra default mapper, you can also use the class defined in the Stack Overflow answer https://stackoverflow.com/a/45073242/1630604 to generate the DDL from your entities.
Nicolas HENNEAUX
From: DuyHai Doan <do...@gmail.com>
Reply-To: "user@cassandra.apache.org" <us...@cassandra.apache.org>
Date: Tuesday, 26 September 2017 at 15:17
To: user <us...@cassandra.apache.org>
Subject: Re: Datastax Driver Mapper & Secondary Indexes
If you're looking for schema generation from Bean annotations: https://github.com/doanduyhai/Achilles/wiki/DDL-Scripts-Generation
On Tue, Sep 26, 2017 at 2:50 PM, Daniel Hölbling-Inzko <da...@bitmovin.com>> wrote:
Hi, I also just figured out that there is no schema generation off the mapper.
Thanks for pointing me to the secondary index info. I'll have a look.
greetings Daniel
On Tue, 26 Sep 2017 at 09:42 kurt greaves <ku...@instaclustr.com>> wrote:
If you've created a secondary index you simply query it by specifying it as part of the where clause. Note that you should really understand the drawbacks of secondary indexes before using them, as they might not be incredibly efficient depending on what you need them for.
http://www.wentnet.com/blog/?p=77 and https://pantheon.io/blog/cassandra-scale-problem-secondary-indexes might help.
On 26 September 2017 at 07:17, Daniel Hölbling-Inzko <da...@bitmovin.com>> wrote:
Hi,
I am currently moving an application from SQL to Cassandra using Java. I successfully got the DataStax driver and the mapper up and running, but can't seem to figure out how to set secondary indexes through the mapper.
I also can't seem to find anything related to indexes in the mapper sources - am I missing something or is this missing from the client library?
greetings Daniel
Re: Datastax Driver Mapper & Secondary Indexes
Posted by DuyHai Doan <do...@gmail.com>.
If you're looking for schema generation from Bean annotations:
https://github.com/doanduyhai/Achilles/wiki/DDL-Scripts-Generation
On Tue, Sep 26, 2017 at 2:50 PM, Daniel Hölbling-Inzko <
daniel.hoelbling-inzko@bitmovin.com> wrote:
> Hi, I also just figured out that there is no schema generation off the
> mapper.
> Thanks for pointing me to the secondary index info. I'll have a look.
>
> greetings Daniel
>
> On Tue, 26 Sep 2017 at 09:42 kurt greaves <ku...@instaclustr.com> wrote:
>
>> If you've created a secondary index you simply query it by specifying it
>> as part of the where clause. Note that you should really understand the
>> drawbacks of secondary indexes before using them, as they might not be
>> incredibly efficient depending on what you need them for.
>> http://www.wentnet.com/blog/?p=77 and https://pantheon.io/blog/
>> cassandra-scale-problem-secondary-indexes might help.
>>
>> On 26 September 2017 at 07:17, Daniel Hölbling-Inzko <
>> daniel.hoelbling-inzko@bitmovin.com> wrote:
>>
>>> Hi,
>>> I am currently moving an application from SQL to Cassandra using Java. I
>>> successfully got the DataStax driver and the mapper up and running, but
>>> can't seem to figure out how to set secondary indexes through the mapper.
>>> I also can't seem to find anything related to indexes in the mapper
>>> sources - am I missing something or is this missing from the client library?
>>>
>>> greetings Daniel
>>>
>>
>>
Re: Datastax Driver Mapper & Secondary Indexes
Posted by Daniel Hölbling-Inzko <da...@bitmovin.com>.
Hi, I also just figured out that there is no schema generation off the
mapper.
Thanks for pointing me to the secondary index info. I'll have a look.
greetings Daniel
On Tue, 26 Sep 2017 at 09:42 kurt greaves <ku...@instaclustr.com> wrote:
> If you've created a secondary index you simply query it by specifying it
> as part of the where clause. Note that you should really understand the
> drawbacks of secondary indexes before using them, as they might not be
> incredibly efficient depending on what you need them for.
> http://www.wentnet.com/blog/?p=77 and
> https://pantheon.io/blog/cassandra-scale-problem-secondary-indexes might
> help.
>
> On 26 September 2017 at 07:17, Daniel Hölbling-Inzko <
> daniel.hoelbling-inzko@bitmovin.com> wrote:
>
>> Hi,
>> I am currently moving an application from SQL to Cassandra using Java. I
>> successfully got the DataStax driver and the mapper up and running, but
>> can't seem to figure out how to set secondary indexes through the mapper.
>> I also can't seem to find anything related to indexes in the mapper
>> sources - am I missing something or is this missing from the client library?
>>
>> greetings Daniel
>>
>
>
Re: Datastax Driver Mapper & Secondary Indexes
Posted by kurt greaves <ku...@instaclustr.com>.
If you've created a secondary index you simply query it by specifying it as
part of the where clause. Note that you should really understand the
drawbacks of secondary indexes before using them, as they might not be
incredibly efficient depending on what you need them for.
http://www.wentnet.com/blog/?p=77 and
https://pantheon.io/blog/cassandra-scale-problem-secondary-indexes might
help.
On 26 September 2017 at 07:17, Daniel Hölbling-Inzko <
daniel.hoelbling-inzko@bitmovin.com> wrote:
> Hi,
> I am currently moving an application from SQL to Cassandra using Java. I
> successfully got the DataStax driver and the mapper up and running, but
> can't seem to figure out how to set secondary indexes through the mapper.
> I also can't seem to find anything related to indexes in the mapper
> sources - am I missing something or is this missing from the client library?
>
> greetings Daniel
>