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

Add dimension extraction functionality to SearchQuery #1712

Merged
merged 1 commit into from
Sep 14, 2015

Conversation

drcrallen
Copy link
Contributor

Dimension extraction did not work for search query prior to this.

@drcrallen drcrallen force-pushed the searchQueryDimExtraction branch 4 times, most recently from 035229a to 46ddda7 Compare September 9, 2015 03:47
@Override
public int compare(DimensionSpec o1, DimensionSpec o2)
{
return o1.getOutputName().compareTo(o2.getOutputName());
Copy link
Member

Choose a reason for hiding this comment

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

probably sorting should be done based on DimensionSpec#dimension instead of outputName.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is that?

Copy link
Member

Choose a reason for hiding this comment

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

multiple queries having different outputName but on the same column maps to same cache key and results in same intermediate results.
CachingClusteredClientTest.testGroupByCachingRenamedAggs does similar testing for groupBy.

Copy link
Member

Choose a reason for hiding this comment

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

Lets also add a UT to CachingClusteredClient for testing caching with renamed dimensions while at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking into it more I think both implementations are broken. io.druid.query.search.SearchQueryRunner#run uses the specified ordering to search through the dimensions, and if there is a limit specified, then the results are going to be dependent on the query-specified ordering of the dimensions, and how many results each one of those returned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified to use same ordering as the query uses.

Copy link
Member

Choose a reason for hiding this comment

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

a unit test for the failure would be good to have.

@drcrallen
Copy link
Contributor Author

Travis failed in hadoop (stalled?) restarting.

@nishantmonu51
Copy link
Member

+1

@drcrallen
Copy link
Contributor Author

Travis failed in unrelated

@drcrallen drcrallen closed this Sep 9, 2015
@drcrallen drcrallen reopened this Sep 9, 2015
@drcrallen drcrallen added this to the 0.8.2 milestone Sep 9, 2015
@@ -104,9 +120,9 @@ public static AndDimFilterBuilder newAndDimFilterBuilder()

/**
* A Builder for OrDimFilter.
*
* <p/>
Copy link
Member

Choose a reason for hiding this comment

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

can we change the default template to not add those empty tags, Java 8 javadocs does not like them

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer that we don't change formatting on the entire file, when doing only localized change, but that's just my personal preference. It makes code reviews harder to try to weed out formatting changes from code changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed in this PR

@xvrl
Copy link
Member

xvrl commented Sep 14, 2015

LGTM once squashed to remove the extra changes

xvrl added a commit that referenced this pull request Sep 14, 2015
Add dimension extraction functionality to SearchQuery
@xvrl xvrl merged commit 5f36e7a into apache:master Sep 14, 2015
@xvrl xvrl deleted the searchQueryDimExtraction branch September 14, 2015 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants