Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time-descending result of select queries #2271

Merged
merged 1 commit into from
Jan 29, 2016

Conversation

navis
Copy link
Contributor

@navis navis commented Jan 15, 2016

#2014 for select query

return offset + (descending ? -counter : counter);
}

static int toDelta(int offset, boolean descending)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have some different names between these offsets and the one defined in the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed offset in the class to startOffset

@navis navis force-pushed the descending-for-select-query branch from 5d99df4 to 63d2213 Compare January 17, 2016 01:10
@fjy
Copy link
Contributor

fjy commented Jan 18, 2016

👍

@navis please add documentation for select query that it is reversible

@navis navis force-pushed the descending-for-select-query branch from 340617c to 5caaf9b Compare January 20, 2016 04:18
@navis
Copy link
Contributor Author

navis commented Jan 20, 2016

updated document

@@ -1134,6 +1136,12 @@ public SelectQueryBuilder intervals(List<Interval> l)
return this;
}

public SelectQueryBuilder descending(boolean descending)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setDescending

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see other methods in this class violate "normal" bean naming conventions. Oh well...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drcrallen any other comments? I think this is pretty close to ready

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think in Druids and in other places, we did not follow the 'set' convention in most of the builder classes.

@fjy fjy added this to the 0.9.0 milestone Jan 21, 2016
@fjy
Copy link
Contributor

fjy commented Jan 22, 2016

@himanshug can you take a look?

private boolean checkPagingSpec(PagingSpec pagingSpec, boolean descending)
{
for (Integer value : pagingSpec.getPagingIdentifiers().values()) {
if (descending ^ value < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a part of the java spec I'm not as familiar with. Is this doing ((descending ? 1 : 0) ^ value) < 0 or descending ^ (value < 0)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntelliJ says it's descending ^ (value < 0). I'll add clarifying parentheses.


int offset = 0;
while (!cursor.isDone() && offset < query.getPagingSpec().getThreshold()) {
for (; !cursor.isDone() && offset.hasNext(); cursor.advance(), offset.next()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so much tidier now

@drcrallen
Copy link
Contributor

Functionality looks good. Have some outstanding questions about docs and possibly some more unit tests.

@drcrallen
Copy link
Contributor

Also please squash soon, this is very close to ready

@fjy
Copy link
Contributor

fjy commented Jan 28, 2016

@navis can you squash commits?

@navis
Copy link
Contributor Author

navis commented Jan 29, 2016

squashed

@fjy
Copy link
Contributor

fjy commented Jan 29, 2016

@drcrallen any more comments?

@drcrallen
Copy link
Contributor

is not squashed :) did @navis forget to push?

@fjy
Copy link
Contributor

fjy commented Jan 29, 2016

@navis ?

@navis
Copy link
Contributor Author

navis commented Jan 29, 2016

Ah, sorry. I've confused with other issue.

@navis navis force-pushed the descending-for-select-query branch from 8301f47 to 55a888e Compare January 29, 2016 08:06
@drcrallen
Copy link
Contributor

👍

drcrallen added a commit that referenced this pull request Jan 29, 2016
time-descending result of select queries
@drcrallen drcrallen merged commit 6227f2f into apache:master Jan 29, 2016
@fjy fjy mentioned this pull request Feb 5, 2016
@fjy fjy added the Feature label Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants