-
Notifications
You must be signed in to change notification settings - Fork 90
/
presto_table.go
62 lines (48 loc) · 1.97 KB
/
presto_table.go
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package v1
import (
presto "github.com/operator-framework/operator-metering/pkg/presto"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var PrestoTableGVK = SchemeGroupVersion.WithKind("PrestoTable")
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PrestoTableList struct {
meta.TypeMeta `json:",inline"`
meta.ListMeta `json:"metadata,omitempty"`
Items []*PrestoTable `json:"items"`
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PrestoTable struct {
meta.TypeMeta `json:",inline"`
meta.ObjectMeta `json:"metadata,omitempty"`
Spec PrestoTableSpec `json:"spec"`
Status PrestoTableStatus `json:"status"`
}
type PrestoTableSpec struct {
// Unmanaged indicates that this table is not to be actively managed by the operator.
Unmanaged bool `json:"unmanaged"`
Catalog string `json:"catalog"`
Schema string `json:"schema"`
TableName string `json:"tableName"`
Columns []presto.Column `json:"columns"`
Properties map[string]string `json:"properties,omitempty"`
Comment string `json:"comment,string"`
// If true, uses "query" to create a view instead of a table.
View bool `json:"view,omitempty"`
// If true, uses "query" to create a table using CREATE TABLE AS.
CreateTableAs bool `json:"createTableAs,omitempty"`
Query string `json:"query,omitempty"`
}
type PrestoTableStatus struct {
Catalog string `json:"catalog"`
Schema string `json:"schema"`
TableName string `json:"tableName"`
Columns []presto.Column `json:"columns"`
Properties map[string]string `json:"properties,omitempty"`
Comment string `json:"comment,string"`
// If true, uses "query" to create a view instead of a table.
View bool `json:"view,omitempty"`
// If true, uses "query" to create a table using CREATE TABLE AS.
CreateTableAs bool `json:"createTableAs,omitempty"`
Query string `json:"query,omitempty"`
}