Skip to content

feat: support explicit emits for passthrough relations - #193

Open
wackywendell wants to merge 1 commit into
mainfrom
wendell/emit-passthrough
Open

feat: support explicit emits for passthrough relations#193
wackywendell wants to merge 1 commit into
mainfrom
wendell/emit-passthrough

Conversation

@wackywendell

@wackywendell wackywendell commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

This PR adds compact and explicit output syntax for pass-through relations:

Filter, Sort, Fetch, Set, and Cross.

For example, a Filter with an explicit output mapping can be written as:

Filter[gt($0, 0):boolean |> $1, $0]

Compact formatting remains the default. OutputOptions::show_emit and OutputOptions::verbose() select explicit formatting, preserving an explicit identity Emit mapping rather than normalizing it to Direct.

Part of #34.

Changes

  • Add => compact output and |> explicit output parsing for pass-through relations, including empty mappings written as _.
  • Format pass-through relations without an output clause for Direct, with compact => output by default and explicit |> output when requested.
  • Add OutputOptions::show_emit as the public formatting option for explicit relation output.
  • Model output formatting around the text syntax: OutputAdditions for +>, OutputMapping for |>, Emitted for compact final output, and OutputClause for their composition.
  • Document Substrait's direct-output and emit model, including input-order and direct-output-order field-reference scopes.
  • Accept and canonically format empty named-Read additions as Read[table +> _]; retain the previous blank spelling as accepted input for now.

API Impact

  • OutputOptions now exposes show_emit: bool.
  • OutputOptions::verbose() sets show_emit to true.

Validation

  • just test
  • just check

@wackywendell
wackywendell force-pushed the wendell/emit-passthrough branch 7 times, most recently from ae3d5f9 to 2e3e615 Compare July 29, 2026 17:48
@wackywendell
wackywendell marked this pull request as ready for review August 5, 2026 17:40
@wackywendell
wackywendell requested a review from a team as a code owner August 5, 2026 17:40
@wackywendell
wackywendell marked this pull request as draft August 5, 2026 17:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e3e615e64

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/parser/expression_grammar.pest Outdated
Comment thread GRAMMAR.md
@wackywendell
wackywendell force-pushed the wendell/emit-passthrough branch 2 times, most recently from 0f8f140 to 5e14c7c Compare August 5, 2026 18:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b146a39153

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/textify/rels.rs
Comment on lines +163 to +167
for (position, &index) in self.0.iter().enumerate() {
if position > 0 {
write!(w, ", ")?;
}
write!(w, "{}", ctx.display(&Value::Reference(index)))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate explicit emit mappings before writing references

When show_emit/OutputOptions::verbose() is used on a Filter/Sort/Fetch/Set/Cross protobuf whose RelCommon.Emit contains an out-of-range or negative index, this explicit path writes $N directly and records no FormatError; the compact Emitted path still checks the index against the direct output, so the same malformed input can silently produce invalid text only in the new explicit output mode. Please make this path perform the same bounds check while still best-effort formatting.

AGENTS.md reference: AGENTS.md:L57-L58

Useful? React with 👍 / 👎.

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