Skip to content

[pull] main from apache:main#102

Merged
pull[bot] merged 3 commits intoburaksenn:mainfrom
apache:main
Apr 14, 2026
Merged

[pull] main from apache:main#102
pull[bot] merged 3 commits intoburaksenn:mainfrom
apache:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull bot commented Apr 14, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

SubhamSinghal and others added 3 commits April 14, 2026 01:43
## Which issue does this PR close?
   
Related to: #13232
                                                            
  ## Rationale for this change
`EliminateOuterJoin` converts LEFT/RIGHT/FULL joins to INNER joins when
WHERE clause predicates are null-rejecting. The
`extract_non_nullable_columns` function recognizes specific expression
types but was missing several common ones: `LIKE`, `IS TRUE`, `IS
FALSE`, and `IS NOT UNKNOWN`.

  All of these are null-rejecting:
  - `NULL LIKE pattern` → NULL (filtered out)
  - `NULL IS TRUE` → false (filtered out)
  - `NULL IS FALSE` → false (filtered out)
  - `NULL IS NOT UNKNOWN` → false (filtered out)

Note: `IS NOT TRUE`, `IS NOT FALSE`, and `IS UNKNOWN` are intentionally
**not** added — they return true for NULL input, so they are not
null-rejecting.

  ## What changes are included in this PR?

  Added match arms in `extract_non_nullable_columns` for:
  - `Expr::Like`
  - `Expr::IsTrue` / `Expr::IsFalse` / `Expr::IsNotUnknown`

  ## Are these changes tested?

  Yes — 7 new unit tests:
- 5 positive cases verifying outer → inner conversion (Like, IsTrue,
IsFalse, IsNotUnknown)
- 2 negative cases verifying outer join is preserved (IsNotTrue,
IsUnknown)

  ## Are there any user-facing changes?

  No API changes.

---------

Co-authored-by: Subham Singhal <subhamsinghal@Subhams-MacBook-Air.local>
…21565)

## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->

- Closes #.

## Rationale for this change

LazyMemoryExec::execute() shares the same generator instance across
multiple calls via Arc::clone, so a second call to execute(0) continues
from where the first left off instead of starting from the beginning.
This is inconsistent with how other ExecutionPlan implementations
behave, where each execute() call produces an independent stream. This
was discovered while writing e2e tests for NestedLoopJoinExec
memory-limited execution (#21448), where the OOM fallback path
re-executes the left child plan and got incomplete results.

## What changes are included in this PR?

LazyMemoryExec::execute() was sharing the same generator instance (via
Arc::clone) across multiple calls, causing streams to share mutable
state. This meant a second call to execute(0) would continue from where
the first call left off, instead of starting from the beginning.

Fix by calling reset_state() on the generator to create a fresh instance
for each execute() call, matching the expected ExecutionPlan semantics
that each execute() produces an independent stream.

## Are these changes tested?

<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

Unit test

## Are there any user-facing changes?

No

<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->

<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
…t producer/consumer (#20977)

## Which issue does this PR close?

- Closes #20971.

## Rationale for this change

The Substrait producer previously returned `not_impl_err!` for
`Expr::Placeholder`, meaning any query plan containing parameterized
expressions (e.g. `$1`, `$2`) could not be serialized to Substrait. This
gap prevented roundtripping prepared statement plans through the
Substrait layer.

## What changes are included in this PR?

**Producer:**
- New `placeholder.rs` module with `from_placeholder` that converts
`Expr::Placeholder` to `DynamicParameter`, mapping one-based `$N`
DataFusion ids to zero-based Substrait `parameter_reference` values with
optional type information.
- `handle_placeholder` added to the `SubstraitProducer` trait.

**Consumer:**
- `consume_dynamic_parameter` converts Substrait `DynamicParameter` back
to `Expr::Placeholder`, reversing the index mapping and type conversion.

## Are these changes tested?

Yes. Five new integration tests and one unit test:

- `roundtrip_placeholder_sql_filter` — SQL-based, `WHERE a > $1`
- `roundtrip_placeholder_sql_projection` — SQL-based, `$1` in SELECT +
`$2` in WHERE
- `roundtrip_placeholder_typed_int64` — typed Int64 placeholder with
proto-level `DynamicParameter` verification
- `roundtrip_placeholder_multiple_typed` — two typed placeholders (Int64
+ Decimal128)
- `roundtrip_placeholder_typed_utf8` — Utf8 typed placeholder
- `test_parse_placeholder_index` — unit test for index parsing edge
cases

All 190 integration tests, 28 unit tests, and 3 doc-tests pass. Clippy
and fmt are clean.

## Are there any user-facing changes?

Query plans containing `Placeholder` expressions can now be serialized
to and deserialized from Substrait format. Previously this would return
an error.

Co-authored-by: Jonah Gao <jonahgao@msn.com>
@pull pull bot locked and limited conversation to collaborators Apr 14, 2026
@pull pull bot added the ⤵️ pull label Apr 14, 2026
@pull pull bot merged commit e0fd16e into buraksenn:main Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants