JingsongLi commented on code in PR #9649:
URL: https://github.com/apache/paimon/pull/9649#discussion_r3975928570
##########
paimon-common/src/main/java/org/apache/paimon/utils/DateTimeUtils.java:
##########
@@ -349,15 +349,22 @@ public static Integer parseTime(String v) {
+ milli;
}
+ /**
+ * Whether the string is a non-negative decimal integer that fits in an
{@code int}. Callers
+ * hand the string straight to {@link Integer#parseInt}, so the range
matters as much as the
+ * characters.
+ */
private static boolean isInteger(String s) {
- boolean isInt = s.length() > 0;
+ if (s.isEmpty() || s.length() > 10) {
Review Comment:
[P2] Range-check the value without rejecting leading zeros. This length
limit rejects components whose numeric value still fits an int:
parseDate("00000002024-01-01") and parseTime("00000000012:30:00") return 19723
and 45000000 on the base revision, but both return null with this change
(confirmed in an isolated base/head probe). Through
PaimonTimeObjectInspector.convert, previously accepted zero-padded TIME values
are therefore silently replaced with NULL. Ignore leading zeros for the range
check, or use an overflow-checked accumulator, and add regression coverage
alongside the genuinely out-of-range inputs.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]