.TakeKeys not returning proper record count #72

Closed
ilushka85 opened this Issue Oct 9, 2012 · 1 comment

Projects

None yet

2 participants

@ilushka85

Specifying .TakeKeys() while using start key does not return proper amount of keys

var usersTest1 = usersColumnFamily.Get()
    .StartWithKey("").TakeUntilKey("").TakeKeys(150)
    .Execute();

var usersTest2 = usersColumnFamily.Get()
    .StartWithKey("").TakeUntilKey("").TakeKeys(150)
    .Where(t => t["IsConfirmed"] == false.ToString())
    .Execute();

userstest1 returns 150 keys as indicated
userstest2 returns 100 keys

the problem in code is the following file: CassandraSlicePredicateBuilder.cs

Line 151 says

var indexClause = new CassandraIndexClause(setup.StartKey, setup.ColumnCount, setup.IndexClause);

in realtiy the indexclause should be given the count of how many keys we want so the correct line should be

var indexClause = new CassandraIndexClause(setup.StartKey, setup.KeyCount, setup.IndexClause);

Can someone create a patch for this?

@nberardi
Contributor
nberardi commented Oct 9, 2012

Any chance you can send a pull request with the updated code.

Nick Berardi
(484) 302-0125
Sent on the go from my phone.

On Oct 8, 2012, at 8:31 PM, ilushka85 notifications@github.com wrote:

var usersTest1 =
usersColumnFamily.Get().StartWithKey("").TakeUntilKey("").TakeKeys(150)..Execute();

var usersTest2 =
usersColumnFamily.Get().StartWithKey("").TakeUntilKey("").TakeKeys(150).Where(t
=> t["IsConfirmed"] == false.ToString()).Execute();

userstest1 returns 150 keys as indicated

userstest2 returns 100 keys

the problem in code is the following file: CassandraSlicePredicateBuilder.cs

Line 151 says

var indexClause = new CassandraIndexClause(setup.StartKey,
setup.ColumnCount, setup.IndexClause);

in realtiy the indexclause should be given the count of how many keys we
want so the correct line should be

var indexClause = new CassandraIndexClause(setup.StartKey, setup.KeyCount,
setup.IndexClause);

Can someone create a patch for this?


Reply to this email directly or view it on
GitHubhttps://github.com/managedfusion/fluentcassandra/issues/72.

@nberardi nberardi was assigned Oct 11, 2012
@nberardi nberardi added a commit that referenced this issue Jan 3, 2013
@nberardi nberardi fix for issue #72 55686d5
@nberardi nberardi closed this Jan 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment