Auto-populate Int/Float Fields#257
Open
JCRPaquin wants to merge 1 commit into
Open
Conversation
kelockhart
reviewed
May 1, 2026
|
|
||
| req.getSchema().getFields().forEach((fieldName, schemaField) -> { | ||
| switch (schemaField.getType().getNumberType()) { | ||
| case FLOAT, DOUBLE -> ncm.put(fieldName, new PointsConfig(new MaxNumberFormat(Float.MAX_VALUE), Float.class)); |
Member
There was a problem hiding this comment.
It doesn't seem safe to map DOUBLE into Float - is there a good reason not to make another case statement? for DOUBLE?
| req.getSchema().getFields().forEach((fieldName, schemaField) -> { | ||
| switch (schemaField.getType().getNumberType()) { | ||
| case FLOAT, DOUBLE -> ncm.put(fieldName, new PointsConfig(new MaxNumberFormat(Float.MAX_VALUE), Float.class)); | ||
| case INTEGER, LONG -> ncm.put(fieldName, new PointsConfig(new MaxNumberFormat(Integer.MAX_VALUE), Integer.class)); |
Member
There was a problem hiding this comment.
Same comment, but for LONG - why not have another case statement to handle LONG?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Uses schema information to determine which fields should be parsed as integers/floats.
Why?
We currently use
aqp.intFieldsandaqp.floatFieldsto populate the list of fields to parse as each type. This leads to oversights where some fields don't get parsed properly because they were not added to the appropriate list. This change prevents that class of mistakes.