8
8
"github.com/influxdata/flux/dependencies/influxdb"
9
9
"github.com/influxdata/flux/internal/errors"
10
10
"github.com/influxdata/flux/memory"
11
- influxdbiox "github.com/influxdata/influxdb-iox-client-go"
12
11
)
13
12
14
13
type key int
@@ -42,6 +41,49 @@ func GetProvider(ctx context.Context) Provider {
42
41
return p .(Provider )
43
42
}
44
43
44
+ // ColumnType defines the column data types IOx can represent.
45
+ type ColumnType int32
46
+
47
+ const (
48
+ // ColumnTypeUnknown is an invalid column type.
49
+ ColumnTypeUnknown ColumnType = 0
50
+ // ColumnType_I64 is an int64.
51
+ ColumnType_I64 ColumnType = 1
52
+ // ColumnType_U64 is an uint64.
53
+ ColumnType_U64 ColumnType = 2
54
+ // ColumnType_F64 is an float64.
55
+ ColumnType_F64 ColumnType = 3
56
+ // ColumnType_BOOL is a bool.
57
+ ColumnType_BOOL ColumnType = 4
58
+ // ColumnType_STRING is a string.
59
+ ColumnType_STRING ColumnType = 5
60
+ // ColumnType_TIME is a timestamp.
61
+ ColumnType_TIME ColumnType = 6
62
+ // ColumnType_TAG is a tag value.
63
+ ColumnType_TAG ColumnType = 7
64
+ )
65
+
66
+ func (c ColumnType ) String () string {
67
+ switch c {
68
+ case ColumnType_I64 :
69
+ return "int64"
70
+ case ColumnType_U64 :
71
+ return "uint64"
72
+ case ColumnType_F64 :
73
+ return "float64"
74
+ case ColumnType_BOOL :
75
+ return "bool"
76
+ case ColumnType_STRING :
77
+ return "string"
78
+ case ColumnType_TIME :
79
+ return "timestamp"
80
+ case ColumnType_TAG :
81
+ return "tag"
82
+ default :
83
+ return "unknown"
84
+ }
85
+ }
86
+
45
87
// RecordReader is similar to the RecordReader interface provided by Arrow's array
46
88
// package, but includes a method for detecting errors that are sent mid-stream.
47
89
type RecordReader interface {
@@ -58,7 +100,7 @@ type Client interface {
58
100
// GetSchema will retrieve a schema for the given table if this client supports that capability.
59
101
// If this Client doesn't support this capability, it should return a flux error with the code
60
102
// codes.Unimplemented.
61
- GetSchema (ctx context.Context , table string ) (map [string ]influxdbiox. ColumnType , error )
103
+ GetSchema (ctx context.Context , table string ) (map [string ]ColumnType , error )
62
104
}
63
105
64
106
// ErrorProvider is an implementation of the Provider that returns an error.
0 commit comments