Skip to content

Parser: port upstream #2699 for (x) -> lambda chains - #20

Merged
moshap-firebolt merged 4 commits into
firebolt/v0.63.0-patchesfrom
moshap/port-upstream-lambda
Oct 22, 2026
Merged

moshap-firebolt merged 4 commits into
firebolt/v0.63.0-patchesfrom
moshap/port-upstream-lambda

Conversation

@moshap-firebolt

@moshap-firebolt moshap-firebolt commented Oct 20, 2026 •

Copy link
Copy Markdown

Replaces the fork's own fix for (x) -> lambda chains from #18 with the upstream version, apache/datafusion-sqlparser-rs#2699. The cherry-pick of upstream apache#2619 (nested POSITION calls), also in #18, stays.

Reverts the lambda half of #18, then cherry-picks apache#2699's two commits unchanged. The src/, test and fuzz-seed changes are identical, line for line, to apache#2699; only conflict context (a neighbouring cache field, test-file tail) differs. The fork's full suite (--all-features), fmt and clippy are clean.

🤖 Generated with Claude Code


Note

Medium Risk
Touches expression-prefix dispatch and failure memoization for lambda vs binary ->, which can change parse trees on edge-case SQL; risk is mitigated by targeted regression tests and upstream parity.

Overview
Ports upstream apache#2699 for arrow lambda parsing and memoization, replacing the fork’s earlier lambda-chain fix while keeping the nested POSITION work from the same effort.

In try_parse_lambda, comments and the failure-cache key are clarified (memo_key); behavior is still to memoize failed (<params>) -> <body> attempts so long (x) -> … chains cannot trigger exponential retries when the body does not parse.

Tests are rewritten: the blowup guard uses a shorter chain and asserts every lambda-capable dialect rejects the bad SQL quickly; dispatch coverage now checks concrete AST shapes (nested lambdas, -> fallback when (1) is not a param list, cached vs uncached failure). A fuzz seed for Databricks-style lambda chains is added and excluded from RAT checks.

Reviewed by Cursor Bugbot for commit 7ff4d82. Bugbot is set up for automated code reviews on this repo. Configure here.

moshap-firebolt and others added 4 commits October 22, 2026 13:17
Upstream apache#2699 replaces it. The cherry-pick of upstream apache#2619 for nested
POSITION calls, also in #18, stays.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The seed added with the apache#2699 port is the first file under fuzz/fuzz_seeds
on this branch; upstream main already excludes the directory.
@moshap-firebolt
moshap-firebolt force-pushed the moshap/port-upstream-lambda branch from a305ce5 to 7ff4d82 Compare October 22, 2026 20:17
@moshap-firebolt
moshap-firebolt merged commit d0d7787 into firebolt/v0.63.0-patches Oct 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant