fix: preserve lambda grouping and dialect JSON arrows - #2646
Merged
manticore-projects merged 1 commit intoSep 20, 2026
Merged
Conversation
Contributor
|
Thank you for fixing this, silent errors like those are the worst. |
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.
A parenthesized single-parameter lambda such as
arrayMap((x) -> x * 2, [1, 2])loses its parameter parentheses when rendered, so reparsing changes its AST fromLambdaExpressiontoJsonExpression. PostgreSQL and MySQL JSON access in later function arguments can also be incorrectly classified as a lambda.Preserve explicit parameter grouping in
LambdaExpressionand share its rendering betweentoString()and the expression deparser, including the caller's body visitor. In PostgreSQL and MySQL/MariaDB presets, expression-list and parenthesized-operand arrow handling uses JSON access. Existing unparenthesized lambda rendering in the default parser remains available.Validation: Gradle
checkpassed (7498 tests, 0 failures, 0 errors, 25 skipped), including grammar ambiguity and static checks. New tests cover grouped single/multiple parameters, nesting, argument positions, custom deparsers, fast/complex parsing and missing JSON operands. Thirteen PostgreSQL/MySQL JSON fixtures and both rendered forms executed successfully on PostgreSQL 18.6 and MySQL 8.4.11 (39 executions).Syntax references: PostgreSQL JSON operators, MySQL JSON extraction, ClickHouse lambda syntax.