Skip to content

[common] Fix NullPointerExceptions on null transform inputs - #9214

Open
plusplusjiajia wants to merge 1 commit into
apache:masterfrom
plusplusjiajia:common-transform-null-fixes
Open

[common] Fix NullPointerExceptions on null transform inputs#9214
plusplusjiajia wants to merge 1 commit into
apache:masterfrom
plusplusjiajia:common-transform-null-fixes

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Aug 13, 2026

Copy link
Copy Markdown
Member

Purpose

Three NullPointerExceptions on null transform inputs, all 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.
  • SubstringTransform reads a begin or length field with InternalRow.getInt without an isNullAt check. On a GenericRow that throws; on a columnar row it returns an undefined value, so the rule masks at an arbitrary offset without failing.
  • StringTransform.toString maps inputs with Object::toString and throws on a null input, which ConcatTransform and ConcatWsTransform accept.

All three change behaviour only for inputs that previously threw, so no query that previously succeeded changes its result, and nothing about the persisted JSON format changes.

@plusplusjiajia
plusplusjiajia marked this pull request as ready for review August 13, 2026 16:56
@plusplusjiajia
plusplusjiajia force-pushed the common-transform-null-fixes branch from ab5f184 to d2fce1c Compare August 13, 2026 17:51
@plusplusjiajia plusplusjiajia changed the title [common] Fix two NullPointerExceptions on null transform inputs [common] Fix NullPointerExceptions on null transform inputs Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant