Skip to content

Declarative function signatures, continuation of #3775 - #104948

Merged
alexey-milovidov merged 444 commits into
masterfrom
function-signatures-2026
Oct 16, 2026
Merged

alexey-milovidov merged 444 commits into
masterfrom
function-signatures-2026

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented May 14, 2026 •

Copy link
Copy Markdown
Member

This is an experimental continuation of #3775 (2018) by @alexey-milovidov, which proposed a declarative way to describe function signatures so that argument validation and return-type inference can be driven by a small DSL instead of hand-written getReturnTypeImpl logic per function.

What's in this branch

A getSignatureString() method on IFunction and IFunctionOverloadResolver. When a function exposes a non-empty signature, the base getReturnTypeImpl(ColumnsWithTypeAndName) parses and applies it via a small grammar of type matchers (UInt, Number, Array(T), MaybeNullable(T), Function((args), R), T : Any capture, …) and type functions (leastSupertype, nativeNumber, aggregateFunctionReturnType(AggregateFunction(name, …)), subcolumnTypeOf, typeFromString, DateTime64(scale, tz), …). The DSL supports variadic positions (…), ellipsis grouping for repeated argument units (T1, V1, … repeats the pair), OR between alternatives, optional positions [T], const-value capture (const name String), lambdas, etc.

The grammar / parser / type matchers / type functions live under src/DataTypes/FunctionSignature.h, FunctionSignature.cpp, TypeMatchers.cpp, TypeFunctions.cpp.

Coverage

~191 commits on top of master, each is a small per-family round titled Function signatures: round N — …. Current state on this branch:

SELECT count(*) AS total,
       countIf(signature != '') AS with_sig,
       round(countIf(signature != '') * 100.0 / count(*), 1) AS pct
FROM system.functions
WHERE NOT is_aggregate AND alias_to = '' AND origin = 'System';

1416  1395  98.5

(With `allow_experimental_nlp_functions = 1`; the few remaining unset ones are setting / config-gated functions like `aiClassify`, `region*`, `synonyms`, whose `create` throws unless the relevant config block / setting is present, so `system.functions.tryGet` returns null even though the signature is in source. With the right config + setting they all surface — verified in tmp/ test config.)

Roughly:

  • Authoritative (DSL drives type-check and return type, the legacy getReturnTypeImpl is either gone or bypassed): higher-order array functions (arrayMap, arrayFilter, arrayFirst*, …), toIntervalX, comparison, multiSearch* / multiMatch*, vector L-norms / distances / dot product, UUIDv7ToDateTime, arrayReduce / arrayReduceInRanges, reverse, mapKeys / mapValues, getSubcolumn, the least / greatest resolver, paired-variadic timeSeriesTagsToGroup / timeSeriesStoreTags, …
  • Documentation-only (signature surfaced via system.functions but the legacy getReturnTypeImpl still runs because the result type uses promotion / widening / setting-dependent dispatch the current DSL can't express): arithmetic (plus, minus, multiply, divide, modulo / intDiv family), array widening (arraySum / arrayCumSum* / arrayDifference), mapContains*Like, dateTrunc, toStartOfWeek, parseDateTime*, transform, range, toX conversions, etc.

There is a signature_documentation opt-in alongside signature in the binary-arithmetic, unary-arithmetic, FunctionArrayMapped, and FunctionMapToArrayAdapter families specifically so a function can advertise a signature without the DSL accidentally hijacking the legacy widening logic.

Status

Draft / experimental.

  • This is an experiment — I'm not asking for it to be merged. There's significant disruption (191 commits touching every function family), and the gain is mostly documentation: today only ~30% of the converted functions are actually DSL-authoritative; the rest are decorative. The arithmetic promotion matrix and the per-Op widening rules in particular would need a richer type-function vocabulary (or new matchers) before they can be expressed declaratively.
  • The branch has been kept rebased on master throughout and builds cleanly. I've run the stateless test suite on each round. The pre-existing-on-master test failures I hit are listed in commit messages of the rounds where I encountered them (none introduced by this work).
  • The original PR has been open since 2018 — this branch is intended as a concrete data point on "what fraction of ClickHouse functions can be reasonably described by a declarative signature, and what would the DSL need to grow to cover the rest." That's the question I'd love feedback on.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Workflow [PR]
Sync PR [sync-upstream/pr/104948]

Version info

  • Merged into: 26.11.1.20-master (included in 26.11 and later)

@alexey-milovidov alexey-milovidov changed the title Function signatures: declarative type system for SQL functions (experiment) Declarative function signatures, continuation of #3775 May 14, 2026
@Algunenano

Copy link
Copy Markdown
Member

This would also be an interesting way of supporting named arguments in all functions, so you can do arrayElement(array = [0, 1, 2]::Array(UInt8), element = 3), etc. not only positional arguments

…-2026

# Conflicts:
#	src/Common/ErrorCodes.cpp
@clickhouse-gh

clickhouse-gh Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8c05b60]

Summary: ✅


AI Review

Summary

This PR introduces declarative function signatures, uses them for return-type inference across many function families, and exposes them through system.functions. Changes are still needed: the unified toInterval conversion rejects supported source types, and the previously measured analyzer slowdown remains unresolved.

Findings

❌ Blockers

  • Supported interval conversions are rejected — src/Functions/toInterval.cpp:90. Number | StringOrFixedString | Interval excludes Enum8 and Enum16, although the old resolver accepted them and the delegated converter still supports them. For example, SELECT toInterval(CAST('a' AS Enum8('a' = 2)), 'day') previously produces 2 of type IntervalDay; the signature now rejects it with ILLEGAL_TYPE_OF_ARGUMENT. Native date/time sources are excluded by the same matcher. Preserve the delegated source domain or retain the previous return-type override.
  • The analyzer hot-path regression remains unaddressed — src/Functions/IFunction.cpp:1048–1094. [dismissed by author -- https://github.com/Declarative function signatures, continuation of #3775 #104948#discussion_r4168713318] The author deferred this to a human design decision; the per-resolution global cache lookup and FunctionSignature::check remain, preserving the mechanism behind the reported 15.7–18.5% slowdown in analyzer_nested_function_resolution query 0. Optimize that path or retain the handwritten resolvers for hot families. Any result cache must account for constant values and constness as well as argument types.
Tests
  • ⚠️ Add a stateless regression test for toInterval with Enum8 and Enum16 sources, comparing the unified conversion with its corresponding toInterval* conversion.
  • ⚠️ Provide a focused before/after measurement of analyzer_nested_function_resolution on the final head to demonstrate that the reported slowdown is resolved.
Missing context / blind spots
  • ⚠️ No local ClickHouse binary or configured build was available. The new conversion finding is based on tracing the baseline resolver and the current matcher, dispatch, and numeric conversion; the SQL reproduction was not executed locally. The performance-report helper also could not complete without a ClickHouse binary, so the slowdown figures above are the existing measurements acknowledged in the review discussion.
Final Verdict

⚠️ Request changes. Preserve the supported toInterval source types with regression coverage, and resolve the analyzer slowdown with focused measurements before merging.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 14, 2026
Comment thread src/Functions/FunctionsCodingUUID.cpp Resolved
alexey-milovidov and others added 6 commits May 14, 2026 23:23
`useable` → `usable`. From the "codespell" style check in PR #104948
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The `WithContext` style guard is intended to prevent `Functions/*` from
holding a copy of the query context that may expire under MergeTree
default expressions and async inserts. The four entries added here
deliberately use `WithContext` only to defer query-context lookup to
`executeImpl` so the function can be instantiated by `system.functions`
(which only reads `getSignatureString`) without a query context. All
four are non-deterministic and are not used in default expressions, so
the original concern does not apply.

From the "various" style check in PR #104948
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
These 29 functions previously declared error codes for hand-written
argument validation in `getReturnTypeImpl`. With the declarative
signature DSL, type-mismatch and arity checks are produced by
`applyFunctionSignature`, so the local `extern const int`
declarations are no longer referenced.

From the "cpp" style check in PR #104948
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`bugprone-empty-catch` is enforced in `arm_tidy`. The catch in
`fillRow` is intentional: some functions throw on construction unless
specific settings are enabled (e.g. deprecated / error-prone functions),
and `system.functions` should still list them — just with an empty
`signature` column. Annotate the catch with `NOLINT(bugprone-empty-catch)`
to match the convention used in `TCPHandler.cpp`,
`CacheDictionaryUpdateQueue.cpp` and other places where construction-
failure swallowing is intentional.

From the "arm_tidy" build in PR #104948
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`Nullable(LowCardinality(T))` is not a valid SQL type — the well-formed
nullable shape for a `LowCardinality(T)` argument is
`LowCardinality(Nullable(T))`. Use `makeNullableOrLowCardinalityNullable`
to mirror what hand-written `getReturnTypeImpl` implementations do for
functions affected by `join_use_nulls`, `FULL JOIN`, `SEMI LEFT JOIN`
on `LowCardinality` columns, `isNullable` on `toNullable(toLowCardinality(...))`,
and similar cases.

Fixes failures such as `01410_nullable_key_and_index_negate_cond`,
`01049_join_low_card_crash`, `02007_join_use_nulls` etc. from the
fast-test report in PR #104948
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Several call sites reach `IFunction::getReturnTypeImpl` through the
`DataTypes` overload directly:

- `Analyzer/Resolve/resolveFunction.cpp` constructs a placeholder
  `FunctionToFunctionBaseAdaptor` for `FunctionExists` (correlated
  `EXISTS` decorrelation) and calls `getReturnTypeImpl(DataTypes{})`
  to fill in the return type.
- MergeTree text-index pruning synthesizes a `like` call when expanding
  `mapContainsKeyLike` / `mapContainsValueLike` to drive
  `MergeTreeIndexConditionText`, and resolves its return type via the
  same overload.

Without this fix the `DataTypes` overload throws `NOT_IMPLEMENTED` even
when the function exposes a non-empty `getSignatureString`, breaking
`02346_text_index_map_support`, `02346_text_index_hint_map`,
`03413_analyzer_correlated_subqueries_bug_2` and similar tests in the
PR #104948 fast-test report
(#104948).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Comment thread src/Functions/extractAllGroups.h Resolved
Comment thread src/Functions/now64.cpp Resolved
Comment thread src/Functions/toTimezone.cpp Resolved
Comment thread src/Functions/FunctionUnixTimestamp64.h Resolved
…-2026

# Conflicts:
#	src/Functions/array/FunctionsMapMiscellaneous.cpp
Style check on #104948 reported
~30 `extern const int <CODE>;` declarations that became unused after the
function-signature DSL replaced the hand-written argument validation in
those functions. Drop each unused declaration; remove the empty
`namespace ErrorCodes` block from `svg.cpp` where it was the only entry.
Three signature corrections requested in PR review:

- `FunctionSpaceFillingCurve.h`: the tuple form of `mortonEncode` /
  `hilbertEncode` only required `TupleOfSize(N)` and let any element type
  through. Switched to `Tuple(NativeUInt, …)` so the per-element type is
  enforced at type-check time, matching the legacy `getReturnTypeImpl`.

- `FunctionsCodingUUID.cpp`: `parseVariant` reads the optional second
  argument via `getInt(0)`, so the signature's `[Any]` was too wide. Narrowed
  to `[Integer]` on `UUIDNumToString`, `UUIDStringToNum`, `UUIDToNum`.

- `extractAllGroups.h`: the regexp is read as a constant in `executeImpl`
  (`getValue<String>` on a `ColumnConst`), so the second argument must be
  `const StringOrFixedString`, not just `StringOrFixedString`.
Three functions had their declarative signatures advertise a hard
`const tz StringOrFixedString` argument while the legacy code respected the
`allow_nonconst_timezone_arguments` setting: with the setting enabled, a
non-constant timezone is accepted and the result is tz-less
`DateTime` / `DateTime64`. After the refactor, that path was lost — the
resolver no longer kept the setting from `Context`.

Restore the legacy `getReturnTypeImpl` override for `now64`, `toTimezone`,
and `FunctionFromUnixTimestamp64`, keeping the setting and calling
`extractTimeZoneNameFromFunctionArguments` with it. Drop the declarative
signature for these — setting-gated argument constness is one of the
exclusions noted in the PR description.
`FunctionExists` is a marker — the analyzer constructs it for correlated
EXISTS and the JOIN planner replaces it; it is never executed. Resolving
the function in `resolveFunction.cpp` calls
`function_exists->getReturnTypeImpl(DataTypes{})` with empty args because a
subquery has no regular column type. After the declarative-signature switch
the default base-class path runs the DSL and rejects 0 args against
`(Any) -> UInt8`, breaking every correlated EXISTS query
(`tests/queries/0_stateless/03315_analyzer_correlated_subqueries.sql`).

Override `getReturnTypeImpl(const DataTypes &)` to return `UInt8` directly,
restoring the marker semantics while keeping the declarative signature for
`system.functions` display.

Also update `02117_show_create_table_system.reference`: `system.functions`
now exposes the `signature` column.
Comment thread src/Functions/coalesce.cpp Resolved
Comment thread src/Functions/multiIf.cpp Resolved
Comment thread src/Functions/financial.cpp Resolved
alexey-milovidov and others added 2 commits May 15, 2026 14:47
The declarative function signatures replaced the manual type-checking
code in many functions, leaving `extern const int ...;` declarations
that the style check now flags as unused.

Also reword the `Empty variable name` exception message in
`FunctionSignature.cpp` to avoid the `Logical error:` literal that the
style check rejects (the exception is already coded as LOGICAL_ERROR).

CI report: #104948

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
When a `const` matcher position in a declarative signature receives a
non-constant column, the framework was throwing
`ILLEGAL_TYPE_OF_ARGUMENT`. Several existing tests annotate this case
with `serverError ILLEGAL_COLUMN`, matching the legacy code thrown by
hand-written checks. Detect the "but it is not constant" suffix and
surface `ILLEGAL_COLUMN` in that case.

Affected tests include `01246_extractAllGroupsVertical`,
`01277_random_fixed_string`, and `03130_generateSnowflakeId`.

CI report: #104948

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
… arguments as `const`

- Widen the timezone argument from `const String` to `const StringOrFixedString` in the
  signatures of `ULIDStringToDateTime`, `UUIDv7ToDateTime`, the `toDateTime*Or{Zero,Null}` /
  `parseDateTime*BestEffort*` family, `makeDateTime`, `makeDateTime64`,
  `YYYYMMDDhhmmssToDateTime` and `YYYYMMDDhhmmssToDateTime64`, matching the legacy resolvers.
- Mark constant-only arguments as `const` in the signatures of `substringIndex`, `lemmatize`,
  `roundDown`, `__patchPartitionID`, `minSampleSizeContinuous` and `minSampleSizeConversion`,
  so non-constant arguments are rejected during analysis again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Status update (2026-10-12, automated pass on head 1573ae56 → cc4ac154):

  • Addressed eight open clickhouse-gh review threads (commit cc4ac15):
    • Timezone arguments are const tz StringOrFixedString again (as in the legacy resolvers) in ULIDStringToDateTime, UUIDv7ToDateTime, the toDateTime*Or{Zero,Null} / parseDateTime*BestEffort* family, makeDateTime, makeDateTime64, YYYYMMDDhhmmssToDateTime and YYYYMMDDhhmmssToDateTime64.
    • Constant-only arguments are marked const in substringIndex, lemmatize, roundDown, __patchPartitionID, minSampleSizeContinuous and minSampleSizeConversion.
    • New test 05362_function_signatures_fixed_string_tz_and_const_args; updated the reference of 04522_function_signatures_conversion_tokenizer_const_args. Both pass locally on a fresh build.
  • Still open, needs a human decision: the analyzer hot-path regression thread on applyFunctionSignature (analyzer_nested_function_resolution).

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Status update (2026-10-13, automated pass on head cc4ac154 → 65910910):

  • The only CI failure was Fast test: 05362_function_signatures_fixed_string_tz_and_const_args calls ULIDStringToDateTime (and lemmatize), which are not in the fast test build. I tagged the test no-fasttest.
  • Merged master with no conflicts. The new functions from master (divideExact, __divideIntegers, the arrayPackBits* family) have no declarative signature yet, and they keep their legacy resolvers.
  • Built clickhouse locally and ran the function-signature, exact-division and arrayPackBits stateless tests: 38 passed. 05300_exact_division_for_integers_distributed failed only because my local server config doesn't enable process_query_plan_packet.
  • No review threads are open.

Comment thread src/Functions/IFunction.cpp Resolved
alexey-milovidov and others added 2 commits October 13, 2026 16:55
…zone check

The empty-timezone guard in `FunctionDateOrDateTimeToDateTimeOrDateTime64`,
`FunctionDateOrDateTimeToDateOrDate32` and `FunctionDateOrDateTimeToSomething`
called `extractTimeZoneNameFromFunctionArguments` before the signature was
applied, so a 2nd argument of a wrong type (e.g. `toStartOfHour(dt, 1)`) was
reported by the timezone extractor as `ILLEGAL_COLUMN` instead of
`ILLEGAL_TYPE_OF_ARGUMENT`. Apply the signature first.

Address review: #104948 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Status update (2026-10-13, automated pass on head 65910910 → f53457da):

  • CI: the only failure was Stress test (amd_msan), with the logical error Cannot call function and because is has 3 arguments but 2 columns were captured (STID 2458-4cb4). This is not caused by this PR. The same error appears in fuzzer and stress jobs of many unrelated PRs, and it also hit master on 2026-10-10 and 2026-10-11. The fix is Rebuild a reduced and when pruning parts and files by virtual columns #125126 ("Rebuild a reduced and when pruning parts and files by virtual columns"), which has merged into master. I merged master (no conflicts) to bring it in.
  • Review: I addressed the clickhouse-gh thread about the eager timezone extractor. The empty-timezone check now runs after the signature, so a wrong-type 2nd argument is reported as ILLEGAL_TYPE_OF_ARGUMENT again. I added the test 05394_function_signatures_timezone_argument_type. I replied to the thread about getReturnTypeImpl(DataTypes) and the default wrappers without changing the code: the behavior matches the getReturnTypeImpl contract and is not stricter than master.
  • Still open, needs a human decision: the analyzer hot-path regression thread (memoizing applyFunctionSignature).
  • I built clickhouse locally and ran the new test, the function-signature tests and the date/time tests that check for errors, using clickhouse local. They pass, except for tests that need query_log or server config, which clickhouse local cannot provide.

Comment thread src/Functions/ifNotFinite.cpp Resolved
Comment thread src/Functions/toInterval.cpp Resolved
alexey-milovidov and others added 2 commits October 14, 2026 18:13
… narrowed it

- `ifNotFinite`: derive the result type from `if` built in the query context again,
  so it follows `use_variant_as_common_type` like `if` does; a `leastSupertype`
  signature ignored the setting.
- `toInterval`: accept an `Interval` first argument, which the delegated
  `toInterval*` conversion supports (`toInterval(toIntervalDay(1), 'hour')` = 24).
- `arrayAvg` / `arrayProduct`: accept `Enum` and `Interval` elements, as
  `ArrayAggregateImpl::getReturnType` and the executor do.
- `FunctionDateOrDateTimeToSomething`: the `Interval` branch bypasses the
  signature, so run `checkArguments` there to reject a timezone and extra arguments.
- `FunctionMapToArrayAdapter`: route the types-only `getReturnTypeImpl` to the
  adapter for documentation-only signatures, as `FunctionArrayMapped` does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Status update (2026-10-14, automated pass on head f53457da → 65b5a563):

  • CI:
    • Build (amd_release) stopped after about 19 minutes without a log or any recorded steps, and its report shows ERROR (0s). That looks like a lost runner, not a compile error; the other builds passed. The downstream amd_release jobs (Docker images, install packages, compatibility, upgrade, AST fuzzer oracle, ClickBench) failed only because that build artifact was missing.
    • test_backup_restore_on_cluster/test.py::test_shutdown_waits_for_backup is flaky on many PRs (1-4 failures per day over the last two weeks). A fix is in progress in Do not cancel the parts of ON CLUSTER backups and restores during a graceful shutdown that waits for them #124334.
  • Merged master with no conflicts.
  • Addressed the five open clickhouse-gh review threads in commit 65b5a56:
    • ifNotFinite takes its result type from if again.
    • toInterval accepts an Interval argument.
    • arrayAvg / arrayProduct accept Enum and Interval elements.
    • The Interval branch of the date-part functions rejects a timezone argument and extra arguments.
    • Map functions with documentation-only signatures no longer use the DSL result on the types-only path.
    • New test: 05397_function_signatures_review_regressions.
  • Built clickhouse locally and ran the new test, the function-signature tests and the existing tests of the touched functions: all passed. The one exception was 01710_aggregate_projection_with_normalized_states, which needs a test cluster that my local server did not define.
  • Still open and needing a human decision: the analyzer_nested_function_resolution performance regression from applyFunctionSignature (see the review thread on IFunction.cpp).

Comment thread src/Functions/bitShiftRight.cpp Resolved
Comment thread src/Functions/sign.cpp Resolved
Comment thread src/Functions/nowInBlock.cpp Resolved
Comment thread src/Functions/toInterval.cpp Resolved
alexey-milovidov and others added 2 commits October 15, 2026 15:56
… narrowed it

- `uniqThetaUnion` / `uniqThetaIntersect` / `uniqThetaNot`: the signature is
  documentation-only again, so sketches built from several `uniqTheta` arguments
  are accepted and mismatched inner-argument lists are rejected by the legacy validator.
- `numericIndexedVectorPointwise*`: the signature is documentation-only again, so
  the legacy validator rejects sketches with different index or value types
  before `executeImpl` reinterprets the second state.
- `bitShiftLeft` / `bitShiftRight` / `bitRotateLeft` / `bitRotateRight` / `bitTest`:
  the signatures are documentation-only, as in `bitAnd`, so `IPv4` / `IPv6`
  operands are accepted again.
- `sign` / `roundAge` / `roundDuration`: accept 128-bit and 256-bit integers.
- `nowInBlock`: accept a constant `FixedString` timezone.
- `toInterval`: accept a numeric `FixedString` value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Status update (2026-10-15, automated pass on head 65b5a563 → 8c05b602):

  • Merged master with no conflicts.
  • Addressed the six open clickhouse-gh review threads in commit 8c05b60:
    • uniqThetaUnion / uniqThetaIntersect / uniqThetaNot and numericIndexedVectorPointwise*: the signatures are documentation-only again, so the legacy validators (variadic uniqTheta states, matching inner types) are authoritative.
    • bitShiftLeft / bitShiftRight / bitRotateLeft / bitRotateRight / bitTest: the signatures are documentation-only, as in bitAnd, so IPv4 / IPv6 operands work again.
    • sign / roundAge / roundDuration accept wide integers. nowInBlock accepts a constant FixedString timezone. toInterval accepts a numeric FixedString.
    • New test: 05401_function_signatures_review_regressions_2.
  • CI: the only failure was Performance Comparison (arm_release, master_head, 5/6): json_string_value_formatting query Extra include for std::mt19937_64 #5 was 20% slower. That query is the formatRow('TSV', ...) scope control. This PR changes only the signature of formatRow, not its per-row execution, and the JSON queries in the same test did not move. In the last 30 days, CIDB marks the same query unstable on other PRs (Add sorted_merge and parallel_sorted_merge join algorithms #112973, Bump mongo-c-driver from 2.5.4 to 2.5.5 #124282), and none of this PR's earlier perf runs flagged it. The new CI run will measure it again.
  • I built clickhouse locally and ran 141 related stateless tests against a local server: the new test, the function-signature tests, and the tests of uniqTheta, numeric indexed vectors, bit shifts and rotations, sign, nowInBlock, toInterval and IP types. 138 passed. The 3 failures came from my local server config: missing TLD lists, no 127.0.0.2 listener, and a mismatched user_files path.
  • Still open, needs a human decision: the analyzer hot-path regression thread (memoizing applyFunctionSignature).

Comment thread src/Functions/toInterval.cpp Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member Author

This is an experiment — I'm not asking for it to be merged.

Now I think this can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-functions Built-in SQL function implementations + function infrastructure. 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.

6 participants