MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / IsRowSkipped

Method IsRowSkipped

pkg/sql/sem/tree/window_funcs.go:624–641  ·  view source on GitHub ↗

IsRowSkipped returns whether a row at index idx is skipped from the window frame (it can either be filtered out according to the filter clause or excluded according to the frame exclusion clause) and any error if it occurs.

(ctx context.Context, idx int)

Source from the content-addressed store, hash-verified

622// excluded according to the frame exclusion clause) and any error if it
623// occurs.
624func (wfr *WindowFrameRun) IsRowSkipped(ctx context.Context, idx int) (bool, error) {
625 if !wfr.noFilter() {
626 row, err := wfr.Rows.GetRow(ctx, idx)
627 if err != nil {
628 return false, err
629 }
630 d, err := row.GetDatum(wfr.FilterColIdx)
631 if err != nil {
632 return false, err
633 }
634 if d != DBoolTrue {
635 // Row idx is filtered out from the window frame, so it is skipped.
636 return true, nil
637 }
638 }
639 // If a row is excluded from the window frame, it is skipped.
640 return wfr.isRowExcluded(idx)
641}
642
643// WindowFunc performs a computation on each row using data from a provided *WindowFrameRun.
644type WindowFunc interface {

Callers 1

FrameSizeMethod · 0.95

Calls 4

noFilterMethod · 0.95
isRowExcludedMethod · 0.95
GetRowMethod · 0.80
GetDatumMethod · 0.80

Tested by

no test coverage detected