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 h3 failing queries having const columns #34743

Merged
merged 4 commits into from
Feb 21, 2022

Conversation

bharatnc
Copy link
Contributor

@bharatnc bharatnc commented Feb 19, 2022

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

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

Fix bug for h3 funcs containing const columns which cause queries to fail.

Currently queries like the following containing const columns fail:

select h3ToParent(641573946153969375, arrayJoin([1,2]));
Code: 44. DB::Exception: Received from localhost:9000. DB::Exception: Illegal type UInt64 of argument 1 of function h3ToParent. Must be UInt64.. (ILLEGAL_COLUMN)

@kitaisreal actually fixed it for geoToH3 in #34731. Fixing this in all other places by converting const columns to full columns and tried adding tests.

Related: #34708

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Feb 19, 2022
@kitaisreal kitaisreal self-assigned this Feb 19, 2022
@kitaisreal
Copy link
Collaborator

@bharatnc there is segmentation fault https://s3.amazonaws.com/clickhouse-test-reports/34743/d9acbf480ca5f24af17a57b97e0efbc696075731/fuzzer_astfuzzerubsan,actions//report.html.

SELECT NULL, toFloat64('-1'), -2147483648, h3CellAreaRads2(arrayJoin([9223372036854775807, 65535, NULL]))

@bharatnc
Copy link
Contributor Author

@bharatnc there is segmentation fault https://s3.amazonaws.com/clickhouse-test-reports/34743/d9acbf480ca5f24af17a57b97e0efbc696075731/fuzzer_astfuzzerubsan,actions//report.html.

SELECT NULL, toFloat64('-1'), -2147483648, h3CellAreaRads2(arrayJoin([9223372036854775807, 65535, NULL]))

It happens only in h3CellAreaRads2 due to invalid H3 index. Added the check to prevent such segfaults and also added a test. Doesn't happen with h3CellAreaM2, but still added the same check just in case.

@kitaisreal kitaisreal merged commit 57ef720 into ClickHouse:master Feb 21, 2022
@bharatnc
Copy link
Contributor Author

@kitaisreal this fix might need backporting ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants