-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy patharrow.go
42 lines (36 loc) · 1.13 KB
/
arrow.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
package schema
import (
"github.com/apache/arrow-go/v18/arrow"
)
const (
MetadataUnique = "cq:extension:unique"
MetadataPrimaryKey = "cq:extension:primary_key"
MetadataPrimaryKeyComponent = "cq:extension:primary_key_component"
MetadataConstraintName = "cq:extension:constraint_name"
MetadataIncremental = "cq:extension:incremental"
MetadataTypeSchema = "cq:extension:type_schema"
MetadataTrue = "true"
MetadataFalse = "false"
MetadataTableName = "cq:table_name"
MetadataTableDescription = "cq:table_description"
MetadataTableTitle = "cq:table_title"
MetadataTableDependsOn = "cq:table_depends_on"
MetadataTableIsPaid = "cq:table_paid"
MetadataTablePermissionsNeeded = "cq:table_permissions_needed"
)
type Schemas []*arrow.Schema
func (s Schemas) Len() int {
return len(s)
}
func (s Schemas) SchemaByName(name string) *arrow.Schema {
for _, sc := range s {
tableName, ok := sc.Metadata().GetValue(MetadataTableName)
if !ok {
continue
}
if tableName == name {
return sc
}
}
return nil
}