Skip to content

Conversation

@andygrove
Copy link
Member

Which issue does this PR close?

Follow-up to #2991.

Rationale for this change

The optimized contains implementation merged in #2991 had good test coverage but was missing a few edge cases.

What changes are included in this PR?

Adds integration tests for:

  • Null haystack (contains(NULL, 'pattern')) to verify null propagation
  • Case sensitivity (contains(name, 'james') vs 'James')
  • Both-columns path (contains(col1, col2)) exercising the array-array code path, including null in either position

How are these changes tested?

All new tests use checkSparkAnswerAndOperator to verify both correctness against Spark and that Comet's native operator is used.

🤖 Generated with Claude Code

Add test coverage for null haystack, case sensitivity, and
both-columns (array-array) path for the optimized contains
implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@andygrove andygrove marked this pull request as ready for review February 10, 2026 00:08
}
}

test("contains with both columns") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you planning also move it to sql tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe .. we have many, many tests to move over to the new approach. I guess we need to figure out a plan.

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andygrove

@andygrove andygrove merged commit 7c78fef into apache:main Feb 10, 2026
111 checks passed
@andygrove andygrove deleted the add-contains-tests branch February 10, 2026 19:41
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.

2 participants