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

harmonize h3PointDist* error messages #64080

Merged
merged 2 commits into from
May 20, 2024

Conversation

yohannj
Copy link
Contributor

@yohannj yohannj commented May 17, 2024

When error msg in getReturnTypeImpl would print

Illegal type Int8 of argument 0 of function h3PointDistM. Must be Float64

Error msg in executeImpl would print

Illegal type Int8 of argument 1 of function h3PointDistM. Must be Float64

This PR ensures both messages are the same, and choose to follow the error message in executeImpl.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

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/

Modify your CI run

NOTE: If your merge the PR with modified CI you MUST KNOW what you are doing
NOTE: Checked options will be applied if set before CI RunConfig/PrepareRunConfig step

Include tests (required builds will be added automatically):

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with Analyzer
  • All with Azure
  • Add your option here

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • Add your option here

Extra options:

  • do not test (only style check)
  • disable merge-commit (no merge from master before tests)
  • disable CI cache (job reuse)

Only specified batches in multi-batch jobs:

  • 1
  • 2
  • 3
  • 4

@alexey-milovidov alexey-milovidov self-assigned this May 18, 2024
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 18, 2024
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 18, 2024
@robot-clickhouse-ci-2
Copy link
Contributor

robot-clickhouse-ci-2 commented May 18, 2024

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

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

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
ClickHouse build checkBuilds ClickHouse in various configurations for use in further steps. You have to fix the builds that fail. Build logs often has enough information to fix the error, but you might have to reproduce the failure locally. The cmake options can be found in the build log, grepping for cmake. Use these options and follow the general build process❌ failure
Mergeable CheckChecks if all other necessary checks are successful❌ failure
Successful checks
Check nameDescriptionStatus
A SyncThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ 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

@@ -49,7 +49,7 @@ class FunctionH3PointDist final : public IFunction
throw Exception(
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT,
"Illegal type {} of argument {} of function {}. Must be Float64",
arg->getName(), i, getName());
arg->getName(), i + 1, getName());
Copy link
Member

Choose a reason for hiding this comment

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

We could use FunctionArgumentDescriptor (src/Functions/FunctionHelpers.cpp) which does all the validation based on an descriptor struct. This would also guarantee consistent error messages (across all functions using FunctionArgumentDescriptor).

Copy link
Contributor Author

@yohannj yohannj May 19, 2024

Choose a reason for hiding this comment

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

That would indeed be a lot better!

Looks like validateArgumentType is currently used in in geohash functions, and I don't see any usage of validateArgumentsImpl.
From what I previously saw in the codebase, that could be applied for most functions (there are exceptions like hascolumnintable or some functions that accepts 1 or 3 parameters).
So I suppose either it's done from time to time (like in this PR), or a single PR updates the different functions.

I never learnt how to code in cpp, so when contributing to the codebase, I'd rather stay in fixing typo and other minor things.
I don't feel comfortable introducing that change in this PR myself.

@alexey-milovidov alexey-milovidov merged commit 7921b74 into ClickHouse:master May 20, 2024
19 of 27 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label May 20, 2024
@yohannj yohannj deleted the h3PointDistErrorMsg branch May 24, 2024 09:05
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-not-for-changelog This PR should not be mentioned in the changelog 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.

None yet

5 participants