MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Window

Method Window

pkg/col/coldata/vec_tmpl.go:348–367  ·  view source on GitHub ↗

Window returns a "window" into the Vec. A "window" is similar to Golang's slice of the current Vec from [start, end), but the returned object is NOT allowed to be modified (the modification might result in an undefined behavior).

(start int, end int)

Source from the content-addressed store, hash-verified

346// allowed to be modified (the modification might result in an undefined
347// behavior).
348func (v *Vec) Window(start int, end int) *Vec {
349 switch v.CanonicalTypeFamily() {
350 // {{range .}}
351 case _CANONICAL_TYPE_FAMILY:
352 switch v.t.Width() {
353 // {{range .WidthOverloads}}
354 case _TYPE_WIDTH:
355 col := v.TemplateType()
356 return &Vec{
357 t: v.t,
358 canonicalTypeFamily: v.canonicalTypeFamily,
359 col: col.Window(start, end),
360 nulls: v.nulls.Slice(start, end),
361 }
362 // {{end}}
363 }
364 // {{end}}
365 }
366 panic(fmt.Sprintf("unhandled type %s", v.t))
367}
368
369// SetValueAt is an inefficient helper to set the value in a Vec when the type
370// is unknown.

Callers

nothing calls this directly

Calls 5

CanonicalTypeFamilyMethod · 0.95
TemplateTypeMethod · 0.95
WidthMethod · 0.65
WindowMethod · 0.65
SliceMethod · 0.45

Tested by

no test coverage detected