You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "hoperunChen (via GitHub)" <gi...@apache.org> on 2025/01/17 01:51:02 UTC
Re: [PR] [CALCITE-6789]A NumberFormatException was thrown when performing an aggregate query on a csv file. [calcite]
hoperunChen commented on code in PR #4150:
URL: https://github.com/apache/calcite/pull/4150#discussion_r1919448067
##########
linq4j/src/main/java/org/apache/calcite/linq4j/tree/Primitive.java:
##########
@@ -427,7 +427,7 @@ static BigDecimal checkOverflow(BigDecimal value, int precision, int scale,
/** Called from BuiltInMethod.CHAR_DECIMAL_CAST_ROUNDING_MODE */
public static @Nullable Object charToDecimalCast(
@Nullable String value, int precision, int scale, RoundingMode roundingMode) {
- if (value == null) {
+ if (value == null || value.isEmpty()) {
Review Comment:
Of course, testing can be done. My test case is attached in the comments on the [Jira ticket](https://issues.apache.org/jira/browse/CALCITE-6789); you can use my example to try it out.
If it’s truly impossible to modify the method, could you provide me with a solution to my issue? The CSV file is not controlled by the program, so I cannot change the values of the titles.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org