JSON Ingestion: Int parse of String with leading spaces is failing, and failing silently
- Dominant language
- Java
- Stars
- 6.1k
- Forks
- 1.5k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 195
Description
I'm ingesting JSON data to a realtime table. The value is a JSON String but is a numeric value with leading spaces:
{ "account":" 123", ....}
If the table column type is Double, then this record will load successfully -- it ignores the leading spaces. If the column type is Int, then the record will not load and there is no error in the server logs (or any log I can find). It fails silently. If I remove the leading spaces, then the String will load successfully as an Int.
1) When converting a JSON String value to an Int column type, whitespace needs to be trimmed prior to parsing.
2) A record ingestion should not fail silently. I'm guessing Integer.parseInt is being used and throwing a NumberFormatException that is being eaten.
Code is version 0.7.0-SNAPSHOT-e62addb3b381e89d3afe24847a1bff06e7682246
Contributor guide
Assessment
This issue has not been assessed yet.