-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Conversation
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| |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
3fcb4b8
to
e591d7b
Compare
👍 |
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Gian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
334b0ca
to
b6468e5
Compare
@@ -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| |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianm updated doc
8f622f7
to
a716d17
Compare
@@ -86,3 +87,21 @@ The grammar is as follows: | |||
``` json | |||
"toInclude": { "type": "list", "columns": [<string list of column names>]} | |||
``` | |||
|
|||
### analysisTypes <a name="analysisTypes"></a> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xvrl removed anchor
LGTM, some minor comments, but good to merge once we remove unnecessary doc anchors. |
a716d17
to
96bce13
Compare
@@ -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| |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xvrl Lowercased the link
96bce13
to
e6a6284
Compare
👍 |
Allow SegmentMetadataQuery to skip cardinality and size calculations
No description provided.