Skip to content

Merge RFC-001: Expression DSL Extension#148

Open
Khanathan wants to merge 6 commits into
beava-dev:mainfrom
Khanathan:RFC-001
Open

Merge RFC-001: Expression DSL Extension#148
Khanathan wants to merge 6 commits into
beava-dev:mainfrom
Khanathan:RFC-001

Conversation

@Khanathan
Copy link
Copy Markdown

@Khanathan Khanathan commented May 18, 2026

RFC-001: Expression DSL Extension

Linked issues

Related to #56

Summary

Adds rfcs/RFC-001-Expressions.md — an RFC that proposes
letting users write streaming transforms in plain Python and
expands the expression DSL with 11 new builtins. No code changes,
RFC only.

What it proposes

  • @bv.expr decorator. Write transforms with normal Python:
    if/elif/else, ternaries, and/or/not, is None,
    local variables. The decorator translates them into the
    existing DSL.
  • 11 new v0 builtins across 5 categories:
    • Math: log1p, clip
    • String: lower, contains, starts_with, ends_with, replace
    • Conditional / null: if_else, is_in
    • Time: hour_of_day
    • Hashing: hash_mod
  • Event dot-access. e.email as sugar for bv.col("email").
  • Generalized typechecking. Move per-builtin type rules from
    a hardcoded match fn_name in infer_call_type onto an
    infer fn pointer on each BuiltinFn row. Compiler enforces
    coverage.
  • CONTRIBUTING-OPS.md walking a full op contribution so
    future builtins are good-first-issues.

What it does not change

  • No new Expr / Literal variants. No grammar growth. No
    wire-format changes.

Why now

Today's DSL stops at arithmetic, comparisons, and three builtins
(cast, isnull, quadkey). Users hit the gap on basic shapes
(log/clip, lower/contains, hour-of-day, conditional branching)
and route around it with offline Python — losing the windowed
aggregations the server exists to provide. This RFC closes the
gap with the smallest possible surface change and makes future
builtins a one-row append.

@Khanathan Khanathan requested a review from petrpan26 as a code owner May 18, 2026 21:17
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