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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to