Propagate lambda bindings into `try` operator by Mytherin · Pull Request #23375 · duckdb/duckdb · GitHub
Skip to content

Propagate lambda bindings into try operator - #23375

Merged
Mytherin merged 1 commit into
duckdb:v1.5-variegatafrom
Mytherin:propagatelambdabinding
Jun 19, 2026
Merged

Mytherin merged 1 commit into
duckdb:v1.5-variegatafrom
Mytherin:propagatelambdabinding

Conversation

@Mytherin

Copy link
Copy Markdown
Member

This correctly allows lambda parameters to be referenced inside the try expression.

@Mytherin
Mytherin merged commit c4770ec into duckdb:v1.5-variegata Jun 19, 2026
64 checks passed
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
…uckdb#23375)

Resolved (rerere-applied, matching the full-merge resolution):
    test/sql/error/test_try_expression.test_slow
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
This correctly allows lambda parameters to be referenced inside the
`try` expression.
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
…uckdb#23375)

Brings this change from the v1.5-variegata release branch. It overlapped
with the main/v2.0 line; the conflicts were resolved as follows:

- `test/sql/error/test_try_expression.test_slow`: kept both main's RESET ieee_floating_point_ops and variegata's lambda-parameters-inside-TRY test cases.
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
…uckdb#23375)

Brings this change from the v1.5-variegata release branch; it overlapped with
the main/v2.0 line and was resolved as follows:

- `test/sql/error/test_try_expression.test_slow`: kept both main's RESET ieee_floating_point_ops and variegata's lambda-in-TRY test cases.
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
Merge the v1.5-variegata release branch (323 commits since the 40721d5
merge-base) into the main/v2.0 line. ~55 files conflicted, almost entirely
because release-branch backports re-landed fixes that main had implemented
independently (often against a newer API), plus a few genuine feature/security
additions only on the release branch.

Conflict resolutions (grouped):

Already-in-main (took main, dropped the duplicate backport):
- external_file_cache refactor: main split the monolithic files into
  external_file_cache/; variegata's memleak/generation/disablement commits are
  the same upstream work (PR duckdb#22857, duckdb#22961) against the old layout -> dropped.
- autocomplete transform_expression.cpp: the empty-subscript guard was promoted
  into the core PEG parser (src/parser/peg/.../transform_expression.cpp) -> dropped.
- query_profiler.cpp: main re-architected the profiler; the null-deref fix
  variegata added to the old switch already exists in RenderProfilingNodeTree.
- list_select.cpp: the OOB child_idx guard already exists in main.
- bind_pivot.cpp duckdb#21931: main's restructured ExtractUnpivotEntries already
  guards against binding a non-existent expr.
- bind_operator_expression.cpp duckdb#23375: main reuses the current binder via an
  inside_try flag, so lambda bindings are already in scope inside TRY(...);
  variegata's TryOperatorBinder + explicit lambda propagation is unnecessary.
  (variegata's lambda-in-TRY tests are kept to prove this.)
- arrow_type_extension.cpp Bool8: main's VectorIterator/Writer already resolve
  dict/constant/sliced sources via ToUnifiedFormat.

Ported variegata's fix into main's newer API:
- geometry_stats.cpp: ported strip_geometry_cast (CRS-erasing cast look-through)
  to GetChildren()/GetReturnType()/GetValue(); CanPruneXY relax-pruning merged.
- alprd_scan.hpp / rle.cpp: ported variegata's out-of-bounds-read hardening
  (bounds checks + IOExceptions) onto main's GetDatabase()/GetBlockHandle()/
  GetDataMutable() API and member-pointer RLE scan state.
- variant_binary_decoder.cpp: kept variegata's bounds-checked
  (data, offset, data_size) decode signatures (the merged header), folded in
  main's TIMESTAMPTZNS handling and includes.
- multi_file_column_mapper.cpp duckdb#23354: kept main's static MapColumnMap
  (MultiFileLocalIndex) and added variegata's IsInvalidMapKeyDefault NULL-MAP-key
  guard.
- json: kept main's 3-field DefaultMacro layout + json_copy_strftime macros, but
  folded in variegata's "reject NULL json key" behavior (json_group_object macro
  + AddKeyValuePairs throw).

Took main's newer architecture (variegata's old-API version superseded):
- physical_table_scan.cpp: main's TableFunctionGetMetricsInput get_metrics.
- parquet_reader.hpp/.cpp: main's row_groups_read/skipped + prefetch cost model
  (subsumes variegata's row_groups_scanned); resolved a diff3-garbled hunk.
- parquet_writer.cpp: main's options/transform handling within variegata's
  MatchesTypes two-loop InitializePreprocessing structure.
- date_part.cpp: main's executor-count-removal kept; took variegata's 3-param
  PropagateSimpleDatePartStatistics<MIN,MAX,T> calls (matches merged definition).
- struct_data.cpp: variegata's AppendChild (adopted across the merged appenders).

Config / version data (union or main):
- version_map.json + regenerated storage_info: union of v1.5.4 (68/7) and
  v2.0.0 (69/8); latest/default follow v2.0.
- extension .cmake pins: kept main's v2.0-compatible tags + APPLY_PATCHES.
- force_storage.json: kept main's sections, added variegata's geometry_shred_more.
- NotifyExternalRepositories.yml / enable_verification_for_debug.json: honored
  main's deletion/restructuring.

Tests: kept variegata's lambda-in-TRY cases, PIVOT special-key serialization,
and PRAGMA enable_verification additions.

--- Compile & behaviour adaptations (so the merge builds and the full suite is green) ---

- Parquet metrics (duckdb#23140): exposed variegata's row-group scan metrics through
  main's TableFunctionGetMetricsInput API (single ParquetScanGetMetrics reading
  row_groups_read/skipped); dropped the duplicate old-API ParquetGetMetrics.
- geometry_stats.cpp (duckdb#23140): looked through CRS-erasing GEOMETRY casts via
  BoundCastExpression::Child() (the child member is private on main).
- geometry_parquet_pushdown.test (duckdb#23140): ported to main's profiler API
  (SET tracked_metrics with dotted names + JSON navigation), asserting the
  deterministic row_groups_scanned (total_row_groups_to_scan is a racy per-thread count).
- parquet_writer.cpp (duckdb#23234): bound the transform-data re-initialization to
  main's ParquetWriterOptions::sql_types (options.sql_types).
- Arrow AppendChild (duckdb#23190): AppendChild() takes a const Vector& and References
  it into a mutable local before the extension's duckdb_to_arrow cast, so the
  struct/array appenders can pass main's const children.
- pivotref.cpp (duckdb#23162): serialized PIVOT GROUP BY via
  WriteOptionallyQuoted(groups[i].GetIdentifierName()) for main's Identifier type.
- date_part.cpp (duckdb#23254): kept variegata's infinity-aware
  PropagateSimpleDatePartStatistics body but used main's authoritative
  second/minute/week/ms/us/ns upper bounds (59/53/...), not the leap-second 60/54.
- alprd_corrupted_dict_size.test (duckdb#23100): main's stricter exceptions_count guard
  fires first for the corrupt fixture, so the test now expects main's
  "ALPRD exceptions_count exceeds vector size" message (both guards kept).
krlmlr pushed a commit to krlmlr/duckdb that referenced this pull request Jun 21, 2026
…uckdb#23375)

Brings this change from the v1.5-variegata release branch; it overlapped with
the main/v2.0 line and was resolved as follows:

- `test/sql/error/test_try_expression.test_slow`: kept both main's RESET ieee_floating_point_ops and variegata's lambda-in-TRY test cases.
kaka11chen pushed a commit to kaka11chen/astrovela_vane that referenced this pull request Aug 14, 2026
This correctly allows lambda parameters to be referenced inside the
`try` expression.

Upstream-Commit: duckdb/duckdb@c4770ec
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