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)
| 622 | // excluded according to the frame exclusion clause) and any error if it |
| 623 | // occurs. |
| 624 | func (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. |
| 644 | type WindowFunc interface { |
no test coverage detected