Skip to content

refactor: add compile_window to the sqlglot compiler #1889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions bigframes/core/array_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,32 +400,6 @@ def aggregate(
)
)

def project_window_op(
self,
column_name: str,
op: agg_ops.UnaryWindowOp,
window_spec: WindowSpec,
*,
never_skip_nulls=False,
skip_reproject_unsafe: bool = False,
) -> Tuple[ArrayValue, str]:
"""
Creates a new expression based on this expression with unary operation applied to one column.
column_name: the id of the input column present in the expression
op: the windowable operator to apply to the input column
window_spec: a specification of the window over which to apply the operator
output_name: the id to assign to the output of the operator, by default will replace input col if distinct output id not provided
never_skip_nulls: will disable null skipping for operators that would otherwise do so
skip_reproject_unsafe: skips the reprojection step, can be used when performing many non-dependent window operations, user responsible for not nesting window expressions, or using outputs as join, filter or aggregation keys before a reprojection
"""

return self.project_window_expr(
ex.UnaryAggregation(op, ex.deref(column_name)),
window_spec,
never_skip_nulls,
skip_reproject_unsafe,
)

def project_window_expr(
self,
expression: ex.Aggregation,
Expand Down