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

More lenient type parsing in histo/cardinality aggs #6948

Closed

Conversation

Projects
None yet
4 participants
@kimchy
Copy link
Member

kimchy commented Jul 21, 2014

closes #6893

@kimchy kimchy added review labels Jul 21, 2014

@@ -65,16 +65,12 @@ public AggregatorFactory parse(String aggregationName, XContentParser parser, Se
currentFieldName = parser.currentName();
} else if (vsParser.token(currentFieldName, token, parser)) {
continue;
} else if (token == XContentParser.Token.VALUE_NUMBER) {
} else if (token.isValue()) {
if ("interval".equals(currentFieldName)) {
interval = parser.longValue();

This comment has been minimized.

Copy link
@clintongormley

clintongormley Jul 21, 2014

Member

To coerce, should be:

parser.longValue(true);
}
} else if (token == XContentParser.Token.VALUE_NUMBER) {
if (PRECISION_THRESHOLD.match(currentFieldName)) {
} else if (PRECISION_THRESHOLD.match(currentFieldName)) {
precisionThreshold = parser.longValue();

This comment has been minimized.

Copy link
@clintongormley

clintongormley Jul 21, 2014

Member

same here:

 parser.longValue(true);
@kimchy

This comment has been minimized.

Copy link
Member Author

kimchy commented Jul 21, 2014

@clintongormley the default is to coarse....

@clintongormley

This comment has been minimized.

Copy link
Member

clintongormley commented Jul 21, 2014

Ok - right - just checked the code. never mind me :)

@martijnvg

This comment has been minimized.

Copy link
Member

martijnvg commented Jul 21, 2014

LGTM

@kimchy kimchy closed this in 8dca4b7 Jul 21, 2014

@kimchy kimchy deleted the kimchy:better_string_number_parsing_aggs branch Jul 21, 2014

kimchy added a commit that referenced this pull request Jul 21, 2014

@jpountz jpountz removed the review label Jul 24, 2014

@clintongormley clintongormley changed the title More lenient type parsing in histo/cardinality aggs Aggregations: More lenient type parsing in histo/cardinality aggs Sep 8, 2014

@clintongormley clintongormley changed the title Aggregations: More lenient type parsing in histo/cardinality aggs More lenient type parsing in histo/cardinality aggs Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.