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

GroupBy array-based result rows. #8196

Merged
merged 2 commits into from
Jul 31, 2019
Merged

Conversation

gianm
Copy link
Contributor

@gianm gianm commented Jul 30, 2019

Fixes #8118; see that proposal for additional details about the main change.

Other than the GroupBy changes, the main other "interesting" new/changed classes are:

  • ResultRow: The array-based result type.
  • BaseQuery: T is no longer required to be Comparable.
  • QueryToolChest: Adds "decorateObjectMapper" to enable query-aware serialization
    and deserialization of result rows (necessary due to their positional nature).
  • QueryResource: Uses the new decoration functionality.
  • DirectDruidClient: Also uses the new decoration functionality.
  • QueryMaker (in Druid SQL): Modifications to read ResultRows.

These classes weren't changed, but got some new javadocs:

  • BySegmentQueryRunner
  • FinalizeResultsQueryRunner
  • Query

Fixes apache#8118; see that proposal for details.

Other than the GroupBy changes, the main other "interesting" classes are:

- ResultRow: The array-based result type.
- BaseQuery: T is no longer required to be Comparable.
- QueryToolChest: Adds "decorateObjectMapper" to enable query-aware serialization
  and deserialization of result rows (necessary due to their positional nature).
- QueryResource: Uses the new decoration functionality.
- DirectDruidClient: Also uses the new decoration functionality.
- QueryMaker (in Druid SQL): Modifications to read ResultRows.

These classes weren't changed, but got some new javadocs:

- BySegmentQueryRunner
- FinalizeResultsQueryRunner
- Query
Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

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

overall lgtm, this is very nice and the javadocs are great, thanks! 🤘

{
return new CacheStrategy<Row, Object, GroupByQuery>()
return new CacheStrategy<ResultRow, Object, GroupByQuery>()
{
private static final byte CACHE_STRATEGY_VERSION = 0x1;
Copy link
Member

Choose a reason for hiding this comment

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

Should this version be bumped so off-machine caches don't cause an issue or will the fancy decorated mapper be used in like CachingQueryRunner for reading the values from the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check out the prepareForCache method -- the cache format is the same. It was always array-based, and it remains so.

Copy link
Member

Choose a reason for hiding this comment

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

Oops, looking closer I see this now, thanks 👍

@@ -163,7 +164,9 @@ public Response cancelQuery(@PathParam("id") String queryId, @Context final Http
public Response doPost(
final InputStream in,
@QueryParam("pretty") final String pretty,
@Context final HttpServletRequest req // used to get request content-type,Accept header, remote address and auth-related headers

// used to get request content-type,Accept header, remote address and auth-related headers
Copy link
Member

Choose a reason for hiding this comment

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

nit: .. request content-type,Accept header, .. -> .. request content-type, Accept header, ..

(i know it was already like that, so imo only fix if you have something else to change).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update this if there ends up being something else to change, for now I'll leave it as it was before so CI doesn't get interrupted.

{
return new CacheStrategy<Row, Object, GroupByQuery>()
return new CacheStrategy<ResultRow, Object, GroupByQuery>()
{
private static final byte CACHE_STRATEGY_VERSION = 0x1;
Copy link
Member

Choose a reason for hiding this comment

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

Oops, looking closer I see this now, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GroupBy array based result rows
3 participants