Skip to content

HIVE-28503: Vectorization: concat (||) on string columns returns NULL for non-null inputs#6607

Open
maheshrajus wants to merge 2 commits into
apache:masterfrom
maheshrajus:HIVE-28503_fix
Open

HIVE-28503: Vectorization: concat (||) on string columns returns NULL for non-null inputs#6607
maheshrajus wants to merge 2 commits into
apache:masterfrom
maheshrajus:HIVE-28503_fix

Conversation

@maheshrajus

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • In StringGroupConcatColCol.evaluate(), on the "no nulls in either input" branch, set outV.noNulls = true before writing. (Matches what the sibling StringGroupColConcatStringScalar / StringScalarConcatStringGroupCol already do)
  • Added two JUnit tests in TestVectorStringConcat that pre-set outV.noNulls = false (simulating a prior batch that carried NULLs), then assert the flag is restored after evaluate()

Why are the changes needed?

The output BytesColumnVector(outV) is reused across batches. A previous batch that went through a null-carrying branch leaves outV.noNulls = false. The no-nulls branch wrote per-row isNull[i] = false but never reset outV.noNulls = true, so downstream vectorized consumers that utilizes on noNulls treated fully-populated rows as NULL and producing NULL for a || b on rows where both operands were non-null.

More code level details we can find in the jira: https://issues.apache.org/jira/browse/HIVE-28503

Does this PR introduce any user-facing change?

No

How was this patch tested?

With added unit tests

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants