Github user fhueske commented on the pull request:
https://github.com/apache/flink/pull/566#issuecomment-94722161
Your PR changes the semantics of the Integer parsers a bit because you
ignore whitespaces. This change has a few implications. The following fields
are parsed as correct Integer values:
- `" 123 "`
- `"- 123"`
- `"1 2 3"`
but the following is not accepted:
- `" -123"`
This behavior is not expected, IMO.
I know that `Double.parseDouble()` and `Float.parseFloat()` both ignore
leading and tailing white spaces and the intention of this PR is to make the
parsing of floating point and integer numeric values consistent.
Instead of accepting leading and tailing white space in the Integer
parsers, I propose to check for leading and tailing whitespaces in floating
point fields and make these parsers fail in such cases. This would also give
consistent parsing behavior.
What do you think?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---