Skip to content

Commit

Permalink
Merge pull request #1 from sasamuku/workaroud_for_decimal_point_missing
Browse files Browse the repository at this point in the history
Support float value without decimal point
  • Loading branch information
sasamuku authored Dec 21, 2023
2 parents 1adde64 + 833ad74 commit fab0eeb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,13 @@ else if (Types.DOUBLE.equals(expandedJsonColumn.getColumn().getType())) {
pageBuilder.setDouble(expandedJsonColumn.getColumn(), value.asFloatValue().toDouble());
}
catch (MessageTypeCastException e) {
throw new JsonValueInvalidException(String.format("Failed to parse '%s' as double", expandedJsonColumn.getKey()), e);
try {
// ad-hoc workaround for decimal point missing
pageBuilder.setDouble(expandedJsonColumn.getColumn(), (double) value.asIntegerValue().toLong());
}
catch (MessageTypeCastException e2) {
throw new JsonValueInvalidException(String.format("Failed to parse '%s' as double", expandedJsonColumn.getKey()), e);
}
}
}
else if (Types.LONG.equals(expandedJsonColumn.getColumn().getType())) {
Expand Down

0 comments on commit fab0eeb

Please # to comment.