Repository navigation
Using validation function instead of manual validation for getReturnTypeImpl - #97672
Merged
scanhex12 merged 22 commits intoMar 6, 2026
Merged
Conversation
Contributor
scanhex12
approved these changes
Mar 6, 2026
| if (!isString(arguments[0])) | ||
| throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of the first argument of function {}", arguments[0]->getName(), getName()); | ||
| FunctionArgumentDescriptors mandatory_args{ | ||
| {"s", &isString, nullptr, "String"}, |
Member
There was a problem hiding this comment.
's' and 'c' seems strange, how did you get such names?
Contributor
Author
There was a problem hiding this comment.
As far i as i remember, all the arguments names are from FunctionDocumentation::Arguments listed below
scanhex12
enabled auto-merge
March 6, 2026 21:49
1 task
zlareb1
added a commit
to zlareb1/ClickHouse
that referenced
this pull request
Mar 11, 2026
PR ClickHouse#97672 replaced manual argument validation with `validateFunctionArguments` in 21 function files. The following functions had no existing tests for their error paths (wrong argument types): - `appendTrailingCharIfAbsent` - `monthName` - `conv` - `lowCardinalityIndices` / `lowCardinalityKeys` - `randomPrintableASCII` - `randomString` - `ngrams` (uses `BAD_ARGUMENTS` instead of `ILLEGAL_TYPE_OF_ARGUMENT`) - `dynamicType` Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 16, 2026
…ests Add error-path tests for functions refactored in PR #97672
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category:
Changelog entry
getReturnTypeImplfortupleConcatnow checks input using avalidateFunctionArgumentsWithVariadicsinstead of doing it manually.this closes #67447
Note
Medium Risk
Touches
getReturnTypeImplvalidation across many built-in functions; behavior should be equivalent but could subtly change accepted argument combinations and error messages/codes, affecting compatibility.Overview
Standardizes function argument validation by replacing ad-hoc checks in
getReturnTypeImplwithvalidateFunctionArguments/validateFunctionArgumentsWithVariadicsacross a set of functions (e.g.,file,now,tupleConcat, JSON/string/random/introspection helpers).Adds small reusable type predicates (notably
isLowCardinalityTypeinFunctionHelpers, plus local helpers likeisStringOrNull/isDateOrDateTime) to express expected argument types, improving consistency and reducing duplicated error-handling logic.Written by Cursor Bugbot for commit 9ccf139. This will update automatically on new commits. Configure here.