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

Allow SegmentMetadataQuery to skip cardinality and size calculations #1753

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

jon-wei
Copy link
Contributor

@jon-wei jon-wei commented Sep 18, 2015

No description provided.

@gianm
Copy link
Contributor

gianm commented Sep 18, 2015

fixes #1750

@@ -29,6 +29,7 @@ There are several main parts to a segment metadata query:
|toInclude|A JSON Object representing what columns should be included in the result. Defaults to "all".|no|
|merge|Merge all individual segment metadata results into a single result|no|
|context|See [Context](../querying/query-context.html)|no|
|analysisTypes|A list of Strings specifying what column properties (e.g. cardinality, size) should be calculated and returned in the result. Defaults to ["CARDINALITY", "SIZE"]. If cardinality and/or size values are not needed, omitting those properties will result in a more efficient query.|no|
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 if we had consistent casing in our query APIs and default everything to lower / camelCase. Maybe we can do something to have better serde for enums?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xvrl I added a fromString function to the analysisTypes enum that will uppercase the input, changed the docs to use lowercase analysisType strings

@fjy
Copy link
Contributor

fjy commented Sep 18, 2015

👍

@@ -55,7 +56,7 @@
*/
private static final int NUM_BYTES_IN_TEXT_FLOAT = 8;

public Map<String, ColumnAnalysis> analyze(QueryableIndex index)
public Map<String, ColumnAnalysis> analyze(QueryableIndex index, SegmentMetadataQuery query)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than passing the query around, can you pass the flag set around? I think it's nicer to pass smaller things, when possible.

Copy link
Member

Choose a reason for hiding this comment

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

Agree with Gian

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gianm @xvrl changed SegmentAnalyzer functions to accept the flag set instead of query

@@ -29,6 +29,7 @@ There are several main parts to a segment metadata query:
|toInclude|A JSON Object representing what columns should be included in the result. Defaults to "all".|no|
|merge|Merge all individual segment metadata results into a single result|no|
|context|See [Context](../querying/query-context.html)|no|
|analysisTypes|A list of Strings specifying what column properties (e.g. cardinality, size) should be calculated and returned in the result. Defaults to ["cardinality", "size"]. If cardinality and/or size values are not needed, omitting those properties will result in a more efficient query.|no|
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a link to a section of the segment metadata query listing out the analysis types and what each one does. There's enough info there that it is worth expanding on what's here, but that would take up too much space in the table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gianm updated doc

@jon-wei jon-wei force-pushed the segmentmetadataquery_flags branch 3 times, most recently from 8f622f7 to a716d17 Compare September 21, 2015 19:49
@@ -86,3 +87,21 @@ The grammar is as follows:
``` json
"toInclude": { "type": "list", "columns": [<string list of column names>]}
```

### analysisTypes <a name="analysisTypes"></a>
Copy link
Member

Choose a reason for hiding this comment

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

no need for anchor here, our markdown processor automatically adds them

Copy link
Member

Choose a reason for hiding this comment

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

FYI, markdown creates all lowercase anchors, so you can refer to it using analysistypes, similar to http://druid.io/docs/latest/querying/segmentmetadataquery.html#toinclude

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xvrl removed anchor

@xvrl
Copy link
Member

xvrl commented Sep 22, 2015

LGTM, some minor comments, but good to merge once we remove unnecessary doc anchors.

@@ -29,6 +29,7 @@ There are several main parts to a segment metadata query:
|toInclude|A JSON Object representing what columns should be included in the result. Defaults to "all".|no|
|merge|Merge all individual segment metadata results into a single result|no|
|context|See [Context](../querying/query-context.html)|no|
|analysisTypes|A list of Strings specifying what column properties (e.g. cardinality, size) should be calculated and returned in the result. Defaults to ["cardinality", "size"]. See section [analysisTypes](#analysisTypes) for more details.|no|
Copy link
Member

Choose a reason for hiding this comment

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

oops, just saw this, link needs to be lowercase [analysisTypes](#analysistypes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xvrl Lowercased the link

@xvrl
Copy link
Member

xvrl commented Sep 22, 2015

👍

xvrl added a commit that referenced this pull request Sep 22, 2015
Allow SegmentMetadataQuery to skip cardinality and size calculations
@xvrl xvrl merged commit 2cb0fb4 into apache:master Sep 22, 2015
@jon-wei jon-wei deleted the segmentmetadataquery_flags branch October 6, 2017 22:23
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.

None yet

4 participants