Skip to content

[pull] main from apache:main - #285

Merged
pull[bot] merged 2 commits into
buraksenn:mainfrom
apache:main
Jun 17, 2026
Merged

pull[bot] merged 2 commits into
buraksenn:mainfrom
apache:main

Conversation

@pull

@pull pull Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

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 : )

nathanb9 and others added 2 commits June 16, 2026 19:16
)

## Which issue does this PR close?

Closes #22769

## Rationale for this change

`LogicalPlan::Unnest` had an inconsistent API contract:
`apply_expressions()` exposed `exec_columns` but `with_new_exprs()`
rejected them via `assert_no_expressions`. This broke the standard
`node.with_new_exprs(node.expressions(), new_inputs)` pattern.

## What changes are included in this PR?

- `with_new_exprs` now accepts expressions from `apply_expressions`
(extracts `Column` values back out)
- `map_expressions` now properly transforms `exec_columns` instead of
treating Unnest as expressionless
- Removed stale comment in `extract_leaf_expressions` (semantic barrier
remains)

## Are these changes tested?

Yes — two new unit tests proving both `with_new_exprs(expressions(),
inputs)` and `with_new_exprs(vec![], inputs)` work. All existing
optimizer and SLT tests pass.

## Are there any user-facing changes?

No.

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
## Which issue does this PR close?

- Closes #9430.

## Rationale for this change

Users frequently want to pipe data into the CLI, e.g. `cat data.csv |
datafusion-cli`, but pointing `LOCATION` at `/dev/stdin` did not work:

- CSV failed with `Illegal seek` (a pipe is not seekable).
- Parquet failed with `file size of 0 is less than footer` (a pipe
reports size 0).
- JSON silently returned 0 rows.

This PR makes reading from standard input work for CSV, JSON, and
Parquet.

## What changes are included in this PR?

stdin is exposed as a `stdin://` object store, dispatched alongside the
other schemes (`s3`, `gs`, `http`, ...) in `get_object_store` —
conceptually similar to DuckDB's `PipeFileSystem`.

- `rewrite_stdin_location` maps the well-known stdin pseudo-paths
(`/dev/stdin`, `/dev/fd/0`, `/proc/self/fd/0`) to a canonical
`stdin:///stdin.<ext>` URL, so they flow through the normal
object-store/listing code path. The extension matches the declared
`STORED AS` format because the listing layer filters candidate files by
extension.
- The `stdin://` store reads all of standard input into an in-memory
object store. Buffering up front is required because a pipe is not
seekable and Parquet stores its metadata at the end of the file.

Known scope/limitations (left as potential follow-ups):
- Only `CREATE EXTERNAL TABLE` is supported (not dynamic `SELECT * FROM
'/dev/stdin'`).
- Input is fully buffered in memory, so it must fit in memory.
- stdin can only be consumed once per session.
- Unix-only (`/dev/stdin` does not exist on Windows); writing to
`/dev/stdout` is out of scope.

## Are these changes tested?

Yes:
- Unit tests in `object_storage.rs` cover `rewrite_stdin_location` and
end-to-end reads for CSV, JSON, and Parquet via the in-memory store.
- A `#[cfg(unix)]` integration test in `cli_integration.rs` drives the
real binary through an actual pipe, exercising the real stdin read.
- Manually verified all three formats via real pipes, and confirmed
normal local-file reads are unaffected.

## Are there any user-facing changes?

Yes — reading from stdin via `LOCATION '/dev/stdin'` is now supported.
Documented in `docs/source/user-guide/cli/datasources.md` (new "Reading
from standard input" section). No breaking changes.
@pull pull Bot locked and limited conversation to collaborators Jun 17, 2026
@pull pull Bot added the ⤵️ pull label Jun 17, 2026
@pull
pull Bot merged commit 96a6096 into buraksenn:main Jun 17, 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.

2 participants