You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "plusplusjiajia (via GitHub)" <gi...@apache.org> on 2026/08/13 16:45:09 UTC

[PR] [common] Fix two NullPointerExceptions on null transform inputs [paimon]

plusplusjiajia opened a new pull request, #9214:
URL: https://github.com/apache/paimon/pull/9214

   ### Purpose
     Two `NullPointerException`s on null transform inputs, both reachable today:
   
     * `TrimTransform` reads `charsToTrim` with `toString()` before checking it for null, so a null second input throws — even though `StringUtils.ltrim/rtrim`, which it delegates to, already define a null `charsToTrim` as a null result.
     * `StringTransform.toString` maps inputs with `Object::toString` and throws on a null input, which `ConcatTransform` and `ConcatWsTransform` accept.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [common] Fix NullPointerExceptions on null transform inputs [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #9214:
URL: https://github.com/apache/paimon/pull/9214#issuecomment-5350475908

   +1


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [common] Fix NullPointerExceptions on null transform inputs [paimon]

Posted by "plusplusjiajia (via GitHub)" <gi...@apache.org>.
plusplusjiajia commented on PR #9214:
URL: https://github.com/apache/paimon/pull/9214#issuecomment-5325598921

   > `SUBSTRING('123', null)` still throws an NPE at `toString()` and does not follow SQL null propagation; consistently reproducible locally.
   
   @JingsongLi  Thanks, fixed.
   
   The old code only checked for null when the position was a FieldRef. A literal null went straight to Integer.parseInt(...) and threw. Now any null input gives null, wherever it comes from:
   
    SUBSTRING('123', null)     -> null
    SUBSTRING('123', 1, null)  -> null
   
   One change worth noting: the null check now runs before the "begin past the end" check, so SUBSTRING('123', 99, null) returns null where it used to return ''. That keeps one simple rule — null always wins — and matches Spark, whose Substring is NullIntolerant.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [common] Fix NullPointerExceptions on null transform inputs [paimon]

Posted by "plusplusjiajia (via GitHub)" <gi...@apache.org>.
plusplusjiajia closed pull request #9214: [common] Fix NullPointerExceptions on null transform inputs
URL: https://github.com/apache/paimon/pull/9214


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [common] Fix NullPointerExceptions on null transform inputs [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #9214:
URL: https://github.com/apache/paimon/pull/9214


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [common] Fix NullPointerExceptions on null transform inputs [paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #9214:
URL: https://github.com/apache/paimon/pull/9214#issuecomment-5300976877

   `SUBSTRING('123', null)` still throws an NPE at `toString()` and does not follow SQL null propagation; consistently reproducible locally.


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org