Repository navigation
Conversation
yesipoff
force-pushed
the
partial-function-application-and-function-composition
branch
from
May 15, 2025 22:02
6f4842a to
b936497
Compare
Contributor
yesipoff
force-pushed
the
partial-function-application-and-function-composition
branch
from
May 16, 2025 10:19
b936497 to
2fe0eb8
Compare
Member
|
🕵 Thank you for this idea and the initial implementation! The branch had gone stale (15 months, now conflicting), so I reimplemented the feature on top of the current analyzer in #116029, which supersedes this PR: both |
alexey-milovidov
added a commit
to raimannma/ClickHouse
that referenced
this pull request
Oct 11, 2026
`f | g` parses into `compose(f, g)` and is resolved by pure rewriting into an ordinary lambda `(args...) -> g(f(args...))` during query analysis, so no runtime support is needed and the standard lambda machinery (typing, captures, execution) applies unchanged. Operands can be lambdas, names of functions, nested compositions, or expressions with the argument placeholders `_`, `_1`, `_2`, ...: `plus(_, 1)` is lifted to `_1 -> plus(_1, 1)`. Numbered placeholders work at any depth because they become the names of the lambda arguments. Outside a composition, placeholders apply in the lambda position of a higher-order function, gated the same way as the bare-function-name rewrite: the parent must report `isHigherOrderFunction` and the names must not resolve in scope, so every query the rewrite activates on is an error without it and no previously valid query changes meaning. The arity probe shared with the bare-function-name rewrite is factored into `tryGetRegisteredFunctionArity`. Continues and supersedes the approach of ClickHouse#80277 by @yesipoff. Co-Authored-By: Claude Fable 5 <[email protected]>
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 (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Implementation of partial function application and function pipelining
Documentation entry for user-facing changes