-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolumn.go
More file actions
37 lines (30 loc) · 897 Bytes
/
Copy pathcolumn.go
File metadata and controls
37 lines (30 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package fuse
import fusegen "github.com/declaredata/fuse_go/gen"
type Column interface {
// Name returns the current name of this column
Name() string
// toColumn converts this Column to a gRPC-compatible Column. it is
// purposefully not exported. clients of the fuse_go library must not
// implement Column
toColumn() *fusegen.Column
}
// ExistingCol is a Column implementation that simply references a column
// that already exists in a DataFrame.
//
// Call either the Col or DataFrame.Col functions to create one of these.
type ExistingCol struct {
name string
}
var _ Column = &ExistingCol{name: ""}
func Col(name string) *ExistingCol {
return &ExistingCol{name: name}
}
func (e *ExistingCol) Name() string {
return e.name
}
func (e *ExistingCol) toColumn() *fusegen.Column {
return &fusegen.Column{
ColSpec: &fusegen.Column_ColName{ColName: e.name},
Window: nil,
}
}