Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix has() function with Nullable column #61249

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

mkmkme
Copy link
Contributor

@mkmkme mkmkme commented Mar 12, 2024

Previous implementation didn't check for null_map when the given argument was not Null. This commit adds the missing check.

Fixes #60214

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix has() function with Nullable column (fixes #60214)

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

Previous implementation didn't check for `null_map` when the given
argument was not `Null`. This commit adds the missing check.

Fixes ClickHouse#60214
@yariks5s yariks5s added the can be tested Allows running workflows for external contributors label Mar 12, 2024
@yariks5s yariks5s self-assigned this Mar 12, 2024
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-improvement Pull request with some product improvements label Mar 12, 2024
@robot-ch-test-poll4
Copy link
Contributor

robot-ch-test-poll4 commented Mar 12, 2024

This is an automated comment for commit 9da0360 with description of existing statuses. It's updated for the latest CI running

⏳ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
Docs checkBuilds and tests the documentation✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending

Comment on lines 1 to 7
DROP TABLE IF EXISTS 00662_has_nullable;
CREATE TABLE 00662_has_nullable(a Nullable(UInt64)) ENGINE = Memory;

INSERT INTO 00662_has_nullable VALUES (1), (Null);
SELECT a, has([0, 1], a) FROM 00662_has_nullable;

DROP TABLE 00662_has_nullable;
Copy link
Member

Choose a reason for hiding this comment

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

Would be also good to add more tests cases (more values in nullable table, put nullable arguments as left/both arguments in has() function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yariks5s also JFYI the cases you described actually exist in https://github.com/ClickHouse/ClickHouse/blob/master/tests/queries/0_stateless/00662_array_has_nullable.sql

I was thinking about expanding it instead of writing the new file, but that test didn't have any table creation, hence I decided to create a new one.

@yariks5s yariks5s merged commit 24d6dcb into ClickHouse:master Mar 13, 2024
8 of 10 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function 'has' works incorrectly with 'Nullable' columns
4 participants