Skip to content

Add aliasing support to REPL select() and group_by()#59

Merged
aisrael merged 2 commits into
mainfrom
repl-select-aliasing
Jul 1, 2026
Merged

Add aliasing support to REPL select() and group_by()#59
aisrael merged 2 commits into
mainfrom
repl-select-aliasing

Conversation

@aisrael

@aisrael aisrael commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • select() arguments (plain columns or aggregates) can be renamed via name: value keyword syntax, e.g. select(:foo, foo_bar: :bar, total: sum(:qty)). Quoted names ("name with space": value) are supported for names that aren't valid bare identifiers.
  • Works for plain projections, global aggregates, grouped aggregates, and ORC's plain-column select path.
  • group_by() keys can carry their own alias (e.g. group_by(key: :foo)), which becomes the default output name for that key. select() may refer to the key by its underlying column or by the group_by() alias; a matching select() alias takes precedence when present.

Changes

  • src/pipeline/spec.rs: parse/model aliases for select() args and group_by() keys
  • src/pipeline/record_batch.rs, src/pipeline/dataframe/transform.rs: apply aliases when building output batches/dataframes
  • src/pipeline/builder.rs, src/pipeline.rs: wire alias info through the pipeline builder
  • src/cli/repl/plan.rs, src/cli/repl/stage.rs, src/cli/repl/builder_bridge.rs, src/cli/repl/mod.rs: REPL-side plumbing for alias syntax
  • features/repl/select.feature: Cucumber scenarios covering aliasing behavior
  • docs/REPL.md, CHANGELOG.md: document the new syntax and behavior

Testing

  • cargo check --all-targets passes
  • Run cargo test and the Cucumber suite (features/repl/select.feature) to verify aliasing behavior end to end

Checklist

  • Tests pass
  • Documentation updated
  • No breaking changes

aisrael added 2 commits July 1, 2026 15:46
select() arguments (plain columns or aggregates) can now be renamed
via `name: value` / `"quoted name": value` keyword syntax. group_by()
keys can similarly carry their own alias, which becomes the default
output name unless overridden by a matching select() alias.
@aisrael aisrael merged commit dfe9738 into main Jul 1, 2026
4 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