Skip to content

Conversation

@aggris2
Copy link

@aggris2 aggris2 commented Dec 12, 2025

Adds UpdateOp enum to Field proto message enabling per-field update semantics:

  • Set: Direct assignment (default, existing behavior)
  • Add: Accumulate values (col = COALESCE(col, 0) + value)
  • Max: Track maximum (col = GREATEST(col, value))
  • Min: Track minimum (col = LEAST(col, value))
  • SetIfNull: First-write-wins (col = COALESCE(col, value))

New row helper methods: set(), add(), sub(), max(), min(), set_if_null()

Includes strict transition validation - once a non-SET op is used on a field, only the same op type can follow (e.g., add() -> add() OK, add() -> max() PANIC).

Adds UpdateOp enum to Field proto message enabling per-field update semantics:
- Set: Direct assignment (default, existing behavior)
- Add: Accumulate values (col = COALESCE(col, 0) + value)
- Max: Track maximum (col = GREATEST(col, value))
- Min: Track minimum (col = LEAST(col, value))
- SetIfNull: First-write-wins (col = COALESCE(col, value))

New row helper methods: set(), add(), sub(), max(), min(), set_if_null()

Includes strict transition validation - once a non-SET op is used on a field,
only the same op type can follow (e.g., add() -> add() OK, add() -> max() PANIC).
Previously min() and max() functions would just overwrite the existing
value, delegating the LEAST/GREATEST logic to the sink. This caused
issues when set() was followed by min()/max() in the same block - the
initial value set by set() would be lost.
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