Documentation
¶
Overview ¶
Package tiledb is an idiomatic Go binding to tiledb's c_api. Go structs are used for object-style access to tiledb types, such as `Config` and `ArraySchema`. Tiledb C objects that are alloc'ed are set to be freeded on garbage collection using `runtime.SetFinalizer`.
For more information on TileDB see the official docs at https://docs.tiledb.io/en/stable .
Semantic versioning is followed for this package and for compatibility with Go modules. See the compatibility section of README.md for a mapping of TileDB-Go package to tiledb core library versions, https://github.com/TileDB-Inc/TileDB-Go/blob/master/README.md#compatibility .
Installation ¶
See README.md for installation requirements and instructions: https://github.com/TileDB-Inc/TileDB-Go/blob/master/README.md#installation .
Quickstart ¶
See `quickstart_dense_test.go` and `quickstart_sparse_test.go` for examples. Also check out the official tiledb quickstart docs at https://docs.tiledb.io/en/latest/quickstart.html
Index ¶
- Constants
- Variables
- func CreateAndImportFile(tdbCtx *Context, arrayURI string, filePath string, mimeType FileStoreMimeType) error
- func CreateFile(tdbCtx *Context, arrayURI string, data []byte, mimeType FileStoreMimeType) error
- func DeleteFragments(tdbCtx *Context, uri string, startTimestamp, endTimestamp uint64) error
- func DeleteFragmentsList(tdbCtx *Context, uri string, fragmentURIs []string) error
- func DeserializeArrayMetadata(a *Array, buffer *Buffer, serializationType SerializationType) error
- func DeserializeArrayNonEmptyDomainAllDimensions(a *Array, buffer *Buffer, serializationType SerializationType) error
- func DeserializeFragmentInfo(fragmentInfo FragmentInfo, buffer *Buffer, arrayURI string, ...) error
- func DeserializeFragmentInfoRequest(fragmentInfo FragmentInfo, buffer *Buffer, serializationType SerializationType, ...) error
- func DeserializeGroupMetadata(g *Group, buffer *Buffer, serializationType SerializationType) error
- func DeserializeQuery(query *Query, buffer *Buffer, serializationType SerializationType, ...) error
- func DeserializeQueryAndArray(context *Context, buffer *Buffer, serializationType SerializationType, ...) (*Array, *Query, error)
- func DeserializeQueryEstResultSizes(q *Query, buffer *Buffer, serializationType SerializationType, clientSide bool) error
- func ExportFile(tdbCtx *Context, filePath, arrayURI string) error
- func ExtractRange[T DimensionType](r Range) ([]T, error)
- func FileSize(tdbCtx *Context, arrayURI string) (int64, error)
- func GetTimeFromTimestamp(datatype Datatype, timestamp int64) time.Time
- func HandleArrayDeleteFragmentsListRequest(context *Context, array *Array, buffer *Buffer, ...) error
- func HandleArrayDeleteFragmentsTimestampsRequest(context *Context, array *Array, buffer *Buffer, ...) error
- func ImportFile(tdbCtx *Context, arrayURI, filePath string, mimeType FileStoreMimeType) error
- func ObjectMove(tdbCtx *Context, path string, newPath string) error
- func ObjectRemove(tdbCtx *Context, path string) error
- func SerializeArray(array *Array, serializationType SerializationType, clientSide bool) ([]byte, error)deprecated
- func SerializeArrayMetadata(a *Array, serializationType SerializationType) ([]byte, error)deprecated
- func SerializeArrayNonEmptyDomain(a *Array, serializationType SerializationType) ([]byte, error)deprecated
- func SerializeArrayNonEmptyDomainAllDimensions(a *Array, serializationType SerializationType) ([]byte, error)deprecated
- func SerializeArraySchema(schema *ArraySchema, serializationType SerializationType, clientSide bool) ([]byte, error)deprecated
- func SerializeArraySchemaEvolution(arraySchemaEvolution *ArraySchemaEvolution, ...) ([]byte, error)deprecated
- func SerializeFragmentInfo(fragmentInfo *FragmentInfo, serializationType SerializationType, ...) ([]byte, error)deprecated
- func SerializeFragmentInfoRequest(fragmentInfo *FragmentInfo, serializationType SerializationType, ...) ([]byte, error)deprecated
- func SerializeGroupMetadata(g *Group, serializationType SerializationType) ([]byte, error)deprecated
- func SerializeQueryEstResultSizes(q *Query, serializationType SerializationType, clientSide bool) ([]byte, error)deprecated
- func Stats() (string, error)
- func StatsDisable() error
- func StatsDump(path string) error
- func StatsDumpSTDOUT() error
- func StatsEnable() error
- func StatsRaw() (string, error)
- func StatsRawDump(path string) error
- func StatsRawDumpSTDOUT() error
- func StatsReset() error
- func Version() (major int, minor int, rev int)
- type Array
- func (a *Array) Close() error
- func (a *Array) Config() (*Config, error)
- func (a *Array) Consolidate(config *Config) error
- func (a *Array) ConsolidateFragments(config *Config, fragmentList []string) error
- func (a *Array) Context() *Context
- func (a *Array) Create(arraySchema *ArraySchema) error
- func (a *Array) DeleteMetadata(key string) error
- func (a *Array) Free()
- func (a *Array) GetEnumeration(name string) (*Enumeration, error)
- func (a *Array) GetMetadata(key string) (Datatype, uint, interface{}, error)
- func (a *Array) GetMetadataFromIndex(index uint64) (*ArrayMetadata, error)
- func (a *Array) GetMetadataFromIndexWithValueLimit(index uint64, limit *uint) (*ArrayMetadata, error)
- func (a *Array) GetMetadataMap() (map[string]*ArrayMetadata, error)
- func (a *Array) GetMetadataMapWithValueLimit(limit *uint) (map[string]*ArrayMetadata, error)
- func (a *Array) GetMetadataNum() (uint64, error)
- func (a Array) GetNonEmptyDomainSliceFromIndex(dimIdx uint) (*Dimension, interface{}, unsafe.Pointer, error)
- func (a Array) GetNonEmptyDomainSliceFromName(dimName string) (*Dimension, interface{}, unsafe.Pointer, error)
- func (a *Array) LoadAllEnumerations() error
- func (a *Array) LoadEnumerationsAllSchemas() error
- func (a *Array) NewSubarray() (*Subarray, error)
- func (a *Array) NonEmptyDomain() ([]NonEmptyDomain, bool, error)
- func (a *Array) NonEmptyDomainFromIndex(dimIdx uint) (*NonEmptyDomain, bool, error)
- func (a *Array) NonEmptyDomainFromName(dimName string) (*NonEmptyDomain, bool, error)
- func (a *Array) NonEmptyDomainMap() (map[string]interface{}, error)
- func (a *Array) NonEmptyDomainVarFromIndex(dimIdx uint) (*NonEmptyDomain, bool, error)
- func (a *Array) NonEmptyDomainVarFromName(dimName string) (*NonEmptyDomain, bool, error)
- func (a *Array) Open(queryType QueryType) error
- func (a *Array) OpenEndTime() (time.Time, error)
- func (a *Array) OpenEndTimestamp() (uint64, error)
- func (a *Array) OpenStartTime() (time.Time, error)
- func (a *Array) OpenStartTimestamp() (uint64, error)
- func (a *Array) OpenWithOptions(queryType QueryType, opts ...ArrayOpenOption) error
- func (a *Array) PutCharMetadata(key string, charData string) error
- func (a *Array) PutMetadata(key string, value interface{}) error
- func (a *Array) QueryType() (QueryType, error)
- func (a *Array) Reopen() error
- func (a *Array) Schema() (*ArraySchema, error)
- func (a *Array) SetConfig(config *Config) error
- func (a *Array) URI() (string, error)
- func (a *Array) Vacuum(config *Config) error
- type ArrayMetadata
- type ArrayOpenOption
- type ArraySchema
- func DeserializeArraySchema(buffer *Buffer, serializationType SerializationType, clientSide bool) (*ArraySchema, error)
- func LoadArraySchema(context *Context, path string) (*ArraySchema, error)
- func NewArraySchema(tdbCtx *Context, arrayType ArrayType) (*ArraySchema, error)
- func NewArraySchemaForFile(tdbCtx *Context, filePath string) (*ArraySchema, error)
- func (a *ArraySchema) AddAttributes(attributes ...*Attribute) error
- func (a *ArraySchema) AddDimensionLabel(dimIndex uint32, name string, order DataOrder, labelType Datatype) error
- func (a *ArraySchema) AddEnumeration(e *Enumeration) error
- func (a *ArraySchema) AllowsDups() (bool, error)
- func (a *ArraySchema) AttributeFromIndex(index uint) (*Attribute, error)
- func (a *ArraySchema) AttributeFromName(attrName string) (*Attribute, error)
- func (a *ArraySchema) AttributeNum() (uint, error)
- func (a *ArraySchema) Attributes() ([]*Attribute, error)
- func (a *ArraySchema) Capacity() (uint64, error)
- func (a *ArraySchema) CellOrder() (Layout, error)
- func (a *ArraySchema) Check() error
- func (a *ArraySchema) Context() *Context
- func (a *ArraySchema) CoordsFilterList() (*FilterList, error)
- func (a *ArraySchema) DimensionLabelFromIndex(labelIdx uint64) (*DimensionLabel, error)
- func (a *ArraySchema) DimensionLabelFromName(name string) (*DimensionLabel, error)
- func (a *ArraySchema) DimensionLabelsNum() (uint64, error)
- func (a *ArraySchema) Domain() (*Domain, error)
- func (a *ArraySchema) Dump(path string) error
- func (a *ArraySchema) DumpSTDOUT() error
- func (a *ArraySchema) EnumerationFromAttributeName(name string) (*Enumeration, error)
- func (a *ArraySchema) EnumerationFromName(name string) (*Enumeration, error)
- func (a *ArraySchema) Free()
- func (a *ArraySchema) HasAttribute(attrName string) (bool, error)
- func (a *ArraySchema) HasDimensionLabel(name string) (bool, error)
- func (a *ArraySchema) MarshalJSON() ([]byte, error)
- func (a *ArraySchema) OffsetsFilterList() (*FilterList, error)
- func (a *ArraySchema) SetAllowsDups(allowsDups bool) error
- func (a *ArraySchema) SetCapacity(capacity uint64) error
- func (a *ArraySchema) SetCellOrder(cellOrder Layout) error
- func (a *ArraySchema) SetCoordsFilterList(filterList *FilterList) error
- func (a *ArraySchema) SetDimensionLabelFilterList(name string, filterList FilterList) error
- func (a *ArraySchema) SetDimensionLabelTileExtent(labelName string, dimType Datatype, extent interface{}) error
- func (a *ArraySchema) SetDomain(domain *Domain) error
- func (a *ArraySchema) SetOffsetsFilterList(filterList *FilterList) error
- func (a *ArraySchema) SetTileOrder(tileOrder Layout) error
- func (a *ArraySchema) TileOrder() (Layout, error)
- func (a *ArraySchema) Type() (ArrayType, error)
- func (a *ArraySchema) UnmarshalJSON(b []byte) error
- type ArraySchemaEvolution
- func (ase *ArraySchemaEvolution) AddAttribute(attribute *Attribute) error
- func (ase *ArraySchemaEvolution) AddEnumeration(e *Enumeration) error
- func (ase *ArraySchemaEvolution) ApplyExtendedEnumeration(e *Enumeration) error
- func (ase *ArraySchemaEvolution) Context() *Context
- func (ase *ArraySchemaEvolution) DropAttribute(name string) error
- func (ase *ArraySchemaEvolution) DropEnumeration(name string) error
- func (ase *ArraySchemaEvolution) Evolve(uri string) error
- func (ase *ArraySchemaEvolution) Free()
- type ArrayType
- type Attribute
- func (a *Attribute) CellSize() (uint64, error)
- func (a *Attribute) CellValNum() (uint32, error)
- func (a *Attribute) Context() *Context
- func (a *Attribute) Dump(path string) error
- func (a *Attribute) DumpSTDOUT() error
- func (a *Attribute) FilterList() (*FilterList, error)
- func (a *Attribute) Free()
- func (a *Attribute) GetEnumerationName() (string, error)
- func (a *Attribute) GetFillValue() (interface{}, uint64, error)
- func (a *Attribute) GetFillValueNullable() (interface{}, uint64, bool, error)
- func (a *Attribute) Name() (string, error)
- func (a *Attribute) Nullable() (bool, error)
- func (a *Attribute) SetCellValNum(val uint32) error
- func (a *Attribute) SetEnumerationName(name string) error
- func (a *Attribute) SetFillValue(value interface{}) error
- func (a *Attribute) SetFillValueNullable(value interface{}, valid bool) error
- func (a *Attribute) SetFilterList(filterlist *FilterList) error
- func (a *Attribute) SetNullable(nullable bool) error
- func (a *Attribute) Type() (Datatype, error)
- type Buffer
- func DeserializeLoadEnumerationsRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
- func HandleConsolidationPlanRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
- func HandleLoadArraySchemaRequest(array *Array, request *Buffer, serializationType SerializationType) (*Buffer, error)
- func HandleQueryPlanRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
- func NewBuffer(context *Context) (*Buffer, error)
- func SerializeArrayMetadataToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
- func SerializeArrayNonEmptyDomainAllDimensionsToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
- func SerializeArrayNonEmptyDomainToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
- func SerializeArraySchemaEvolutionToBuffer(arraySchemaEvolution *ArraySchemaEvolution, ...) (*Buffer, error)
- func SerializeArraySchemaToBuffer(schema *ArraySchema, serializationType SerializationType, clientSide bool) (*Buffer, error)
- func SerializeArrayToBuffer(array *Array, serializationType SerializationType, clientSide bool) (*Buffer, error)
- func SerializeFragmentInfoRequestToBuffer(fragmentInfo *FragmentInfo, serializationType SerializationType, ...) (*Buffer, error)
- func SerializeFragmentInfoToBuffer(fragmentInfo *FragmentInfo, serializationType SerializationType, ...) (*Buffer, error)
- func SerializeGroupMetadataToBuffer(g *Group, serializationType SerializationType) (*Buffer, error)
- func SerializeQueryEstResultSizesToBuffer(q *Query, serializationType SerializationType, clientSide bool) (*Buffer, error)
- func (b *Buffer) Context() *Context
- func (b *Buffer) Free()
- func (b *Buffer) Len() (uint64, error)
- func (b *Buffer) ReadAt(p []byte, off int64) (int, error)
- func (b *Buffer) Serialize(serializationType SerializationType) ([]byte, error)deprecated
- func (b *Buffer) SetBuffer(buffer []byte) error
- func (b *Buffer) SetType(datatype Datatype) error
- func (b *Buffer) Type() (Datatype, error)
- func (b *Buffer) WriteTo(w io.Writer) (int64, error)
- type BufferList
- func (b *BufferList) Context() *Context
- func (b *BufferList) Flatten() (*Buffer, error)deprecated
- func (b *BufferList) Free()
- func (b *BufferList) GetBuffer(bufferIndex uint) (*Buffer, error)
- func (b *BufferList) NumBuffers() (uint64, error)
- func (b *BufferList) TotalSize() (uint64, error)
- func (b *BufferList) WriteTo(w io.Writer) (int64, error)
- type Config
- func (c *Config) Cmp(other *Config) bool
- func (c *Config) Free()
- func (c *Config) Get(param string) (string, error)
- func (c *Config) Iterate(prefix string) (*ConfigIter, error)
- func (c *Config) SaveToFile(file string) error
- func (c *Config) Set(param string, value string) error
- func (c *Config) Unset(param string) error
- type ConfigIter
- type ConsolidationPlan
- func (cp *ConsolidationPlan) DumpJSON() (string, error)
- func (cp *ConsolidationPlan) FragmentURI(nodeIndex, fragmentIndex uint64) (string, error)
- func (cp *ConsolidationPlan) Free()
- func (cp *ConsolidationPlan) NumFragments(nodeIndex uint64) (uint64, error)
- func (cp *ConsolidationPlan) NumNodes() (uint64, error)
- type Context
- type DataOrder
- type Datatype
- func (d *Datatype) FromString(s string) error
- func (d Datatype) GetValue(valueNum uint, cvalue unsafe.Pointer) (interface{}, error)
- func (d Datatype) MakeSlice(numElements uint64) (interface{}, unsafe.Pointer, error)
- func (d Datatype) MarshalJSON() ([]byte, error)
- func (d Datatype) ReflectKind() reflect.Kind
- func (d Datatype) ReflectType() reflect.Type
- func (d Datatype) Size() uint64
- func (d Datatype) String() string
- func (d *Datatype) UnmarshalJSON(bytes []byte) error
- type Dimension
- func (d *Dimension) CellValNum() (uint32, error)
- func (d *Dimension) Context() *Context
- func (d *Dimension) Domain() (interface{}, error)
- func (d *Dimension) Dump(path string) error
- func (d *Dimension) DumpSTDOUT() error
- func (d *Dimension) Extent() (interface{}, error)
- func (d *Dimension) FilterList() (*FilterList, error)
- func (d *Dimension) Free()
- func (d *Dimension) Name() (string, error)
- func (d *Dimension) SetCellValNum(val uint32) error
- func (d *Dimension) SetFilterList(filterlist *FilterList) error
- func (d *Dimension) Type() (Datatype, error)
- type DimensionLabel
- func (d *DimensionLabel) AttributeName() (string, error)
- func (d *DimensionLabel) CellValNum() (uint32, error)
- func (d *DimensionLabel) DimensionIndex() (uint32, error)
- func (d *DimensionLabel) Free()
- func (d *DimensionLabel) Name() (string, error)
- func (d *DimensionLabel) Order() (DataOrder, error)
- func (d *DimensionLabel) Type() (Datatype, error)
- func (d *DimensionLabel) URI() (string, error)
- type DimensionType
- type Domain
- func (d *Domain) AddDimensions(dimensions ...*Dimension) error
- func (d *Domain) Context() *Context
- func (d *Domain) DimensionFromIndex(index uint) (*Dimension, error)
- func (d *Domain) DimensionFromName(name string) (*Dimension, error)
- func (d *Domain) Dump(path string) error
- func (d *Domain) DumpSTDOUT() error
- func (d *Domain) Free()
- func (d *Domain) HasDimension(dimName string) (bool, error)
- func (d *Domain) NDim() (uint, error)
- func (d *Domain) Type() (Datatype, error)
- type EncryptionType
- type Enumeration
- func ExtendEnumeration[T EnumerationType](tdbCtx *Context, e *Enumeration, values []T) (*Enumeration, error)
- func NewOrderedEnumeration[T EnumerationType](tdbCtx *Context, name string, values []T) (*Enumeration, error)
- func NewUnorderedEnumeration[T EnumerationType](tdbCtx *Context, name string, values []T) (*Enumeration, error)
- func (e *Enumeration) CellValNum() (uint32, error)
- func (e *Enumeration) Dump(path string) error
- func (e *Enumeration) DumpSTDOUT() error
- func (e *Enumeration) Free()
- func (e *Enumeration) IsOrdered() (bool, error)
- func (e *Enumeration) Name() (string, error)
- func (e *Enumeration) Type() (Datatype, error)
- func (e *Enumeration) Values() (interface{}, error)
- type EnumerationType
- type FS
- type File
- type FileStoreMimeType
- type Filter
- type FilterList
- func (f *FilterList) AddFilter(filter *Filter) error
- func (f *FilterList) Context() *Context
- func (f *FilterList) FilterFromIndex(index uint32) (*Filter, error)
- func (f *FilterList) Filters() ([]*Filter, error)
- func (f *FilterList) Free()
- func (f *FilterList) MaxChunkSize() (uint32, error)
- func (f *FilterList) NFilters() (uint32, error)
- func (f *FilterList) SetMaxChunkSize(maxChunkSize uint32) error
- type FilterOption
- type FilterType
- type FolderData
- type FragmentInfo
- func (fI *FragmentInfo) Config() (*Config, error)
- func (fI *FragmentInfo) Context() *Context
- func (fI *FragmentInfo) DumpSTDOUT() error
- func (fI *FragmentInfo) Free()
- func (fI *FragmentInfo) GetCellNum(fid uint32) (uint64, error)
- func (fI *FragmentInfo) GetDense(fid uint32) (bool, error)
- func (fI *FragmentInfo) GetFragmentNum() (uint32, error)
- func (fI *FragmentInfo) GetFragmentSize(fid uint32) (uint64, error)
- func (fI *FragmentInfo) GetFragmentURI(fid uint32) (string, error)
- func (fI *FragmentInfo) GetNonEmptyDomainFromIndex(fid uint32, did uint32) (*NonEmptyDomain, error)
- func (fI *FragmentInfo) GetNonEmptyDomainFromName(fid uint32, did string) (*NonEmptyDomain, error)
- func (fI *FragmentInfo) GetNonEmptyDomainVarFromIndex(fid uint32, did uint32) (*NonEmptyDomain, error)
- func (fI *FragmentInfo) GetNonEmptyDomainVarFromName(fid uint32, did string) (*NonEmptyDomain, error)
- func (fI *FragmentInfo) GetNonEmptyDomainVarSizeFromIndex(fid uint32, did uint32) (uint64, uint64, error)
- func (fI *FragmentInfo) GetNonEmptyDomainVarSizeFromName(fid uint32, did string) (uint64, uint64, error)
- func (fI *FragmentInfo) GetSparse(fid uint32) (bool, error)
- func (fI *FragmentInfo) GetTimestampRange(fid uint32) (uint64, uint64, error)
- func (fI *FragmentInfo) GetToVacuumNum() (uint32, error)
- func (fI *FragmentInfo) GetToVacuumURI(fid uint32) (string, error)
- func (fI *FragmentInfo) GetUnconsolidatedMetadataNum() (uint32, error)
- func (fI *FragmentInfo) GetVersion(fid uint32) (uint32, error)
- func (fI *FragmentInfo) HasConsolidatedMetadata(fid uint32) (bool, error)
- func (fI *FragmentInfo) Load() error
- func (fI *FragmentInfo) SetConfig(config *Config) error
- func (fI *FragmentInfo) String() (string, error)
- type Freeable
- type Group
- func (g *Group) AddMember(uri, name string, isRelativeURI bool) error
- func (g *Group) AddMemberWithType(uri, name string, isRelativeURI bool, objectType ObjectTypeEnum) error
- func (g *Group) Close() error
- func (g *Group) Config() (*Config, error)
- func (g *Group) Create() error
- func (g *Group) Delete(recursive bool) error
- func (g *Group) DeleteMetadata(key string) error
- func (g *Group) Deserialize(buffer *Buffer, serializationType SerializationType, clientSide bool) error
- func (g *Group) Dump(recurse bool) (string, error)
- func (g *Group) Free()
- func (g *Group) GetIsRelativeURIByName(name string) (bool, error)
- func (g *Group) GetMemberByName(name string) (string, string, ObjectTypeEnum, error)
- func (g *Group) GetMemberCount() (uint64, error)
- func (g *Group) GetMemberFromIndex(index uint64) (string, string, ObjectTypeEnum, error)
- func (g *Group) GetMetadata(key string) (Datatype, uint, interface{}, error)
- func (g *Group) GetMetadataFromIndex(index uint64) (*GroupMetadata, error)
- func (g *Group) GetMetadataFromIndexWithValueLimit(index uint64, limit *uint) (*GroupMetadata, error)
- func (g *Group) GetMetadataNum() (uint64, error)
- func (g *Group) IsOpen() (bool, error)
- func (g *Group) Open(queryType QueryType) error
- func (g *Group) PutMetadata(key string, value interface{}) error
- func (g *Group) QueryType() (QueryType, error)
- func (g *Group) RemoveMember(uri string) error
- func (g *Group) SetConfig(config *Config) error
- type GroupMetadata
- type Layout
- type NonEmptyDomain
- type NumOfFragmentsData
- type ObjectList
- type ObjectTypeEnum
- type Query
- func (q *Query) Array() (*Array, error)
- func (q *Query) Config() (*Config, error)
- func (q *Query) Context() *Context
- func (q *Query) EstResultSize(attributeName string) (*uint64, error)
- func (q *Query) EstResultSizeNullable(attributeName string) (*uint64, *uint64, error)
- func (q *Query) EstResultSizeVar(attributeName string) (*uint64, *uint64, error)
- func (q *Query) EstResultSizeVarNullable(attributeName string) (*uint64, *uint64, *uint64, error)
- func (q *Query) EstimateBufferElements() (map[string][3]uint64, error)
- func (q *Query) Finalize() error
- func (q *Query) Free()
- func (q *Query) GetDataBuffer(attributeOrDimension string) (interface{}, error)
- func (q *Query) GetExpectedDataBufferLength(attributeOrDimension string) (uint64, error)
- func (q *Query) GetExpectedOffsetsBufferLength(attributeOrDimension string) (uint64, error)
- func (q *Query) GetExpectedValidityBufferLength(attributeOrDimension string) (uint64, error)
- func (q *Query) GetFragmentNum() (*uint32, error)
- func (q *Query) GetFragmentTimestampRange(num uint64) (*uint64, *uint64, error)
- func (q *Query) GetFragmentURI(num uint64) (*string, error)
- func (q *Query) GetOffsetsBuffer(attributeOrDimension string) ([]uint64, error)
- func (q *Query) GetPlan() (string, error)
- func (q *Query) GetRanges() (map[string][]RangeLimits, error)deprecated
- func (q *Query) GetSubarray() (*Subarray, error)
- func (q *Query) GetValidityBuffer(attributeOrDimension string) ([]uint8, error)
- func (q *Query) HasResults() (bool, error)
- func (q *Query) RelevantFragmentNum() (uint64, error)
- func (q *Query) ResultBufferElements() (map[string][3]uint64, error)
- func (q *Query) SetConfig(config *Config) error
- func (q *Query) SetDataBuffer(attributeOrDimension string, buffer interface{}) (*uint64, error)
- func (q *Query) SetDataBufferUnsafe(attribute string, buffer unsafe.Pointer, bufferSize uint64) (*uint64, error)
- func (q *Query) SetLayout(layout Layout) error
- func (q *Query) SetOffsetsBuffer(attributeOrDimension string, offset []uint64) (*uint64, error)
- func (q *Query) SetOffsetsBufferUnsafe(attribute string, offset unsafe.Pointer, offsetSize uint64) (*uint64, error)
- func (q *Query) SetQueryCondition(cond *QueryCondition) error
- func (q *Query) SetSubarray(sa *Subarray) error
- func (q *Query) SetValidityBuffer(attributeOrDimension string, buffer []uint8) (*uint64, error)
- func (q *Query) SetValidityBufferUnsafe(attribute string, buffer unsafe.Pointer, bufferSize uint64) (*uint64, error)
- func (q *Query) Stats() ([]byte, error)
- func (q *Query) Status() (QueryStatus, error)
- func (q *Query) StatusDetails() (QueryStatusDetails, error)
- func (q *Query) Submit() error
- func (q *Query) Type() (QueryType, error)
- type QueryCondition
- func NewQueryCondition(tdbCtx *Context, attributeName string, op QueryConditionOp, value interface{}) (*QueryCondition, error)
- func NewQueryConditionCombination(tdbCtx *Context, left *QueryCondition, op QueryConditionCombinationOp, ...) (*QueryCondition, error)
- func NewQueryConditionNegated(tdbCtx *Context, qc *QueryCondition) (*QueryCondition, error)
- type QueryConditionCombinationOp
- type QueryConditionOp
- type QueryStatus
- type QueryStatusDetails
- type QueryStatusDetailsReason
- type QueryType
- type Range
- type RangeLimits
- type SerializationType
- type Subarray
- func (sa *Subarray) AddDimensionLabelRange(labelName string, r Range) error
- func (sa *Subarray) AddRange(dimIdx uint32, r Range) error
- func (sa *Subarray) AddRangeByName(dimName string, r Range) error
- func (sa *Subarray) Free()
- func (sa *Subarray) GetDimensionLabelRange(labelName string, rangeNum uint64) (Range, error)
- func (sa *Subarray) GetDimensionLabelRangeNum(labelName string) (uint64, error)
- func (sa *Subarray) GetRange(dimIdx uint32, rangeNum uint64) (Range, error)
- func (sa *Subarray) GetRangeFromName(dimName string, rangeNum uint64) (Range, error)
- func (sa *Subarray) GetRangeNum(dimIdx uint32) (uint64, error)
- func (sa *Subarray) GetRangeNumFromName(dimName string) (uint64, error)
- func (s *Subarray) GetRanges() (map[string][]Range, error)
- func (sa *Subarray) SetCoalesceRanges(b bool) error
- func (sa *Subarray) SetConfig(cfg *Config) error
- func (sa *Subarray) SetSubArray(subArray interface{}) error
- type VFS
- func (v *VFS) Close(fh *VFSfh) error
- func (v *VFS) Config() (*Config, error)
- func (v *VFS) Context() *Context
- func (v *VFS) CopyFile(oldURI string, newURI string) error
- func (v *VFS) CreateBucket(uri string) error
- func (v *VFS) CreateDir(uri string) error
- func (v *VFS) DirSize(uri string) (uint64, error)
- func (v *VFS) EmptyBucket(uri string) error
- func (v *VFS) FileSize(uri string) (uint64, error)
- func (v *VFS) Free()
- func (v *VFS) IsBucket(uri string) (bool, error)
- func (v *VFS) IsDir(uri string) (bool, error)
- func (v *VFS) IsEmptyBucket(uri string) (bool, error)
- func (v *VFS) IsFile(uri string) (bool, error)
- func (v *VFS) List(path string) ([]string, []string, error)
- func (v *VFS) MoveDir(oldURI string, newURI string) error
- func (v *VFS) MoveFile(oldURI string, newURI string) error
- func (v *VFS) NumOfFragmentsInPath(path string) (int, error)
- func (v *VFS) Open(uri string, mode VFSMode) (*VFSfh, error)
- func (v *VFS) Read(fh *VFSfh, offset uint64, nbytes uint64) ([]byte, error)
- func (v *VFS) RemoveBucket(uri string) error
- func (v *VFS) RemoveDir(uri string) error
- func (v *VFS) RemoveFile(uri string) error
- func (v *VFS) Sync(fh *VFSfh) error
- func (v *VFS) Touch(uri string) error
- func (v *VFS) VisitRecursive(path string, callback VisitRecursiveCallback) error
- func (v *VFS) Write(fh *VFSfh, bytes []byte) error
- type VFSMode
- type VFSfh
- func (v *VFSfh) Close() error
- func (v *VFSfh) Context() *Context
- func (v *VFSfh) Free()
- func (v *VFSfh) IsClosed() (bool, error)
- func (v *VFSfh) Read(p []byte) (int, error)
- func (v *VFSfh) ReadAt(p []byte, off int64) (int, error)
- func (v *VFSfh) Seek(offset int64, whence int) (int64, error)
- func (v *VFSfh) Sync() error
- func (v *VFSfh) Write(bytes []byte) (int, error)
- type VisitRecursiveCallback
- type WalkOrder
Examples ¶
Constants ¶
const ( // Filestore autodetect mime type TILEDB_MIME_AUTODETECT = FileStoreMimeType(C.TILEDB_MIME_AUTODETECT) // Filestore TIFF mime type TILEDB_MIME_TIFF = FileStoreMimeType(C.TILEDB_MIME_TIFF) // Filestore PDF mime type TILEDB_MIME_PDF = FileStoreMimeType(C.TILEDB_MIME_PDF) )
Mime types for TileDB filestore. The store can autodetect mime types but these are provided if the user wants to enforce a type
const TILEDB_COORDS = "__coords"
TILEDB_COORDS A special name indicating the coordinates attribute.
Variables ¶
var TILEDB_VAR_NUM = uint32(C.TILEDB_VAR_NUM)
TILEDB_VAR_NUM indicates variable sized attributes for cell values
Functions ¶
func CreateAndImportFile ¶ added in v0.27.1
func CreateAndImportFile(tdbCtx *Context, arrayURI string, filePath string, mimeType FileStoreMimeType) error
CreateAndImportFile creates at arrayURI a TileDB array suitable to store the local file at filePath and imports the contents.
func CreateFile ¶ added in v0.27.1
func CreateFile(tdbCtx *Context, arrayURI string, data []byte, mimeType FileStoreMimeType) error
CreateFile creates at arrayURI a TileDB array with the filestore schema and writes the data. The array is created even if data is empty.
func DeleteFragments ¶ added in v0.24.0
DeleteFragments deletes the range of fragments from startTimestamp to endTimestamp.
func DeleteFragmentsList ¶ added in v0.24.0
DeleteFragmentsList deletes the fragments of the list.
func DeserializeArrayMetadata ¶ added in v0.8.2
func DeserializeArrayMetadata(a *Array, buffer *Buffer, serializationType SerializationType) error
DeserializeArrayMetadata deserializes array metadata.
func DeserializeArrayNonEmptyDomainAllDimensions ¶ added in v0.9.0
func DeserializeArrayNonEmptyDomainAllDimensions(a *Array, buffer *Buffer, serializationType SerializationType) error
DeserializeArrayNonEmptyDomainAllDimensions deserializes an array nonempty domain.
func DeserializeFragmentInfo ¶ added in v0.18.1
func DeserializeFragmentInfo(fragmentInfo FragmentInfo, buffer *Buffer, arrayURI string, serializationType SerializationType, clientSide bool) error
DeserializeFragmentInfo deserializes an existing fragment info from the given buffer.
func DeserializeFragmentInfoRequest ¶ added in v0.18.1
func DeserializeFragmentInfoRequest(fragmentInfo FragmentInfo, buffer *Buffer, serializationType SerializationType, clientSide bool) error
DeserializeFragmentInfoRequest deserializes an existing fragment info from the given buffer.
func DeserializeGroupMetadata ¶ added in v0.27.1
func DeserializeGroupMetadata(g *Group, buffer *Buffer, serializationType SerializationType) error
DeserializeGroupMetadata deserializes group metadata
func DeserializeQuery ¶ added in v0.6.0
func DeserializeQuery(query *Query, buffer *Buffer, serializationType SerializationType, clientSide bool) error
DeserializeQuery deserializes a buffer into an existing query.
func DeserializeQueryAndArray ¶ added in v0.21.4
func DeserializeQueryEstResultSizes ¶ added in v0.9.0
func DeserializeQueryEstResultSizes(q *Query, buffer *Buffer, serializationType SerializationType, clientSide bool) error
DeserializeQueryEstResultSizes deserializes query estimated result sizes.
func ExportFile ¶ added in v0.27.1
ExportFile reads the contents of the array at arrayURI, which should have a filestore schema, and writes them to the local file at filePath. All the subdirectories of filePath must exist.
func ExtractRange ¶ added in v0.23.1
func ExtractRange[T DimensionType](r Range) ([]T, error)
ExtractRange extracts the endpoints of the range. It returns []T{start, end, stride}. The stride is not supported by TileDB core yet, so it gets the zero value of T.
func FileSize ¶ added in v0.27.1
Size returns the uncompressed size of the array at arrayURI, which should have a filestore schema.
func GetTimeFromTimestamp ¶ added in v0.9.0
GetTimeFromTimestamp returns a time.Time object for a time related TileDB datatype Datetimes in TileDB are deltas from unix epoch with a resolution of the specified time.
func HandleArrayDeleteFragmentsListRequest ¶ added in v0.24.0
func HandleArrayDeleteFragmentsListRequest(context *Context, array *Array, buffer *Buffer, serializationType SerializationType) error
HandleArrayDeleteFragmentsListRequest is used by TileDB cloud to handle DeleteFragmentsList with tiledb:// uris.
func HandleArrayDeleteFragmentsTimestampsRequest ¶ added in v0.24.0
func HandleArrayDeleteFragmentsTimestampsRequest(context *Context, array *Array, buffer *Buffer, serializationType SerializationType) error
HandleArrayDeleteFragmentsTimestampsRequest is used by TileDB cloud to handle DeleteFragments with tiledb:// uris.
func ImportFile ¶ added in v0.27.1
func ImportFile(tdbCtx *Context, arrayURI, filePath string, mimeType FileStoreMimeType) error
ImportFile stores the contents of the local file at filePath to the array at arrayURI, which should have a filestore schema.
func ObjectMove ¶ added in v0.10.3
ObjectMove moves a TileDB resource (group, array, key-value). Param path is the new path to move to
func ObjectRemove ¶ added in v0.10.3
ObjectRemove deletes a TileDB resource (group, array, key-value).
func SerializeArray
deprecated
added in
v0.17.1
func SerializeArray(array *Array, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeArray serializes an array.
Deprecated: Use SerializeArrayToBuffer instead.
func SerializeArrayMetadata
deprecated
added in
v0.8.2
func SerializeArrayMetadata(a *Array, serializationType SerializationType) ([]byte, error)
SerializeArrayMetadata gets and serializes the array metadata.
Deprecated: Use SerializeArrayMetadataToBuffer instead.
func SerializeArrayNonEmptyDomain
deprecated
added in
v0.6.0
func SerializeArrayNonEmptyDomain(a *Array, serializationType SerializationType) ([]byte, error)
SerializeArrayNonEmptyDomain gets and serializes the array nonempty domain.
Deprecated: Use SerializeArrayNonEmptyDomainToBuffer instead.
func SerializeArrayNonEmptyDomainAllDimensions
deprecated
added in
v0.9.0
func SerializeArrayNonEmptyDomainAllDimensions(a *Array, serializationType SerializationType) ([]byte, error)
SerializeArrayNonEmptyDomainAllDimensions gets and serializes the array nonempty domain.
Deprecated: Use SerializeArrayNonEmptyDomainAllDimensionsToBuffer instead.
func SerializeArraySchema
deprecated
added in
v0.6.0
func SerializeArraySchema(schema *ArraySchema, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeArraySchema serializes an array schema.
Deprecated: Use SerializeArraySchemaToBuffer instead.
func SerializeArraySchemaEvolution
deprecated
added in
v0.27.1
func SerializeArraySchemaEvolution(arraySchemaEvolution *ArraySchemaEvolution, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeArraySchemaEvolution serializes the given array schema evolution.
Deprecated: Use SerializeArraySchemaEvolutionToBuffer instead.
func SerializeFragmentInfo
deprecated
added in
v0.18.1
func SerializeFragmentInfo(fragmentInfo *FragmentInfo, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeFragmentInfo serializes fragment info.
Deprecated: Use SerializeFragmentInfoToBuffer instead.
func SerializeFragmentInfoRequest
deprecated
added in
v0.18.1
func SerializeFragmentInfoRequest(fragmentInfo *FragmentInfo, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeFragmentInfoRequest serializes fragment info.
Deprecated: Use SerializeFragmentInfoRequestToBuffer instead.
func SerializeGroupMetadata
deprecated
added in
v0.27.1
func SerializeGroupMetadata(g *Group, serializationType SerializationType) ([]byte, error)
SerializeGroupMetadata gets and serializes the group metadata
Deprecated: Use SerializeGroupMetadataToBuffer instead.
func SerializeQueryEstResultSizes
deprecated
added in
v0.9.0
func SerializeQueryEstResultSizes(q *Query, serializationType SerializationType, clientSide bool) ([]byte, error)
SerializeQueryEstResultSizes gets and serializes the query estimated result sizes.
Deprecated: Use SerializeQueryEstResultSizesToBuffer instead.
func StatsDumpSTDOUT ¶
func StatsDumpSTDOUT() error
StatsDumpSTDOUT prints internal stats to stdout.
func StatsEnable ¶
func StatsEnable() error
StatsEnable enables internal statistics gathering.
Example ¶
Example usage of tiledb statistics
err := StatsEnable() if err != nil { // Handle error } // Perform tile operations err = StatsDumpSTDOUT() if err != nil { // Handle error }
Output:
func StatsRawDump ¶ added in v0.11.6
StatsRawDump prints internal raw (json) stats to the given file path.
func StatsRawDumpSTDOUT ¶ added in v0.11.6
func StatsRawDumpSTDOUT() error
StatsRawDumpSTDOUT prints internal raw (json) stats to stdout.
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array struct representing a TileDB array object.
An Array object represents array data in TileDB at some persisted location, e.g. on disk, in an S3 bucket, etc. Once an array has been opened for reading or writing, interact with the data through Query objects.
func DeserializeArray ¶ added in v0.17.1
func DeserializeArray(buffer *Buffer, serializationType SerializationType, clientSide bool, arrayURI string) (*Array, error)
DeserializeArray deserializes a new array from the given buffer.
func NewArray ¶
NewArray allocates a new array. If the provided Context is nil, a default context is allocated and used.
Example ¶
// Create Config, this is optional config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Create Dimension dimension, err := NewDimension(context, "test", TILEDB_INT32, []int32{1, 10}, 5) if err != nil { // Handle error return } // Create Domain domain, err := NewDomain(context) if err != nil { // Handle error return } // Add dimension to domain err = domain.AddDimensions(dimension) if err != nil { // Handle error return } arraySchema, err := NewArraySchema(context, TILEDB_DENSE) if err != nil { // Handle error return } // Create attribute to add to schema attribute, err := NewAttribute(context, "a1", TILEDB_INT32) if err != nil { // Handle error return } err = arraySchema.AddAttributes(attribute) if err != nil { // Handle error return } err = arraySchema.SetDomain(domain) if err != nil { // Handle error return } array, err := NewArray(context, "my_array") if err != nil { // Handle error return } err = array.Create(arraySchema) if err != nil { // Handle error return }
Output:
func (*Array) Close ¶
Close closes a tiledb array. This is automatically called on garbage collection.
func (*Array) Consolidate ¶
Consolidate consolidates the fragments of an array into a single fragment. You must first finalize all queries to the array before consolidation can begin (as consolidation temporarily acquires an exclusive lock on the array).
func (*Array) ConsolidateFragments ¶ added in v0.30.3
ConsolidateFragments consolidates an explicit list of fragments in an array into a single fragment. You must first finalize all queries to the array before consolidation can begin (as consolidation temporarily acquires an exclusive lock on the array).
func (*Array) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the array.
func (*Array) Create ¶
func (a *Array) Create(arraySchema *ArraySchema) error
Create creates a new TileDB array given an input schema.
func (*Array) DeleteMetadata ¶ added in v0.8.1
DeleteMetadata deletes a metadata key-value item from an open array. The array must be opened in WRITE mode, otherwise the function will error out.
func (*Array) Free ¶
func (a *Array) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Array) GetEnumeration ¶ added in v0.27.1
func (a *Array) GetEnumeration(name string) (*Enumeration, error)
GetEnumeration return the named Enumeration from the array schema.
func (*Array) GetMetadata ¶ added in v0.8.1
GetMetadata gets a metadata key-value item from an open array. The array must be opened in READ mode, otherwise the function will error out.
func (*Array) GetMetadataFromIndex ¶ added in v0.8.1
func (a *Array) GetMetadataFromIndex(index uint64) (*ArrayMetadata, error)
GetMetadataFromIndex gets a metadata item from an open array using an index. The array must be opened in READ mode, otherwise the function will error out.
func (*Array) GetMetadataFromIndexWithValueLimit ¶ added in v0.8.5
func (a *Array) GetMetadataFromIndexWithValueLimit(index uint64, limit *uint) (*ArrayMetadata, error)
GetMetadataFromIndexWithValueLimit gets a metadata item from an open array using an index. The array must be opened in READ mode, otherwise the function will error out. limit parameter limits the number of values returned if string or array This is helpful for pushdown of limitting metadata. If nil value is returned in full.
func (*Array) GetMetadataMap ¶ added in v0.8.1
func (a *Array) GetMetadataMap() (map[string]*ArrayMetadata, error)
GetMetadataMap returns a map[string]*ArrayMetadata where key is the key of each metadata added and value is an ArrayMetadata struct. The map contains all array metadata previously added.
func (*Array) GetMetadataMapWithValueLimit ¶ added in v0.8.5
func (a *Array) GetMetadataMapWithValueLimit(limit *uint) (map[string]*ArrayMetadata, error)
GetMetadataMapWithValueLimit returns a map[string]*ArrayMetadata where key is the key of each metadata added and value is an ArrayMetadata struct. The map contains all array metadata previously added. The limit parameter limits the number of values returned if string or array. This is helpful for pushdown of limitting metadata. If nil, value is returned in full.
func (*Array) GetMetadataNum ¶ added in v0.8.1
GetMetadataNum gets then number of metadata items in an open array. The array must be opened in READ mode, otherwise the function will error out.
func (Array) GetNonEmptyDomainSliceFromIndex ¶ added in v0.11.0
func (Array) GetNonEmptyDomainSliceFromName ¶ added in v0.11.0
func (*Array) LoadAllEnumerations ¶ added in v0.27.1
LoadAllEnumeration is for use with TileDB cloud arrays. It fetches the enumeration values from the server. The method is called ondemand if the client tries to fetch enumeration values for a tiledb:// array.
func (*Array) LoadEnumerationsAllSchemas ¶ added in v0.34.0
LoadEnumerationsAllSchemas is for use with TileDB cloud arrays. It fetches the enumeration values from the server for all array schemas, past and present.
func (*Array) NewSubarray ¶ added in v0.23.1
NewSubarray creates a new subarray for array. It has internal coalesce_ranges == true.
func (*Array) NonEmptyDomain ¶
func (a *Array) NonEmptyDomain() ([]NonEmptyDomain, bool, error)
NonEmptyDomain retrieves the non-empty domain from an array. This returns the bounding coordinates for each dimension.
func (*Array) NonEmptyDomainFromIndex ¶ added in v0.9.0
func (a *Array) NonEmptyDomainFromIndex(dimIdx uint) (*NonEmptyDomain, bool, error)
NonEmptyDomainFromIndex retrieves the non-empty domain from an array for a given fixed-sized dimension index. Returns the bounding coordinates for the dimension.
func (*Array) NonEmptyDomainFromName ¶ added in v0.9.0
func (a *Array) NonEmptyDomainFromName(dimName string) (*NonEmptyDomain, bool, error)
NonEmptyDomainFromName retrieves the non-empty domain from an array for a given fixed-sized dimension name. Returns the bounding coordinates for the dimension.
func (*Array) NonEmptyDomainMap ¶ added in v0.11.9
NonEmptyDomainMap returns a map[string]interface{} where key is the dimension name and value is the non empty domain for the given dimension or the empty interface. It covers both var-sized and non-var-sized dimensions.
func (*Array) NonEmptyDomainVarFromIndex ¶ added in v0.9.0
func (a *Array) NonEmptyDomainVarFromIndex(dimIdx uint) (*NonEmptyDomain, bool, error)
NonEmptyDomainVarFromIndex retrieves the non-empty domain from an array for a given var-sized dimension index. Supports only TILEDB_STRING_ASCII type Returns the bounding coordinates for the dimension.
func (*Array) NonEmptyDomainVarFromName ¶ added in v0.9.0
func (a *Array) NonEmptyDomainVarFromName(dimName string) (*NonEmptyDomain, bool, error)
NonEmptyDomainVarFromName retrieves the non-empty domain from an array for a given var-sized dimension name. Supports only TILEDB_STRING_ASCII type Returns the bounding coordinates for the dimension.
func (*Array) Open ¶
Open the array. The array is opened using a query type as input. This is to indicate that queries created for this Array object will inherit the query type. In other words, Array objects are opened to receive only one type of queries. They can always be closed and be re-opened with another query type. Also there may be many different Array objects created and opened with different query types. For instance, one may create and open an array object array_read for reads and another one array_write for writes, and interleave creation and submission of queries for both these array objects.
func (*Array) OpenEndTime ¶ added in v0.32.0
OpenEndTime returns the current end_timestamp of an open array, converted to a UTC time.Time.
func (*Array) OpenEndTimestamp ¶ added in v0.12.0
OpenEndTimestamp returns the current end_timestamp value of an open array.
func (*Array) OpenStartTime ¶ added in v0.32.0
OpenStartTime returns the current start_timestamp of an open array, converted to a UTC time.Time.
func (*Array) OpenStartTimestamp ¶ added in v0.12.0
OpenStartTimestamp returns the current start_timestamp value of an open array.
func (*Array) OpenWithOptions ¶ added in v0.12.0
func (a *Array) OpenWithOptions(queryType QueryType, opts ...ArrayOpenOption) error
OpenWithOptions opens the array with options. The array is opened using a query type as input. This is to indicate that queries created for this Array object will inherit the query type. In other words, Array objects are opened to receive only one type of query. They can always be closed and be re-opened with another query type. Also there may be many different Array objects created and opened with different query types. For instance, one may create and open an array object array_read for reads and another one array_write for writes, and interleave creation and submission of queries for both these array objects.
func (*Array) PutCharMetadata ¶ added in v0.9.1
PutCharMetadata adds char metadata to the array.
func (*Array) PutMetadata ¶ added in v0.8.1
PutMetadata puts a metadata key-value item to an open array. The array must be opened in WRITE mode, otherwise the function will error out.
func (*Array) Reopen ¶
Reopen the array (the array must be already open). This is useful when the array got updated after it got opened and the Array object got created. To sync-up with the updates, the user must either close the array and open with open(), or just use reopen() without closing. This function will be generally faster than the former alternative.
func (*Array) Schema ¶
func (a *Array) Schema() (*ArraySchema, error)
Schema returns the ArraySchema for the array.
type ArrayMetadata ¶ added in v0.8.1
type ArrayMetadata struct { Key string KeyLen uint32 Datatype Datatype ValueNum uint Value interface{} }
ArrayMetadata defines metadata for the array
func (ArrayMetadata) MarshalJSON ¶ added in v0.8.1
func (a ArrayMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface for ArrayMetadata.
type ArrayOpenOption ¶ added in v0.12.0
ArrayOpenOptions defines the flexible parameters in which arrays can be opened with.
func WithEndTime ¶ added in v0.32.0
func WithEndTime(end time.Time) ArrayOpenOption
WithEndTime sets the subsequent Open call to use the given time as its end timestamp. If "end" is the zero value, does nothing.
func WithEndTimestamp ¶ added in v0.12.0
func WithEndTimestamp(endTimestamp uint64) ArrayOpenOption
WithEndTimestamp sets the subsequent Open call to use the end_timestamp of the passed value.
func WithStartTime ¶ added in v0.32.0
func WithStartTime(start time.Time) ArrayOpenOption
WithStartTime sets the subsequent Open call to use the given time as its start timestamp. If "start" is the zero value, does nothing.
func WithStartTimestamp ¶ added in v0.12.0
func WithStartTimestamp(startTimestamp uint64) ArrayOpenOption
WithStartTimestamp sets the subsequent Open call to use the start_timestamp of the passed value.
type ArraySchema ¶
type ArraySchema struct {
// contains filtered or unexported fields
}
ArraySchema describes an array.
The schema is an independent description of an array. A schema can be used to create multiple array’s, and stores information about its domain, cell types, and compression details. An array schema is composed of:
A Domain A set of Attributes Memory layout definitions: tile and cell Compression details for Array level factors like offsets and coordinates
func DeserializeArraySchema ¶ added in v0.6.0
func DeserializeArraySchema(buffer *Buffer, serializationType SerializationType, clientSide bool) (*ArraySchema, error)
DeserializeArraySchema deserializes a new array schema from the given buffer.
func LoadArraySchema ¶
func LoadArraySchema(context *Context, path string) (*ArraySchema, error)
LoadArraySchema reads a directory for an ArraySchema.
func NewArraySchema ¶
func NewArraySchema(tdbCtx *Context, arrayType ArrayType) (*ArraySchema, error)
NewArraySchema allocates a new ArraySchema.
Example ¶
// Create Config, this is optional config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Create Dimension dimension, err := NewDimension(context, "test", TILEDB_INT32, []int32{1, 10}, 5) if err != nil { // Handle error return } // Create Domain domain, err := NewDomain(context) if err != nil { // Handle error return } // Add dimension to domain err = domain.AddDimensions(dimension) if err != nil { // Handle error return } arraySchema, err := NewArraySchema(context, TILEDB_DENSE) if err != nil { // Handle error return } // Create attribute to add to schema attribute, err := NewAttribute(context, "a1", TILEDB_INT32) if err != nil { // Handle error return } err = arraySchema.AddAttributes(attribute) if err != nil { // Handle error return }
Output:
func NewArraySchemaForFile ¶ added in v0.27.1
func NewArraySchemaForFile(tdbCtx *Context, filePath string) (*ArraySchema, error)
NewArraySchemaForFile allocates a new ArraySchema optimized for the storage of file. An empty path returns a general schema suitable for any file.
func (*ArraySchema) AddAttributes ¶
func (a *ArraySchema) AddAttributes(attributes ...*Attribute) error
AddAttributes adds one or more attributes to the array.
func (*ArraySchema) AddDimensionLabel ¶ added in v0.27.1
func (a *ArraySchema) AddDimensionLabel(dimIndex uint32, name string, order DataOrder, labelType Datatype) error
AddDimensionLabel adds a dimension label to the array schema.
func (*ArraySchema) AddEnumeration ¶ added in v0.27.1
func (a *ArraySchema) AddEnumeration(e *Enumeration) error
AddEnumeration adds the Enumeration to the schema. It must be added before we add it to an attribute.
func (*ArraySchema) AllowsDups ¶ added in v0.10.3
func (a *ArraySchema) AllowsDups() (bool, error)
AllowsDups gets whether the array can allow coordinate duplicates or not. It should always be `0` for dense arrays.
func (*ArraySchema) AttributeFromIndex ¶
func (a *ArraySchema) AttributeFromIndex(index uint) (*Attribute, error)
AttributeFromIndex gets a copy of an Attribute in the schema by name.
func (*ArraySchema) AttributeFromName ¶
func (a *ArraySchema) AttributeFromName(attrName string) (*Attribute, error)
AttributeFromName gets a copy of an Attribute in the schema by index. Attributes are ordered the same way they were defined when constructing the array schema.
func (*ArraySchema) AttributeNum ¶
func (a *ArraySchema) AttributeNum() (uint, error)
AttributeNum returns the number of attributes.
func (*ArraySchema) Attributes ¶
func (a *ArraySchema) Attributes() ([]*Attribute, error)
Attributes gets all attributes in the array.
func (*ArraySchema) Capacity ¶
func (a *ArraySchema) Capacity() (uint64, error)
Capacity returns the tile capacity.
func (*ArraySchema) CellOrder ¶
func (a *ArraySchema) CellOrder() (Layout, error)
CellOrder returns the cell order.
func (*ArraySchema) Context ¶ added in v0.14.2
func (a *ArraySchema) Context() *Context
Context exposes the internal TileDB context used to initialize the array schema.
func (*ArraySchema) CoordsFilterList ¶ added in v0.2.0
func (a *ArraySchema) CoordsFilterList() (*FilterList, error)
CoordsFilterList returns a copy of the filter list of the coordinates.
func (*ArraySchema) DimensionLabelFromIndex ¶ added in v0.27.1
func (a *ArraySchema) DimensionLabelFromIndex(labelIdx uint64) (*DimensionLabel, error)
DimensionLabelFromName retrieves a dimension label from an array schema with the requested index.
func (*ArraySchema) DimensionLabelFromName ¶ added in v0.27.1
func (a *ArraySchema) DimensionLabelFromName(name string) (*DimensionLabel, error)
DimensionLabelFromName retrieves a dimension label from an array schema with the requested name.
func (*ArraySchema) DimensionLabelsNum ¶ added in v0.27.1
func (a *ArraySchema) DimensionLabelsNum() (uint64, error)
DimensionLabelsNum returns the number of dimension label in this array schema
func (*ArraySchema) Domain ¶
func (a *ArraySchema) Domain() (*Domain, error)
Domain returns the array's domain.
func (*ArraySchema) Dump ¶
func (a *ArraySchema) Dump(path string) error
Dump dumps the array schema in ASCII format to the given path.
func (*ArraySchema) DumpSTDOUT ¶
func (a *ArraySchema) DumpSTDOUT() error
DumpSTDOUT dumps the array schema in ASCII format to stdout.
func (*ArraySchema) EnumerationFromAttributeName ¶ added in v0.34.0
func (a *ArraySchema) EnumerationFromAttributeName(name string) (*Enumeration, error)
EnumerationFromName gets an Enumeration from the ArraySchema by its Attribute name.
func (*ArraySchema) EnumerationFromName ¶ added in v0.34.0
func (a *ArraySchema) EnumerationFromName(name string) (*Enumeration, error)
EnumerationFromName gets an Enumeration from the ArraySchema by name
func (*ArraySchema) Free ¶
func (a *ArraySchema) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*ArraySchema) HasAttribute ¶ added in v0.10.3
func (a *ArraySchema) HasAttribute(attrName string) (bool, error)
HasAttribute returns true if attribute: `attrName` is part of the schema.
func (*ArraySchema) HasDimensionLabel ¶ added in v0.23.2
func (a *ArraySchema) HasDimensionLabel(name string) (bool, error)
HasDimensionLabel checks whether the array schema has a dimension label of the given name.
func (*ArraySchema) MarshalJSON ¶ added in v0.6.0
func (a *ArraySchema) MarshalJSON() ([]byte, error)
MarshalJSON marshals arraySchema struct to json using tiledb.
func (*ArraySchema) OffsetsFilterList ¶ added in v0.2.0
func (a *ArraySchema) OffsetsFilterList() (*FilterList, error)
OffsetsFilterList returns a copy of the FilterList of the offsets for variable-length attributes.
func (*ArraySchema) SetAllowsDups ¶ added in v0.10.3
func (a *ArraySchema) SetAllowsDups(allowsDups bool) error
SetAllowsDups sets whether the array can allow coordinate duplicates or not. Applicable only to sparse arrays (it errors out if set to `1` for dense arrays).
func (*ArraySchema) SetCapacity ¶
func (a *ArraySchema) SetCapacity(capacity uint64) error
SetCapacity sets the tile capacity.
func (*ArraySchema) SetCellOrder ¶
func (a *ArraySchema) SetCellOrder(cellOrder Layout) error
SetCellOrder sets the cell order.
func (*ArraySchema) SetCoordsFilterList ¶ added in v0.2.0
func (a *ArraySchema) SetCoordsFilterList(filterList *FilterList) error
SetCoordsFilterList sets the filter list used for coordinates.
func (*ArraySchema) SetDimensionLabelFilterList ¶ added in v0.27.1
func (a *ArraySchema) SetDimensionLabelFilterList(name string, filterList FilterList) error
SetDimensionLabelFilterList sets a filter on a dimension label filter in an array schema.
func (*ArraySchema) SetDimensionLabelTileExtent ¶ added in v0.27.1
func (a *ArraySchema) SetDimensionLabelTileExtent(labelName string, dimType Datatype, extent interface{}) error
SetDimensionLabelTileExtent sets the tile extent for the dimension label
func (*ArraySchema) SetDomain ¶
func (a *ArraySchema) SetDomain(domain *Domain) error
SetDomain sets the array domain.
func (*ArraySchema) SetOffsetsFilterList ¶ added in v0.2.0
func (a *ArraySchema) SetOffsetsFilterList(filterList *FilterList) error
SetOffsetsFilterList sets the filter list for the offsets of variable-length attributes.
func (*ArraySchema) SetTileOrder ¶
func (a *ArraySchema) SetTileOrder(tileOrder Layout) error
SetTileOrder sets the tile order.
func (*ArraySchema) TileOrder ¶
func (a *ArraySchema) TileOrder() (Layout, error)
TileOrder returns the tile order.
func (*ArraySchema) Type ¶ added in v0.6.0
func (a *ArraySchema) Type() (ArrayType, error)
Type fetches the tiledb array type.
func (*ArraySchema) UnmarshalJSON ¶ added in v0.6.0
func (a *ArraySchema) UnmarshalJSON(b []byte) error
UnmarshalJSON marshals arraySchema struct to json using tiledb.
type ArraySchemaEvolution ¶ added in v0.27.1
type ArraySchemaEvolution struct {
// contains filtered or unexported fields
}
func DeserializeArraySchemaEvolution ¶ added in v0.27.1
func DeserializeArraySchemaEvolution(buffer *Buffer, serializationType SerializationType, clientSide bool) (*ArraySchemaEvolution, error)
DeserializeArraySchemaEvolution deserializes a new array schema evolution object from the given buffer.
func NewArraySchemaEvolution ¶ added in v0.27.1
func NewArraySchemaEvolution(tdbCtx *Context) (*ArraySchemaEvolution, error)
NewArraySchemaEvolution creates a TileDB schema evolution object.
func (*ArraySchemaEvolution) AddAttribute ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) AddAttribute(attribute *Attribute) error
AddAttribute adds an attribute to an array schema evolution.
func (*ArraySchemaEvolution) AddEnumeration ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) AddEnumeration(e *Enumeration) error
AddEnumeration adds enumeration to the schema evolution.
func (*ArraySchemaEvolution) ApplyExtendedEnumeration ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) ApplyExtendedEnumeration(e *Enumeration) error
ApplyExtendedEnumeration applies to the schema evolution the result of ExtendEnumeration.
func (*ArraySchemaEvolution) Context ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) Context() *Context
Context exposes the internal TileDB context used to initialize the array schema evolution
func (*ArraySchemaEvolution) DropAttribute ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) DropAttribute(name string) error
DropAttribute drops an attribute to an array schema evolution.
func (*ArraySchemaEvolution) DropEnumeration ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) DropEnumeration(name string) error
DropEnumeration removes the enumeration from the schema evolution.
func (*ArraySchemaEvolution) Evolve ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) Evolve(uri string) error
Evolve evolves array schema of an array.
func (*ArraySchemaEvolution) Free ¶ added in v0.27.1
func (ase *ArraySchemaEvolution) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
type ArrayType ¶
type ArrayType int8
ArrayType enum for tiledb arrays
const ( // TILEDB_DENSE dense array TILEDB_DENSE ArrayType = C.TILEDB_DENSE // TILEDB_SPARSE dense array TILEDB_SPARSE ArrayType = C.TILEDB_SPARSE )
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
Attribute describes an attribute of an Array cell.
An attribute specifies a name and datatype for a particular value in each array cell. There are 3 supported attribute types:
Fundamental types, such as char, int, double, uint64, etc.. Fixed sized arrays: [N]T or make([]T, N), where T is a fundamental type Variable length data: string, []T, where T is a fundamental type
func NewAttribute ¶
NewAttribute allocates a new attribute.
Example ¶
// Create Config, this is optional config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Create Attribute attribute, err := NewAttribute(context, "test", TILEDB_INT32) if err != nil { // Handle error return } // Set Filter List filter, err := NewFilter(context, TILEDB_FILTER_GZIP) if err != nil { // Handle error return } filterList, err := NewFilterList(context) if err != nil { // Handle error return } err = filterList.AddFilter(filter) if err != nil { // Handle error return } err = attribute.SetFilterList(filterList) if err != nil { // Handle error return } // Set Cell Value Number err = attribute.SetCellValNum(10) if err != nil { // Handle error return }
Output:
func (*Attribute) CellValNum ¶
CellValNum returns number of values of one cell on this attribute. For variable-sized attributes returns TILEDB_VAR_NUM.
func (*Attribute) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the attribute.
func (*Attribute) DumpSTDOUT ¶
DumpSTDOUT dumps the attribute in ASCII format to stdout.
func (*Attribute) FilterList ¶ added in v0.2.0
func (a *Attribute) FilterList() (*FilterList, error)
FilterList returns a copy of the filter list for attribute.
func (*Attribute) Free ¶
func (a *Attribute) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Attribute) GetEnumerationName ¶ added in v0.27.1
GetEnumerationName returns the enumeration name of the attribute.
func (*Attribute) GetFillValue ¶ added in v0.10.3
GetFillValue gets the default fill value for the input attribute. This value will be used for the input attribute whenever querying (1) an empty cell in a dense array, or (2) a non-empty cell (in either dense or sparse array) when values on the input attribute are missing (e.g., if the user writes a subset of the attributes in a write operation). Applicable to both fixed-sized and var-sized attributes.
func (*Attribute) GetFillValueNullable ¶ added in v0.11.0
GetFillValueNullable gets the default fill value for the input attribute. This value will be used for the input attribute whenever querying (1) an empty cell in a dense array, or (2) a non-empty cell (in either dense or sparse array) when values on the input attribute are missing (e.g., if the user writes a subset of the attributes in a write operation). Applicable to both fixed-sized and var-sized attributes.
func (*Attribute) SetCellValNum ¶
SetCellValNum sets the number of attribute values per cell. This is inferred from the type parameter of the NewAttribute function, but can also be set manually.
func (*Attribute) SetEnumerationName ¶ added in v0.27.1
SetEnumerationName sets the enumeration for the attribute. The enumeration must be set to the schema and the attribute maximum size must fit the size of the enumeration values.
func (*Attribute) SetFillValue ¶ added in v0.10.3
SetFillValue sets the default fill value for the input attribute. This value will be used for the input attribute whenever querying (1) an empty cell in a dense array, or (2) a non-empty cell (in either dense or sparse array) when values on the input attribute are missing (e.g., if the user writes a subset of the attributes in a write operation). Applicable to var-sized attributes. @note A call to `tiledb_attribute_cell_val_num` sets the fill value
of the attribute to its default. Therefore, make sure you invoke `tiledb_attribute_set_fill_value` after deciding on the number of values this attribute will hold in each cell.
@note For fixed-sized attributes, the input `size` should be equal
to the cell size.
func (*Attribute) SetFillValueNullable ¶ added in v0.11.0
SetFillValueNullable sets the default fill value for the input attribute. This value will be used for the input attribute whenever querying (1) an empty cell in a dense array, or (2) a non-empty cell (in either dense or sparse array) when values on the input attribute are missing (e.g., if the user writes a subset of the attributes in a write operation). Applicable to var-sized attributes. @note A call to `tiledb_attribute_cell_val_num` sets the fill value
of the attribute to its default. Therefore, make sure you invoke `tiledb_attribute_set_fill_value` after deciding on the number of values this attribute will hold in each cell.
@note For fixed-sized attributes, the input `size` should be equal
to the cell size.
func (*Attribute) SetFilterList ¶ added in v0.2.0
func (a *Attribute) SetFilterList(filterlist *FilterList) error
SetFilterList sets the attribute filterList.
Example ¶
// Create configuration config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } attribute, err := NewAttribute(context, "test", TILEDB_INT32) if err != nil { // Handle error return } // Set Filter List filter, err := NewFilter(context, TILEDB_FILTER_GZIP) if err != nil { // Handle error return } err = filter.SetOption(TILEDB_COMPRESSION_LEVEL, int32(5)) if err != nil { // Handle error return } filterList, err := NewFilterList(context) if err != nil { // Handle error return } err = filterList.AddFilter(filter) if err != nil { // Handle error return } err = attribute.SetFilterList(filterList) if err != nil { // Handle error return }
Output:
func (*Attribute) SetNullable ¶ added in v0.11.0
SetNullable sets if the attribute is nullable or not.
type Buffer ¶ added in v0.6.0
type Buffer struct {
// contains filtered or unexported fields
}
Buffer A generic Buffer object used by some TileDB APIs
func DeserializeLoadEnumerationsRequest ¶ added in v0.27.1
func DeserializeLoadEnumerationsRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
DeserializeLoadEnumerationsRequest deserializes a LoadEnumerationsRequests. This is used by TileDB-Cloud.
func HandleConsolidationPlanRequest ¶ added in v0.26.0
func HandleConsolidationPlanRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
HandleConsolidationPlanRequest handles a request for a consolidation plan. This is used by TileDB-Cloud It returns a buffer with the serialized response. The caller should free the buffer after use.
func HandleLoadArraySchemaRequest ¶ added in v0.30.3
func HandleLoadArraySchemaRequest(array *Array, request *Buffer, serializationType SerializationType) (*Buffer, error)
HandleLoadArraySchemaRequest Passes the array and serialized LoadArraySchemaRequest to core which returns the serialized LoadArraySchemaResponse. The request contains a TileDB Config used to load the schema, the response contains the latest array schema loaded and a map of all array schemas.
func HandleQueryPlanRequest ¶ added in v0.26.0
func HandleQueryPlanRequest(array *Array, serializationType SerializationType, request *Buffer) (*Buffer, error)
HandleQueryPlanRequest handles a request for a query plan. This is used by TileDB-Cloud It returns a buffer with the serialized response. The caller should free the buffer after use.
func NewBuffer ¶ added in v0.6.0
NewBuffer allocates a new buffer.
Example ¶
// Create context with default config context, err := NewContext(nil) if err != nil { // Handle error return } // Create Buffer buffer, err := NewBuffer(context) if err != nil { // Handle error return } // Get data slice bytes, err := buffer.dataCopy() if err != nil { // Handle error return } fmt.Println(bytes)
Output: []
func SerializeArrayMetadataToBuffer ¶ added in v0.33.0
func SerializeArrayMetadataToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
SerializeArrayMetadataToBuffer gets and serializes the array metadata and returns a Buffer object containing the payload.
func SerializeArrayNonEmptyDomainAllDimensionsToBuffer ¶ added in v0.33.0
func SerializeArrayNonEmptyDomainAllDimensionsToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
SerializeArrayNonEmptyDomainAllDimensionsToBuffer gets and serializes the array nonempty domain and returns a Buffer object containing the payload.
func SerializeArrayNonEmptyDomainToBuffer ¶ added in v0.33.0
func SerializeArrayNonEmptyDomainToBuffer(a *Array, serializationType SerializationType) (*Buffer, error)
SerializeArrayNonEmptyDomainToBuffer gets and serializes the array nonempty domain and returns a Buffer object containing the payload.
func SerializeArraySchemaEvolutionToBuffer ¶ added in v0.33.0
func SerializeArraySchemaEvolutionToBuffer(arraySchemaEvolution *ArraySchemaEvolution, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeArraySchemaEvolution serializes the given array schema evolution and serializes the group metadata and returns a Buffer object containing the payload.
func SerializeArraySchemaToBuffer ¶ added in v0.33.0
func SerializeArraySchemaToBuffer(schema *ArraySchema, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeArraySchemaToBuffer serializes an array schema and returns a Buffer object containing the payload.
func SerializeArrayToBuffer ¶ added in v0.33.0
func SerializeArrayToBuffer(array *Array, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeArrayToBuffer serializes an array and returns a Buffer object containing the payload.
func SerializeFragmentInfoRequestToBuffer ¶ added in v0.33.0
func SerializeFragmentInfoRequestToBuffer(fragmentInfo *FragmentInfo, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeFragmentInfoRequestToBuffer serializes fragment info and returns a Buffer object containing the payload.
func SerializeFragmentInfoToBuffer ¶ added in v0.33.0
func SerializeFragmentInfoToBuffer(fragmentInfo *FragmentInfo, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeFragmentInfoToBuffer serializes fragment info and returns a Buffer object containing the payload.
func SerializeGroupMetadataToBuffer ¶ added in v0.33.0
func SerializeGroupMetadataToBuffer(g *Group, serializationType SerializationType) (*Buffer, error)
SerializeGroupMetadata gets and serializes the group metadata and returns a Buffer object containing the payload
func SerializeQueryEstResultSizesToBuffer ¶ added in v0.33.0
func SerializeQueryEstResultSizesToBuffer(q *Query, serializationType SerializationType, clientSide bool) (*Buffer, error)
SerializeQueryEstResultSizesToBuffer gets and serializes the query estimated result sizes and returns a Buffer object containing the payload.
func (*Buffer) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the buffer.
func (*Buffer) Free ¶ added in v0.6.0
func (b *Buffer) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Buffer) ReadAt ¶ added in v0.33.0
ReadAt writes the contents of a Buffer at a given offset to a slice.
func (*Buffer) Serialize
deprecated
added in
v0.15.1
func (b *Buffer) Serialize(serializationType SerializationType) ([]byte, error)
Serialize returns a copy of the bytes in the buffer.
Deprecated: Use WriteTo or ReadAt instead for increased performance.
func (*Buffer) SetBuffer ¶ added in v0.6.0
SetBuffer sets the buffer to point at the given Go slice. The memory is now Go-managed.
type BufferList ¶ added in v0.6.0
type BufferList struct {
// contains filtered or unexported fields
}
BufferList A list of TileDB BufferList objects
func NewBufferList ¶ added in v0.6.0
func NewBufferList(context *Context) (*BufferList, error)
NewBufferList Allocs a new buffer list
Example ¶
// Create context with default config context, err := NewContext(nil) if err != nil { // Handle error return } // Create BufferList bufferList, err := NewBufferList(context) if err != nil { // Handle error return } // Get num buffers numBuffers, err := bufferList.NumBuffers() if err != nil { // Handle error return } fmt.Println(numBuffers)
Output: 0
func SerializeQuery ¶ added in v0.6.0
func SerializeQuery(query *Query, serializationType SerializationType, clientSide bool) (*BufferList, error)
SerializeQuery serializes a query.
func (*BufferList) Context ¶ added in v0.14.2
func (b *BufferList) Context() *Context
Context exposes the internal TileDB context used to initialize the buffer list.
func (*BufferList) Flatten
deprecated
added in
v0.6.0
func (b *BufferList) Flatten() (*Buffer, error)
Flatten copies and concatenates all buffers in the list into a new buffer.
Deprecated: Use WriteTo instead for increased performance.
func (*BufferList) Free ¶ added in v0.6.0
func (b *BufferList) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*BufferList) GetBuffer ¶ added in v0.6.0
func (b *BufferList) GetBuffer(bufferIndex uint) (*Buffer, error)
GetBuffer returns a Buffer at the given index in the list.
func (*BufferList) NumBuffers ¶ added in v0.6.0
func (b *BufferList) NumBuffers() (uint64, error)
NumBuffers returns number of buffers in the list.
func (*BufferList) TotalSize ¶ added in v0.6.0
func (b *BufferList) TotalSize() (uint64, error)
TotalSize returns the total number of bytes in the buffers in the list.
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config carries configuration parameters for a context.
func LoadConfig ¶
LoadConfig reads a configuration from the given uri.
func (*Config) Free ¶
func (c *Config) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Config) Get ¶
Get gets a parameter from the configuration by key.
Example ¶
config, err := NewConfig() if err != nil { // handle error } val, err := config.Get("sm.memory_budget") if err != nil { // handle error } fmt.Println(val)
Output: 5368709120
func (*Config) Iterate ¶ added in v0.10.3
func (c *Config) Iterate(prefix string) (*ConfigIter, error)
Iterate iterates over configuration.
for iter, err := config.Iterate(); !iter.Done(); iter.Next(){ param, value, err := iter.Here() }
func (*Config) SaveToFile ¶
SaveToFile saves the config parameters to a (local) text file.
func (*Config) Set ¶
Set sets a config parameter-value pair.
Example ¶
config, err := NewConfig() if err != nil { // handle error } err = config.Set("sm.memory_budget", "4294967296") if err != nil { // handle error } val, err := config.Get("sm.memory_budget") if err != nil { // handle error } fmt.Println(val)
Output: 4294967296
type ConfigIter ¶ added in v0.10.3
type ConfigIter struct {
// contains filtered or unexported fields
}
ConfigIter creates a config iterator object.
func NewConfigIter ¶ added in v0.10.3
func NewConfigIter(config *Config, prefix string) (*ConfigIter, error)
NewConfigIter creates an iterator for configuration. This can be used only for reading. This sets the pointer to the first search item.
func (*ConfigIter) Done ¶ added in v0.10.3
func (ci *ConfigIter) Done() (bool, error)
Done checks if the iterator is done.
func (*ConfigIter) Free ¶ added in v0.10.3
func (ci *ConfigIter) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*ConfigIter) Here ¶ added in v0.10.3
func (ci *ConfigIter) Here() (*string, *string, error)
Here retrieves the param and value for the item currently pointed to by the iterator.
func (*ConfigIter) IsDone ¶ added in v0.10.3
func (ci *ConfigIter) IsDone() bool
IsDone checks if the iterator is done.
func (*ConfigIter) Next ¶ added in v0.10.3
func (ci *ConfigIter) Next() error
Next moves the iterator to the next item.
func (*ConfigIter) Reset ¶ added in v0.10.3
func (ci *ConfigIter) Reset(prefix string) error
Reset resets the config iterator.
type ConsolidationPlan ¶ added in v0.27.1
type ConsolidationPlan struct {
// contains filtered or unexported fields
}
ConsolidationPlan is a consolidation plan for array
func GetConsolidationPlan ¶ added in v0.27.1
func GetConsolidationPlan(arr *Array, fragmentSize uint64) (*ConsolidationPlan, error)
GetConsolidationPlan creates a consolidation plan for the already opened array. The plan and the array will share the same tiledb context
func (*ConsolidationPlan) DumpJSON ¶ added in v0.27.1
func (cp *ConsolidationPlan) DumpJSON() (string, error)
DumpJSON returns a json serialization of the plan
func (*ConsolidationPlan) FragmentURI ¶ added in v0.27.1
func (cp *ConsolidationPlan) FragmentURI(nodeIndex, fragmentIndex uint64) (string, error)
FragmentURI returns the uri of the fragment of the node
func (*ConsolidationPlan) Free ¶ added in v0.27.1
func (cp *ConsolidationPlan) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*ConsolidationPlan) NumFragments ¶ added in v0.27.1
func (cp *ConsolidationPlan) NumFragments(nodeIndex uint64) (uint64, error)
NumFragments returns the numner of fragments of the node
func (*ConsolidationPlan) NumNodes ¶ added in v0.27.1
func (cp *ConsolidationPlan) NumNodes() (uint64, error)
NumNodes returns the number of nodes for the plan
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context A TileDB context wraps a TileDB storage manager “instance.” Most objects and functions will require a Context. Internal error handling is also defined by the Context; the default error handler throws a TileDBError with a specific message.
func NewContext ¶
NewContext creates a TileDB context with the given configuration. If the configuration passed is nil, it is created with the default config.
Example ¶
ExampleNewContext example of creating a new context
// Create Context with default configuration: context, err := NewContext(nil) if err != nil { // handle error return } // Create a config and use it to create a new Context: // (See ExampleConfig_Set for an example of setting config variables.) config, err := NewConfig() if err != nil { // handle error return } context, err = NewContext(config) if err != nil { // handle error return } // Create a context directly from a configuration map: context, err = NewContextFromMap(map[string]string{ "sm.memory_budget": "17179869184", // 16 GiB "sm.memory_budget_var": "34359738368", // 32 GiB }) if err != nil { // handle error return } stats, err := context.Stats() if err != nil { // Handle error return } if len(stats) > 0 { // Do something with stats } // Check if S3 is supported: isS3Supported, err := context.IsSupportedFS(TILEDB_S3) if err != nil { // handle error return }
Output: true
func NewContextFromMap ¶ added in v0.12.3
NewContextFromMap creates a TileDB context with the given configuration. If the configuration passed is nil, it is created with the default config. This is a shortcut for creating a *Config from the given map and using it to create a new context.
func (*Context) CancelAllTasks ¶ added in v0.14.2
CancelAllTasks cancels all currently executing tasks on the context.
func (*Context) Free ¶
func (c *Context) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Context) IsSupportedFS ¶
IsSupportedFS returns true if the given filesystem backend is supported.
type DataOrder ¶ added in v0.23.2
type DataOrder int8
DataOrder
const ( // Unordered dimension label. TILEDB_UNORDERED_DATA DataOrder = C.TILEDB_UNORDERED_DATA // Ordered dimension label with increasing values. TILEDB_INCREASING_DATA DataOrder = C.TILEDB_INCREASING_DATA // Ordered dimension label with decreasing values. TILEDB_DECREASING_DATA DataOrder = C.TILEDB_DECREASING_DATA )
func DataOrderFromString ¶ added in v0.23.2
DataOrderFromString converts from a string to the equivalent DataOrder enum.
type Datatype ¶
type Datatype int8
Datatype
const ( // TILEDB_INT32 32-bit signed integer TILEDB_INT32 Datatype = C.TILEDB_INT32 // TILEDB_INT64 64-bit signed integer TILEDB_INT64 Datatype = C.TILEDB_INT64 // TILEDB_FLOAT32 32-bit floating point value TILEDB_FLOAT32 Datatype = C.TILEDB_FLOAT32 // TILEDB_FLOAT64 64-bit floating point value TILEDB_FLOAT64 Datatype = C.TILEDB_FLOAT64 // TILEDB_CHAR Character TILEDB_CHAR Datatype = C.TILEDB_CHAR // TILEDB_INT8 8-bit signed integer TILEDB_INT8 Datatype = C.TILEDB_INT8 // TILEDB_UINT8 8-bit unsigned integer TILEDB_UINT8 Datatype = C.TILEDB_UINT8 // TILEDB_INT16 16-bit signed integer TILEDB_INT16 Datatype = C.TILEDB_INT16 // TILEDB_UINT16 16-bit unsigned integer TILEDB_UINT16 Datatype = C.TILEDB_UINT16 // TILEDB_UINT32 32-bit unsigned integer TILEDB_UINT32 Datatype = C.TILEDB_UINT32 // TILEDB_UINT64 64-bit unsigned integer TILEDB_UINT64 Datatype = C.TILEDB_UINT64 // TILEDB_STRING_ASCII ASCII string TILEDB_STRING_ASCII Datatype = C.TILEDB_STRING_ASCII // TILEDB_STRING_UTF8 UTF-8 string TILEDB_STRING_UTF8 Datatype = C.TILEDB_STRING_UTF8 // TILEDB_STRING_UTF16 UTF-16 string TILEDB_STRING_UTF16 Datatype = C.TILEDB_STRING_UTF16 // TILEDB_STRING_UTF32 UTF-32 string TILEDB_STRING_UTF32 Datatype = C.TILEDB_STRING_UTF32 // TILEDB_STRING_UCS2 UCS2 string TILEDB_STRING_UCS2 Datatype = C.TILEDB_STRING_UCS2 // TILEDB_STRING_UCS4 UCS4 string TILEDB_STRING_UCS4 Datatype = C.TILEDB_STRING_UCS4 // TILEDB_ANY This can be any datatype. Must store (type tag, value) pairs. TILEDB_ANY Datatype = C.TILEDB_ANY // TILEDB_DATETIME_YEAR 64-bit signed integer representing year TILEDB_DATETIME_YEAR Datatype = C.TILEDB_DATETIME_YEAR // TILEDB_DATETIME_MONTH 64-bit signed integer representing month TILEDB_DATETIME_MONTH Datatype = C.TILEDB_DATETIME_MONTH // TILEDB_DATETIME_WEEK 64-bit signed integer representing week TILEDB_DATETIME_WEEK Datatype = C.TILEDB_DATETIME_WEEK // TILEDB_DATETIME_DAY 64-bit signed integer representing day TILEDB_DATETIME_DAY Datatype = C.TILEDB_DATETIME_DAY // TILEDB_DATETIME_HR 64-bit signed integer representing hour TILEDB_DATETIME_HR Datatype = C.TILEDB_DATETIME_HR // TILEDB_DATETIME_MIN 64-bit signed integer representing minute TILEDB_DATETIME_MIN Datatype = C.TILEDB_DATETIME_MIN // TILEDB_DATETIME_SEC 64-bit signed integer representing second TILEDB_DATETIME_SEC Datatype = C.TILEDB_DATETIME_SEC // TILEDB_DATETIME_MS 64-bit signed integer representing ms TILEDB_DATETIME_MS Datatype = C.TILEDB_DATETIME_MS // TILEDB_DATETIME_US 64-bit signed integer representing us TILEDB_DATETIME_US Datatype = C.TILEDB_DATETIME_US // TILEDB_DATETIME_NS 64-bit signed integer representing ns TILEDB_DATETIME_NS Datatype = C.TILEDB_DATETIME_NS // TILEDB_DATETIME_PS 64-bit signed integer representing ps TILEDB_DATETIME_PS Datatype = C.TILEDB_DATETIME_PS // TILEDB_DATETIME_FS 64-bit signed integer representing fs TILEDB_DATETIME_FS Datatype = C.TILEDB_DATETIME_FS // TILEDB_DATETIME_AS 64-bit signed integer representing as TILEDB_DATETIME_AS Datatype = C.TILEDB_DATETIME_AS // TILEDB_TIME_HR 64-bit signed integer representing hour TILEDB_TIME_HR Datatype = C.TILEDB_TIME_HR // TILEDB_TIME_MIN 64-bit signed integer representing minute TILEDB_TIME_MIN Datatype = C.TILEDB_TIME_MIN // TILEDB_TIME_SEC 64-bit signed integer representing second TILEDB_TIME_SEC Datatype = C.TILEDB_TIME_SEC // TILEDB_TIME_MS 64-bit signed integer representing ms TILEDB_TIME_MS Datatype = C.TILEDB_TIME_MS // TILEDB_TIME_US 64-bit signed integer representing us TILEDB_TIME_US Datatype = C.TILEDB_TIME_US // TILEDB_TIME_NS 64-bit signed integer representing ns TILEDB_TIME_NS Datatype = C.TILEDB_TIME_NS // TILEDB_TIME_PS 64-bit signed integer representing ps TILEDB_TIME_PS Datatype = C.TILEDB_TIME_PS // TILEDB_TIME_FS 64-bit signed integer representing fs TILEDB_TIME_FS Datatype = C.TILEDB_TIME_FS // TILEDB_TIME_AS 64-bit signed integer representing as TILEDB_TIME_AS Datatype = C.TILEDB_TIME_AS // TILEDB_BLOB 8-bit unsigned integer (or std::byte) TILEDB_BLOB Datatype = C.TILEDB_BLOB // TILEDB_BOOL 8-bit boolean type TILEDB_BOOL Datatype = C.TILEDB_BOOL // TILEDB_GEOM_WKB 8-bit unsigned integer (or std::byte) TILEDB_GEOM_WKB Datatype = C.TILEDB_GEOM_WKB // TILEDB_GEOM_WKT 8-bit unsigned integer (or std::byte) TILEDB_GEOM_WKT Datatype = C.TILEDB_GEOM_WKT )
func DatatypeFromString ¶ added in v0.8.4
DatatypeFromString converts from a datatype string to enum.
func (*Datatype) FromString ¶ added in v0.8.4
FromString converts from a datatype string to enum.
func (Datatype) GetValue ¶ added in v0.10.3
GetValue gets value stored in a void pointer for this data type.
func (Datatype) MakeSlice ¶ added in v0.6.0
MakeSlice makes a slice of the correct type corresponding to the datatype, with a given number of elements.
func (Datatype) MarshalJSON ¶ added in v0.8.4
MarshalJSON implements the interface for marshaling to json.
func (Datatype) ReflectKind ¶
ReflectKind returns the reflect kind given a datatype.
func (Datatype) ReflectType ¶ added in v0.23.1
ReflectType returns the reflect type given a datatype.
func (*Datatype) UnmarshalJSON ¶ added in v0.8.4
UnmarshalJSON implements the interface for unmarshaling from json.
type Dimension ¶
type Dimension struct {
// contains filtered or unexported fields
}
Dimension Describes one dimension of an Array. The dimension consists of a type, lower and upper bound, and tile-extent describing the memory ordering. Dimensions are added to a Domain.
func NewDimension ¶
func NewDimension(context *Context, name string, datatype Datatype, domain interface{}, extent interface{}) (*Dimension, error)
NewDimension allocates a new dimension.
Example ¶
// Create Config, this is optional config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Create Dimension dim, err := NewDimension(context, "test", TILEDB_INT32, []int32{1, 10}, int32(5)) if err != nil { // Handle error return } // Set Filter List filter, err := NewFilter(context, TILEDB_FILTER_GZIP) if err != nil { // Handle error return } filterList, err := NewFilterList(context) if err != nil { // Handle error return } err = filterList.AddFilter(filter) if err != nil { // Handle error return } err = dim.SetFilterList(filterList) if err != nil { // Handle error return }
Output:
func NewStringDimension ¶ added in v0.9.0
NewStringDimension allocates a new string dimension.
func (*Dimension) CellValNum ¶ added in v0.9.0
CellValNum returns the number of values of one cell on this attribute. For variable-sized attributes returns TILEDB_VAR_NUM.
func (*Dimension) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the dimension.
func (*Dimension) DumpSTDOUT ¶
DumpSTDOUT dumps the dimension in ASCII format to stdout.
func (*Dimension) FilterList ¶ added in v0.10.3
func (d *Dimension) FilterList() (*FilterList, error)
FilterList returns a copy of the filter list for attribute.
func (*Dimension) Free ¶
func (d *Dimension) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Dimension) SetCellValNum ¶ added in v0.9.0
SetCellValNum sets the number of values per cell for a dimension. If this is not used, the default is `1`. This is inferred from the type parameter of the NewDimension function, but can also be set manually.
func (*Dimension) SetFilterList ¶ added in v0.10.3
func (d *Dimension) SetFilterList(filterlist *FilterList) error
SetFilterList sets the dimension filterList.
type DimensionLabel ¶ added in v0.27.1
type DimensionLabel struct {
// contains filtered or unexported fields
}
func (*DimensionLabel) AttributeName ¶ added in v0.27.1
func (d *DimensionLabel) AttributeName() (string, error)
AttributeName returns the name of the attribute the label data is stored under.
func (*DimensionLabel) CellValNum ¶ added in v0.27.1
func (d *DimensionLabel) CellValNum() (uint32, error)
CellValNum returns the number of values per cell for the labels on the dimension label. For variable-sized labels the result is TILEDB_VAR_NUM.
func (*DimensionLabel) DimensionIndex ¶ added in v0.27.1
func (d *DimensionLabel) DimensionIndex() (uint32, error)
DimensionIndex returns the index of the dimension the dimension label provides labels for.
func (*DimensionLabel) Free ¶ added in v0.27.1
func (d *DimensionLabel) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*DimensionLabel) Name ¶ added in v0.27.1
func (d *DimensionLabel) Name() (string, error)
Name returns the name for the dimension label.
func (*DimensionLabel) Order ¶ added in v0.27.1
func (d *DimensionLabel) Order() (DataOrder, error)
Order returns the order of the labels on the dimension label.
func (*DimensionLabel) Type ¶ added in v0.27.1
func (d *DimensionLabel) Type() (Datatype, error)
Type returns the underlying Datatype for the dimension label.
func (*DimensionLabel) URI ¶ added in v0.27.1
func (d *DimensionLabel) URI() (string, error)
Uri Returns the Uri for the dimension label array.
type DimensionType ¶ added in v0.23.1
type DimensionType interface { ~string | ~float32 | ~float64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~bool }
DimensionType is a constraint for the types allowed for a TileDB dimension
type Domain ¶
type Domain struct {
// contains filtered or unexported fields
}
Domain represents the domain of an array. A Domain defines the set of Dimension objects for a given array. The properties of a Domain derive from the underlying dimensions. A Domain is a component of an ArraySchema.
func NewDomain ¶
NewDomain allocates a new domain.
Example ¶
// Create Config, this is optional config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Create Dimension dimension, err := NewDimension(context, "test", TILEDB_INT32, []int32{1, 10}, int32(5)) if err != nil { // Handle error return } // Create Domain domain, err := NewDomain(context) if err != nil { // Handle error return } // Add dimension to domain err = domain.AddDimensions(dimension) if err != nil { // Handle error return }
Output:
func (*Domain) AddDimensions ¶
AddDimensions adds one or more dimensions to a domain.
func (*Domain) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the domain.
func (*Domain) DimensionFromIndex ¶
DimensionFromIndex retrieves a dimension object from a domain by index.
func (*Domain) DimensionFromName ¶
DimensionFromName retrieves a dimension object from a domain by name (key).
func (*Domain) DumpSTDOUT ¶
DumpSTDOUT dumps the domain in ASCII format to stdout.
func (*Domain) Free ¶
func (d *Domain) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Domain) HasDimension ¶ added in v0.9.0
HasDimension returns true if dimension `dimName` is part of the domain.
type EncryptionType ¶ added in v0.2.0
type EncryptionType uint8
EncryptionType represents different encryption algorithms.
const ( // TILEDB_NO_ENCRYPTION No encryption TILEDB_NO_ENCRYPTION EncryptionType = C.TILEDB_NO_ENCRYPTION // TILEDB_AES_256_GCM AES-256-GCM encryption TILEDB_AES_256_GCM EncryptionType = C.TILEDB_AES_256_GCM )
func (EncryptionType) String ¶ added in v0.14.0
func (encryptionType EncryptionType) String() string
String returns a string representation.
type Enumeration ¶ added in v0.27.1
type Enumeration struct {
// contains filtered or unexported fields
}
Enumeration is a TileDB enumeration for Attributes
func ExtendEnumeration ¶ added in v0.27.1
func ExtendEnumeration[T EnumerationType](tdbCtx *Context, e *Enumeration, values []T) (*Enumeration, error)
ExtendEnumeration extends an existing enumeration to add more values. The returned value should be used with ArraySchemaEvolution.ApplyExtendedEnumeration to make changes persistent.
func NewOrderedEnumeration ¶ added in v0.27.1
func NewOrderedEnumeration[T EnumerationType](tdbCtx *Context, name string, values []T) (*Enumeration, error)
NewOrderedEnumeration creates an ordered enumeration with name and values.
func NewUnorderedEnumeration ¶ added in v0.27.1
func NewUnorderedEnumeration[T EnumerationType](tdbCtx *Context, name string, values []T) (*Enumeration, error)
NewOrderedEnumeration creates an unordered enumeration with name and values.
func (*Enumeration) CellValNum ¶ added in v0.27.1
func (e *Enumeration) CellValNum() (uint32, error)
Type returns the number of cells for each enumeration value. It is 1 except for strings which is TILEDB_VAR_NUM.
func (*Enumeration) Dump ¶ added in v0.27.1
func (e *Enumeration) Dump(path string) error
Dump creates the file at path (must not exist) and writes a human-readable description of the enumeration.
func (*Enumeration) DumpSTDOUT ¶ added in v0.27.1
func (e *Enumeration) DumpSTDOUT() error
DumpSTDOUT writes a human-readable description of the enumeration to os.Stdout.
func (*Enumeration) Free ¶ added in v0.27.1
func (e *Enumeration) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Enumeration) IsOrdered ¶ added in v0.27.1
func (e *Enumeration) IsOrdered() (bool, error)
IsOrdered returns whether the enumerations values are ordered. Ordered values can be used with comparison operators in QueryConditions. Non-ordered values can be tested only for equality.
func (*Enumeration) Name ¶ added in v0.27.1
func (e *Enumeration) Name() (string, error)
Name returns the name of the enumeration.
func (*Enumeration) Type ¶ added in v0.27.1
func (e *Enumeration) Type() (Datatype, error)
Type returns the TileDB type of the enumeration.
func (*Enumeration) Values ¶ added in v0.27.1
func (e *Enumeration) Values() (interface{}, error)
Values returns the enumeration values. The returned interface is a slice guaranteed to be cast to the type of the enumeration.
type EnumerationType ¶ added in v0.27.1
type EnumerationType interface { ~string | ~float32 | ~float64 | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~int8 | ~int16 | ~int32 | ~int64 | ~bool }
EnumerationType is a constraint on valid types for Enumerations
type File ¶ added in v0.27.1
type File struct {
// contains filtered or unexported fields
}
File represents a TileDB filestore file. This is a regular TileDB array, you can query and checkout older versions, and it has a schema suitable to store files as byte arrays.
type FileStoreMimeType ¶ added in v0.16.2
type FileStoreMimeType uint32
FileStoreMimeType is an enum for TileDB filestore mime types
type Filter ¶ added in v0.2.0
type Filter struct {
// contains filtered or unexported fields
}
Filter represents
func NewFilter ¶ added in v0.2.0
func NewFilter(context *Context, filterType FilterType) (*Filter, error)
NewFilter allocates a new filter.
func (*Filter) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the filter.
func (*Filter) Free ¶ added in v0.2.0
func (f *Filter) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Filter) Option ¶ added in v0.2.0
func (f *Filter) Option(filterOption FilterOption) (interface{}, error)
Option fetches the specified option set on a filter. Returns an interface{} dependent on the option being fetched var optionValue int32 optionValueInterface, err := filter.Option(TILEDB_FILTER_GZIP) optionValue = optionValueInterface.(int32)
func (*Filter) SetOption ¶ added in v0.2.0
func (f *Filter) SetOption(filterOption FilterOption, valueInterface interface{}) error
SetOption sets an option on a filter. Options are filter dependent; this function returns an error if the given option is not valid for the given filter.
func (*Filter) Type ¶ added in v0.2.0
func (f *Filter) Type() (FilterType, error)
Type returns the filter type.
type FilterList ¶ added in v0.2.0
type FilterList struct {
// contains filtered or unexported fields
}
FilterList represents
func NewFilterList ¶ added in v0.2.0
func NewFilterList(context *Context) (*FilterList, error)
Alloc a new FilterList
func (*FilterList) AddFilter ¶ added in v0.2.0
func (f *FilterList) AddFilter(filter *Filter) error
AddFilter appends a filter to a filter list. Data is processed through each filter in the order the filters were added.
func (*FilterList) Context ¶ added in v0.14.2
func (f *FilterList) Context() *Context
Context exposes the internal TileDB context used to initialize the filter list
func (*FilterList) FilterFromIndex ¶ added in v0.2.0
func (f *FilterList) FilterFromIndex(index uint32) (*Filter, error)
FilterFromIndex Retrieves a filter object from a filter list by index.
func (*FilterList) Filters ¶ added in v0.2.0
func (f *FilterList) Filters() ([]*Filter, error)
Filters return slice of filters applied to filter list
func (*FilterList) Free ¶ added in v0.2.0
func (f *FilterList) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*FilterList) MaxChunkSize ¶ added in v0.2.0
func (f *FilterList) MaxChunkSize() (uint32, error)
MaxChunkSize Gets the maximum tile chunk size for a filter list.
func (*FilterList) NFilters ¶ added in v0.2.0
func (f *FilterList) NFilters() (uint32, error)
NFilters Retrieves the number of filters in a filter list.
func (*FilterList) SetMaxChunkSize ¶ added in v0.2.0
func (f *FilterList) SetMaxChunkSize(maxChunkSize uint32) error
SetMaxChunkSize sets the maximum tile chunk size for a filter list.
type FilterOption ¶ added in v0.2.0
type FilterOption uint8
FilterOption for a given filter
const ( // TILEDB_COMPRESSION_LEVEL Compression level. Type: `int32_t`. TILEDB_COMPRESSION_LEVEL FilterOption = C.TILEDB_COMPRESSION_LEVEL // TILEDB_BIT_WIDTH_MAX_WINDOW Max window length for bit width reduction. Type: `uint32_t`. TILEDB_BIT_WIDTH_MAX_WINDOW FilterOption = C.TILEDB_BIT_WIDTH_MAX_WINDOW // TILEDB_POSITIVE_DELTA_MAX_WINDOW Max window length for positive-delta encoding. Type: `uint32_t`. TILEDB_POSITIVE_DELTA_MAX_WINDOW FilterOption = C.TILEDB_POSITIVE_DELTA_MAX_WINDOW )
type FilterType ¶ added in v0.2.0
type FilterType uint8
FilterType for attribute/coordinates/offsets filters
const ( // TILEDB_FILTER_NONE No-op filter TILEDB_FILTER_NONE FilterType = C.TILEDB_FILTER_NONE // TILEDB_FILTER_GZIP Gzip compressor TILEDB_FILTER_GZIP FilterType = C.TILEDB_FILTER_GZIP // TILEDB_FILTER_ZSTD Zstandard compressor TILEDB_FILTER_ZSTD FilterType = C.TILEDB_FILTER_ZSTD // TILEDB_FILTER_LZ4 LZ4 compressor TILEDB_FILTER_LZ4 FilterType = C.TILEDB_FILTER_LZ4 // TILEDB_FILTER_RLE Run-length encoding compressor TILEDB_FILTER_RLE FilterType = C.TILEDB_FILTER_RLE // TILEDB_FILTER_BZIP2 Bzip2 compressor TILEDB_FILTER_BZIP2 FilterType = C.TILEDB_FILTER_BZIP2 // TILEDB_FILTER_DOUBLE_DELTA Double-delta compressor TILEDB_FILTER_DOUBLE_DELTA FilterType = C.TILEDB_FILTER_DOUBLE_DELTA // TILEDB_FILTER_BIT_WIDTH_REDUCTION Bit width reduction filter. TILEDB_FILTER_BIT_WIDTH_REDUCTION FilterType = C.TILEDB_FILTER_BIT_WIDTH_REDUCTION // TILEDB_FILTER_BITSHUFFLE Bitshuffle filter. TILEDB_FILTER_BITSHUFFLE FilterType = C.TILEDB_FILTER_BITSHUFFLE // TILEDB_FILTER_BYTESHUFFLE Byteshuffle filter. TILEDB_FILTER_BYTESHUFFLE FilterType = C.TILEDB_FILTER_BYTESHUFFLE // TILEDB_FILTER_POSITIVE_DELTA Positive-delta encoding filter. TILEDB_FILTER_POSITIVE_DELTA FilterType = C.TILEDB_FILTER_POSITIVE_DELTA // TILEDB_FILTER_SCALE_FLOAT FILTER_SCALE_FLOAT float scaling filter. TILEDB_FILTER_SCALE_FLOAT FilterType = C.TILEDB_FILTER_SCALE_FLOAT // TILEDB_FILTER_DELTA Delta encoding filter. TILEDB_FILTER_DELTA FilterType = C.TILEDB_FILTER_DELTA )
type FolderData ¶ added in v0.14.4
FolderData is a type encapsulating list of folders and files
type FragmentInfo ¶ added in v0.11.0
type FragmentInfo struct {
// contains filtered or unexported fields
}
FragmentInfo struct representing a TileDB fragment info object.
A FragmentInfo object contains information about fragnents of an array that can be queried using methods taht have receiver type of *FragmentInfo
func NewFragmentInfo ¶ added in v0.11.0
func NewFragmentInfo(tdbCtx *Context, uri string) (*FragmentInfo, error)
NewFragmentInfo allocates a new fragment info for a given array and fetches all the fragment information for that array.
func (*FragmentInfo) Config ¶ added in v0.18.1
func (fI *FragmentInfo) Config() (*Config, error)
Config gets the fragment config.
func (*FragmentInfo) Context ¶ added in v0.14.2
func (fI *FragmentInfo) Context() *Context
Context exposes the internal TileDB context used to initialize the fragment info.
func (*FragmentInfo) DumpSTDOUT ¶ added in v0.11.0
func (fI *FragmentInfo) DumpSTDOUT() error
DumpSTDOUT dumps the fragment info in ASCII format in the selected output.
func (*FragmentInfo) Free ¶ added in v0.11.0
func (fI *FragmentInfo) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*FragmentInfo) GetCellNum ¶ added in v0.11.0
func (fI *FragmentInfo) GetCellNum(fid uint32) (uint64, error)
GetCellNum retrieves the number of cells written to the fragment by the user. In the case of sparse fragments, this is the number of non-empty cells in the fragment. In the case of dense fragments, TileDB may add fill values to populate partially populated tiles. Those fill values are counted in the returned number of cells. In other words, the cell number is derived from the number of *integral* tiles written in the file.
func (*FragmentInfo) GetDense ¶ added in v0.11.0
func (fI *FragmentInfo) GetDense(fid uint32) (bool, error)
GetDense checks if a fragment is dense.
func (*FragmentInfo) GetFragmentNum ¶ added in v0.11.0
func (fI *FragmentInfo) GetFragmentNum() (uint32, error)
GetFragmentNum gets the number of fragments.
func (*FragmentInfo) GetFragmentSize ¶ added in v0.11.0
func (fI *FragmentInfo) GetFragmentSize(fid uint32) (uint64, error)
GetFragmentSize gets the fragment size in bytes.
func (*FragmentInfo) GetFragmentURI ¶ added in v0.11.0
func (fI *FragmentInfo) GetFragmentURI(fid uint32) (string, error)
GetFragmentURI gets a fragment URI. fid is the index of the fragment of interest.
func (*FragmentInfo) GetNonEmptyDomainFromIndex ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainFromIndex(fid uint32, did uint32) (*NonEmptyDomain, error)
GetNonEmptyDomainFromIndex retrieves the non-empty domain from a given fragment for a given dimension index. func (fI *FragmentInfo) GetNonEmptyDomainFromIndex
func (*FragmentInfo) GetNonEmptyDomainFromName ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainFromName(fid uint32, did string) (*NonEmptyDomain, error)
GetNonEmptyDomainFromName retrieves the non-empty domain from a given fragment for a given dimension name. func (fI *FragmentInfo) GetNonEmptyDomainFromName
func (*FragmentInfo) GetNonEmptyDomainVarFromIndex ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainVarFromIndex(fid uint32, did uint32) (*NonEmptyDomain, error)
GetNonEmptyDomainVarFromIndex retrieves the non-empty domain from a fragment for a given dimension index. Applicable to var-sized dimensions.
func (*FragmentInfo) GetNonEmptyDomainVarFromName ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainVarFromName(fid uint32, did string) (*NonEmptyDomain, error)
GetNonEmptyDomainVarFromName retrieves the non-empty domain from a fragment for a given dimension name. Applicable to var-sized dimensions.
func (*FragmentInfo) GetNonEmptyDomainVarSizeFromIndex ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainVarSizeFromIndex(fid uint32, did uint32) ( uint64, uint64, error)
GetNonEmptyDomainVarSizeFromIndex retrieves the non-empty domain range sizes from a fragment for a given dimension index. Applicable to var-sized dimensions. func (fI *FragmentInfo) GetNonEmptyDomainVarSizeFromName
func (*FragmentInfo) GetNonEmptyDomainVarSizeFromName ¶ added in v0.11.0
func (fI *FragmentInfo) GetNonEmptyDomainVarSizeFromName(fid uint32, did string) ( uint64, uint64, error)
GetNonEmptyDomainVarSizeFromName retrieves the non-empty domain range sizes from a fragment for a given dimension name. Applicable to var-sized dimensions.
func (*FragmentInfo) GetSparse ¶ added in v0.11.0
func (fI *FragmentInfo) GetSparse(fid uint32) (bool, error)
GetSparse checks if a fragment is sparse.
func (*FragmentInfo) GetTimestampRange ¶ added in v0.11.0
func (fI *FragmentInfo) GetTimestampRange(fid uint32) (uint64, uint64, error)
GetTimestampRange gets the timestamp range of a fragment.
func (*FragmentInfo) GetToVacuumNum ¶ added in v0.11.0
func (fI *FragmentInfo) GetToVacuumNum() (uint32, error)
GetToVacuumNum gets the number of fragments to vacuum.
func (*FragmentInfo) GetToVacuumURI ¶ added in v0.11.0
func (fI *FragmentInfo) GetToVacuumURI(fid uint32) (string, error)
GetToVacuumURI gets the URI of the fragment to vacuum with the given index. fid is the index of the fragment of interest.
func (*FragmentInfo) GetUnconsolidatedMetadataNum ¶ added in v0.11.0
func (fI *FragmentInfo) GetUnconsolidatedMetadataNum() (uint32, error)
GetUnconsolidatedMetadataNum gets the number of fragments with unconsolidated metadata. func (fI *FragmentInfo) GetUnconsolidatedMetadataNum
func (*FragmentInfo) GetVersion ¶ added in v0.11.0
func (fI *FragmentInfo) GetVersion(fid uint32) (uint32, error)
GetVersion retrieves the format version of a fragment.
func (*FragmentInfo) HasConsolidatedMetadata ¶ added in v0.11.0
func (fI *FragmentInfo) HasConsolidatedMetadata(fid uint32) (bool, error)
HasConsolidatedMetadata checks if a fragment has consolidated metadata.
func (*FragmentInfo) Load ¶ added in v0.11.0
func (fI *FragmentInfo) Load() error
Load loads the fragment info.
func (*FragmentInfo) SetConfig ¶ added in v0.18.1
func (fI *FragmentInfo) SetConfig(config *Config) error
SetConfig sets the fragment config.
func (*FragmentInfo) String ¶ added in v0.34.0
func (fI *FragmentInfo) String() (string, error)
String retrieves the string representation of the FragmentInfo
type Freeable ¶ added in v0.16.3
type Freeable interface {
Free() // Releases non–garbage-collected resources held by this object.
}
Freeable represents an object that can be Free'd at the end of its lifetime to release its resources.
type Group ¶ added in v0.27.1
type Group struct {
// contains filtered or unexported fields
}
Group represents a wrapped TileDB embedded group
func (*Group) AddMemberWithType ¶ added in v0.34.0
func (g *Group) AddMemberWithType(uri, name string, isRelativeURI bool, objectType ObjectTypeEnum) error
AddMemberWithType adds a member to the Group providing its type. This method is recommended for performance when operating on remote groups.
func (*Group) Delete ¶ added in v0.27.1
Delete deletes written data from an open group. The group must be opened in MODIFY_EXCLUSIVE mode, otherwise the function will error out. Set recursive true if all data inside the group is to be deleted.
func (*Group) DeleteMetadata ¶ added in v0.27.1
func (*Group) Deserialize ¶ added in v0.27.1
func (g *Group) Deserialize(buffer *Buffer, serializationType SerializationType, clientSide bool) error
Deserialize deserializes the group from the given buffer.
func (*Group) GetIsRelativeURIByName ¶ added in v0.27.1
GetIsRelativeURIByName returns whether a named member of the group has a uri relative to the group
func (*Group) GetMemberByName ¶ added in v0.27.1
func (*Group) GetMemberCount ¶ added in v0.27.1
func (*Group) GetMemberFromIndex ¶ added in v0.27.1
func (*Group) GetMetadata ¶ added in v0.27.1
func (*Group) GetMetadataFromIndex ¶ added in v0.27.1
func (g *Group) GetMetadataFromIndex(index uint64) (*GroupMetadata, error)
func (*Group) GetMetadataFromIndexWithValueLimit ¶ added in v0.27.1
func (g *Group) GetMetadataFromIndexWithValueLimit(index uint64, limit *uint) (*GroupMetadata, error)
func (*Group) GetMetadataNum ¶ added in v0.27.1
func (*Group) IsOpen ¶ added in v0.34.0
IsOpen returns true if the Group is open or false if the group is closed.
func (*Group) PutMetadata ¶ added in v0.27.1
PutMetadata puts a metadata key-value item to an open group. The group must be opened in WRITE mode, otherwise the function will error out.
func (*Group) QueryType ¶ added in v0.34.0
QueryType returns the QueryType for the currently opened group.
func (*Group) RemoveMember ¶ added in v0.27.1
type GroupMetadata ¶ added in v0.27.1
type GroupMetadata struct { Key string KeyLen uint32 Datatype Datatype ValueNum uint Value interface{} }
GroupMetadata defines metadata for the group
func (GroupMetadata) MarshalJSON ¶ added in v0.27.1
func (g GroupMetadata) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaller interface for GroupMetadata
type Layout ¶
type Layout int8
Layout cell/tile layout
const ( // TILEDB_ROW_MAJOR Row-major layout TILEDB_ROW_MAJOR Layout = C.TILEDB_ROW_MAJOR // TILEDB_COL_MAJOR Column-major layout TILEDB_COL_MAJOR Layout = C.TILEDB_COL_MAJOR // TILEDB_GLOBAL_ORDER Global-order layout TILEDB_GLOBAL_ORDER Layout = C.TILEDB_GLOBAL_ORDER // TILEDB_UNORDERED Unordered layout TILEDB_UNORDERED Layout = C.TILEDB_UNORDERED // TILEDB_HILBERT Hilbert layout TILEDB_HILBERT Layout = C.TILEDB_HILBERT )
type NonEmptyDomain ¶ added in v0.4.0
type NonEmptyDomain struct { DimensionName string Bounds interface{} }
NonEmptyDomain contains the non empty dimension bounds and dimension name
func DeserializeArrayNonEmptyDomain ¶ added in v0.6.0
func DeserializeArrayNonEmptyDomain(a *Array, buffer *Buffer, serializationType SerializationType) ([]NonEmptyDomain, bool, error)
DeserializeArrayNonEmptyDomain deserializes an array nonempty domain.
type NumOfFragmentsData ¶ added in v0.10.0
NumOfFragmentsData is a type
type ObjectList ¶ added in v0.10.3
type ObjectList struct {
// contains filtered or unexported fields
}
ObjectList defines the value of data returned by object iteration callback
func ObjectLs ¶ added in v0.10.3
func ObjectLs(tdbCtx *Context, path string) (*ObjectList, error)
ObjectLs is similar to `tiledb_walk`, but now the function visits only the children of `path` (it does not recursively continue to the children directories).
func ObjectWalk ¶ added in v0.10.3
func ObjectWalk(tdbCtx *Context, path string, walkOrder WalkOrder) (*ObjectList, error)
ObjectWalk (iterates) over the TileDB objects contained in *path*. The traversal is done recursively in the order defined by the user. The user provides a callback function which is applied on each of the visited TileDB objects. The iteration continues for as long the callback returns non-zero, and stops when the callback returns 0. Note that this function ignores any object (e.g., file or directory) that is not TileDB-related.
type ObjectTypeEnum ¶ added in v0.10.3
type ObjectTypeEnum int8
ObjectTypeEnum
const ( // Invalid object TILEDB_INVALID ObjectTypeEnum = C.TILEDB_INVALID // Group object TILEDB_GROUP ObjectTypeEnum = C.TILEDB_GROUP // Array object TILEDB_ARRAY ObjectTypeEnum = C.TILEDB_ARRAY )
func ObjectType ¶ added in v0.10.3
func ObjectType(tdbCtx *Context, path string) (ObjectTypeEnum, error)
ObjectType returns the object type A TileDB "object" is currently either a TileDB array or a TileDB group.
func ObjectTypeFromString ¶ added in v0.15.0
func ObjectTypeFromString(s string) (ObjectTypeEnum, error)
ObjectTypeFromString returns the internal representation of the object type
func (ObjectTypeEnum) String ¶ added in v0.15.0
func (o ObjectTypeEnum) String() string
String returns string representation
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query construct and execute read/write queries on a tiledb Array
func NewQuery ¶
NewQuery creates a TileDB query object.
If the provided Context is nil, the context of the Array is used instead. The storage manager also acquires a shared lock on the array. This means multiple read and write queries to the same array can be made concurrently (in TileDB, only consolidation requires an exclusive lock for a short period of time).
Example ¶
ExampleNewQuery shows a complete write and read example
// Create configuration config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Test create dimension dimension, err := NewDimension(context, "dim1", TILEDB_INT8, []int8{0, 9}, int8(10)) if err != nil { // Handle error return } // Test creating domain domain, err := NewDomain(context) if err != nil { // Handle error return } // Add dimension err = domain.AddDimensions(dimension) if err != nil { // Handle error return } // Create array schema arraySchema, err := NewArraySchema(context, TILEDB_DENSE) if err != nil { // Handle error return } // Create attribute to add to schema attribute, err := NewAttribute(context, "a1", TILEDB_INT32) if err != nil { // Handle error return } // Create attribute to add to schema attribute2, err := NewAttribute(context, "a2", TILEDB_STRING_ASCII) if err != nil { // Handle error return } // Create attribute to add to schema attribute3, err := NewAttribute(context, "a3", TILEDB_FLOAT32) if err != nil { // Handle error return } // Create attribute to add to schema attribute4, err := NewAttribute(context, "a4", TILEDB_STRING_UTF8) if err != nil { // Handle error return } // Set a3 to be variable length err = attribute3.SetCellValNum(TILEDB_VAR_NUM) if err != nil { // Handle error return } // Set a4 to be variable length err = attribute4.SetCellValNum(TILEDB_VAR_NUM) if err != nil { // Handle error return } // Add Attribute err = arraySchema.AddAttributes(attribute, attribute2, attribute3, attribute4) if err != nil { // Handle error return } // Set Domain err = arraySchema.SetDomain(domain) if err != nil { // Handle error return } // Validate Schema err = arraySchema.Check() if err != nil { // Handle error return } // create temp array name and path // normal usage would be "my_array" uri // Temp path is used here so unit test can clean up after itself tmpArrayPath, err := os.MkdirTemp("", "tiledb_test_array") if err != nil { // Handle error return } defer os.RemoveAll(tmpArrayPath) // Create new array struct array, err := NewArray(context, tmpArrayPath) if err != nil { // Handle error return } // Create array on disk err = array.Create(arraySchema) if err != nil { // Handle error return } // Open array for writting err = array.Open(TILEDB_WRITE) if err != nil { // Handle error return } // Create write query query, err := NewQuery(context, array) if err != nil { // Handle error return } // Create subarray subarray, err := array.NewSubarray() if err != nil { // Handle error return } // Limit writting to subarray err = subarray.SetSubArray([]int8{0, 1}) if err != nil { // Handle error return } // Set subarray to query err = query.SetSubarray(subarray) if err != nil { // Handle error return } // Set write layout err = query.SetLayout(TILEDB_ROW_MAJOR) if err != nil { // Handle error return } // Create write buffers bufferA1 := []int32{1, 2} _, err = query.SetDataBuffer("a1", bufferA1) if err != nil { // Handle error return } bufferA2 := []byte("ab") _, err = query.SetDataBuffer("a2", bufferA2) if err != nil { // Handle error return } bufferA3 := []float32{1.0, 2.0, 3.0, 4.0, 5.0} offsetBufferA3 := []uint64{0, 3} _, err = query.SetDataBuffer("a3", bufferA3) if err != nil { // Handle error return } _, err = query.SetOffsetsBuffer("a3", offsetBufferA3) if err != nil { // Handle error return } bufferA4 := []byte("hello" + "world") offsetBufferA4 := []uint64{0, 5} _, err = query.SetDataBuffer("a4", bufferA4) if err != nil { // Handle error return } _, err = query.SetOffsetsBuffer("a4", offsetBufferA4) if err != nil { // Handle error return } err = query.Submit() if err != nil { // Handle error return } // Validate status, since query was used this is should be complete status, err := query.Status() if err != nil { // Handle error return } if status != TILEDB_COMPLETED { // handle non-complete query // If applicable read partial data in buffer // and re-submit for remaining results } // Finalize Write err = query.Finalize() if err != nil { // Handle error return } // Close and prepare to read err = array.Close() if err != nil { // Handle error return } // Reopen array for reading err = array.Open(TILEDB_READ) if err != nil { // Handle error return } // Create query for reading query, err = NewQuery(context, array) if err != nil { // Handle error return } // Create subarray subarray, err = array.NewSubarray() if err != nil { // Handle error return } // Set read subarray to only data that was written err = subarray.SetSubArray([]int8{0, 1}) if err != nil { // Handle error return } // Set subarray to query err = query.SetSubarray(subarray) if err != nil { // Handle error return } // Set empty buffers for reading readBufferA1 := make([]int32, 2) _, err = query.SetDataBuffer("a1", readBufferA1) if err != nil { // Handle error return } readBufferA2 := make([]byte, 2) _, err = query.SetDataBuffer("a2", readBufferA2) if err != nil { // Handle error return } readBufferA3 := make([]float32, 5) readOffsetBufferA3 := make([]uint64, 2) _, err = query.SetDataBuffer("a3", readBufferA3) if err != nil { // Handle error return } _, err = query.SetOffsetsBuffer("a3", readOffsetBufferA3) if err != nil { // Handle error return } readBufferA4 := make([]byte, 10) readOffsetBufferA4 := make([]uint64, 2) _, err = query.SetDataBuffer("a4", readBufferA4) if err != nil { // Handle error return } _, err = query.SetOffsetsBuffer("a4", readOffsetBufferA4) if err != nil { // Handle error return } // Set read layout err = query.SetLayout(TILEDB_ROW_MAJOR) if err != nil { // Handle error return } // Submit read query err = query.Submit() if err != nil { // Handle error return } // Wait for status to return complete or to error // Loop while status is inprogress for status, err = query.Status(); status == TILEDB_INPROGRESS && err == nil; status, err = query.Status() { // Do something while query is running } if err != nil { // Handle error return } // Results should be returned hasResults, err := query.HasResults() if err != nil { // Handle error return } if hasResults { // Do something with read buffer } stats, err := query.Stats() if err != nil { // Handle error return } if len(stats) > 0 { // Do something with stats }
Output:
func (*Query) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the query.
func (*Query) EstResultSize ¶ added in v0.9.1
EstResultSize gets the query estimated result size in bytes for an attribute.
func (*Query) EstResultSizeNullable ¶ added in v0.11.0
EstResultSizeNullable gets the query estimated result size in bytes for an attribute.
func (*Query) EstResultSizeVar ¶ added in v0.9.1
EstResultSizeVar gets the query estimated result size in bytes for a var sized attribute.
func (*Query) EstResultSizeVarNullable ¶ added in v0.11.0
EstResultSizeVarNullable gets the query estimated result size in bytes for a var sized attribute.
func (*Query) EstimateBufferElements ¶ added in v0.10.0
EstimateBufferElements computes an upper bound on the buffer elements needed to read a subarray or range(s). Returns a map of attribute or dimension name to the maximum number of elements that can be read in the given subarray. For each attribute, a pair of numbers are returned. The first, for variable-length attributes, is the maximum number of offsets for that attribute in the given subarray. For fixed-length attributes and coordinates, the first is always 0. The second is the maximum number of elements for that attribute in the given subarray.
func (*Query) Finalize ¶
Finalize flushes all internal state of a query object and finalizes the query. This is applicable only to global layout writes. It has no effect for any other query type.
func (*Query) Free ¶
func (q *Query) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*Query) GetDataBuffer ¶ added in v0.20.1
GetDataBuffer retrieves the data buffer of an attribute/dimension.
func (*Query) GetExpectedDataBufferLength ¶ added in v0.20.1
GetExpectedDataBufferLength retrieves the size of the data buffer of an attribute/dimension. This is equivalent to calling GetDataBuffer and taking the length of the returned buffer except in the case of a deserialized server side read query where GetDataBuffer returns nil. Serialization of server side read queries serializes only lengths not buffers. The caller should use this method to get the size and allocate a buffer for the read query.
func (*Query) GetExpectedOffsetsBufferLength ¶ added in v0.20.1
GetExpectedOffsetsBufferLength retrieves the size of the offset buffer for a var-sized attribute/dimension. This is equivalent to calling GetOffsetsBuffer and taking the length of the returned buffer except in the case of a deserialized read query where GetOffsetsBuffer returns nil. Serialization of read queries serializes only lengths not buffers. The caller should use this method to get the size and allocate a buffer for the read query.
func (*Query) GetExpectedValidityBufferLength ¶ added in v0.20.1
GetExpectedValidityBufferLength retrieves the size of the validity buffer for a nullable attribute/dimension. This is equivalent to calling GetValidityBuffer and taking the length of the returned buffer except in the case of a deserialized read query where GetValidityBuffer returns nil. Serialization of read queries serializes only lengths not buffers. The caller should use this method to get the size and allocate a buffer for the read query.
func (*Query) GetFragmentNum ¶ added in v0.9.1
GetFragmentNum returns num of fragments.
func (*Query) GetFragmentTimestampRange ¶ added in v0.9.1
GetFragmentTimestampRange returns timestamp range for a fragment.
func (*Query) GetFragmentURI ¶ added in v0.9.1
GetFragmentURI returns the uri for a fragment.
func (*Query) GetOffsetsBuffer ¶ added in v0.20.1
GetOffsetsBuffer retrieves the offset buffer for a var-sized attribute/dimension.
func (*Query) GetPlan ¶ added in v0.27.1
GetPlan returns a json encoding of the query plan for the query. Example:
{ "TileDB Query Plan": { "Array.Type": "sparse", "Array.URI": "file:///tmp/TestHandleQueryPlanRequest732268097/001/t-testhandlequeryplanrequest-b757271e", "Query.Attributes": [ "a1", "a2", "a3", "a4", "a5" ], "Query.Dimensions": [ "dim1" ], "Query.Layout": "unordered", "Query.Strategy.Name": "UnorderedWriter", "VFS.Backend": "file" } }
func (*Query) GetRanges
deprecated
added in
v0.7.1
func (q *Query) GetRanges() (map[string][]RangeLimits, error)
GetRanges gets the number of dimensions from the array under current query and builds an array of dimensions that have as memmbers arrays of ranges.
Deprecated: Use Subarrays
func (*Query) GetSubarray ¶ added in v0.23.1
GetSubarray gets the subarray set on the query.
func (*Query) GetValidityBuffer ¶ added in v0.20.1
GetValidityBuffer retrieves the validity buffer for a nullable attribute/dimension.
func (*Query) HasResults ¶
HasResults returns true if the query has results. Applicable only to read queries (it returns false for write queries).
func (*Query) RelevantFragmentNum ¶ added in v0.27.1
func (*Query) ResultBufferElements ¶ added in v0.5.0
ResultBufferElements returns the number of elements in the result buffers from a read query. This is a map from the attribute name to a pair of values. The first is number of elements (offsets) for var size attributes, and the second is number of elements in the data buffer. For fixed sized attributes (and coordinates), the first is always 0.
func (*Query) SetDataBuffer ¶ added in v0.20.1
SetDataBuffer sets the buffer for a fixed-sized attribute to a query.
func (*Query) SetDataBufferUnsafe ¶ added in v0.20.1
func (q *Query) SetDataBufferUnsafe(attribute string, buffer unsafe.Pointer, bufferSize uint64) (*uint64, error)
SetDataBufferUnsafe sets the buffer for a fixed-sized attribute to a query. This takes an unsafe pointer which is passsed straight to tiledb c_api for advanced usage.
func (*Query) SetOffsetsBuffer ¶ added in v0.20.1
SetOffsetsBuffer sets the offset buffer for a var-sized attribute/dimension.
func (*Query) SetOffsetsBufferUnsafe ¶ added in v0.20.1
func (q *Query) SetOffsetsBufferUnsafe(attribute string, offset unsafe.Pointer, offsetSize uint64) (*uint64, error)
SetOffsetsBufferUnsafe sets the offset buffer for a var-sized attribute/dimension. This takes an unsafe pointer which is passed straight to tiledb c_api for advanced usage.
func (*Query) SetQueryCondition ¶ added in v0.12.0
func (q *Query) SetQueryCondition(cond *QueryCondition) error
SetQueryCondition sets a query condition on a read query.
func (*Query) SetSubarray ¶ added in v0.23.1
SetSubarray sets the subarray for the query.
func (*Query) SetValidityBuffer ¶ added in v0.20.1
SetValidityBuffer sets the validity buffer for nullable attribute/dimension.
func (*Query) SetValidityBufferUnsafe ¶ added in v0.20.1
func (q *Query) SetValidityBufferUnsafe(attribute string, buffer unsafe.Pointer, bufferSize uint64) (*uint64, error)
SetValidityBufferUnsafe sets the validity buffer for nullable attribute/dimension. This takes an unsafe pointer which is passed straight to tiledb c_api for advanced usage.
func (*Query) Status ¶
func (q *Query) Status() (QueryStatus, error)
Status returns the status of a query.
func (*Query) StatusDetails ¶ added in v0.27.1
func (q *Query) StatusDetails() (QueryStatusDetails, error)
StatusDetails returns extended query status details.
func (*Query) Submit ¶
Submit a TileDB query This will block until query is completed
Note: Finalize() must be invoked after finish writing in global layout (via repeated invocations of Submit()), in order to flush any internal state. For the case of reads, if the returned status is TILEDB_INCOMPLETE, TileDB could not fit the entire result in the user’s buffers. In this case, the user should consume the read results (if any), optionally reset the buffers with SetBuffer(), and then resubmit the query until the status becomes TILEDB_COMPLETED. If all buffer sizes after the termination of this function become 0, then this means that no useful data was read into the buffers, implying that the larger buffers are needed for the query to proceed. In this case, the users must reallocate their buffers (increasing their size), reset the buffers with set_buffer(), and resubmit the query.
type QueryCondition ¶ added in v0.12.0
type QueryCondition struct {
// contains filtered or unexported fields
}
QueryCondition defines a condition used for a query.
func NewQueryCondition ¶ added in v0.12.0
func NewQueryCondition(tdbCtx *Context, attributeName string, op QueryConditionOp, value interface{}) (*QueryCondition, error)
NewQueryCondition allocates and initializes a new query condition.
Example ¶
ExampleNewQueryCondition shows a complete write, delete and read example
// Create configuration config, err := NewConfig() if err != nil { // Handle error return } // Test context with config context, err := NewContext(config) if err != nil { // Handle error return } // Test create dimension dimension, err := NewDimension(context, "dim1", TILEDB_INT8, []int8{0, 9}, int8(10)) if err != nil { // Handle error return } // Test creating domain domain, err := NewDomain(context) if err != nil { // Handle error return } // Add dimension err = domain.AddDimensions(dimension) if err != nil { // Handle error return } // Create array schema arraySchema, err := NewArraySchema(context, TILEDB_SPARSE) if err != nil { // Handle error return } // Create attribute to add to schema attribute, err := NewAttribute(context, "a1", TILEDB_INT32) if err != nil { // Handle error return } // Add Attribute err = arraySchema.AddAttributes(attribute) if err != nil { // Handle error return } // Set Domain err = arraySchema.SetDomain(domain) if err != nil { // Handle error return } err = arraySchema.SetCellOrder(TILEDB_ROW_MAJOR) if err != nil { // Handle error return } err = arraySchema.SetTileOrder(TILEDB_ROW_MAJOR) if err != nil { // Handle error return } // Validate Schema err = arraySchema.Check() if err != nil { // Handle error return } // create temp group name tmpArrayPath := os.TempDir() // Create new array struct array, err := NewArray(context, tmpArrayPath) if err != nil { // Handle error return } // Create array on disk err = array.Create(arraySchema) if err != nil { // Handle error return } // Open array for writting err = array.Open(TILEDB_WRITE) if err != nil { // Handle error return } // Create write query query, err := NewQuery(context, array) if err != nil { // Handle error return } // Set write layout err = query.SetLayout(TILEDB_UNORDERED) if err != nil { // Handle error return } // Create write buffers bufferA1 := []int32{1, 2, 3, 4} _, err = query.SetDataBuffer("a1", bufferA1) if err != nil { // Handle error return } // Set coordinates, since test is 1d, this is subarray subArray := []int8{0, 1, 2, 3} _, err = query.SetDataBuffer("dim1", subArray) if err != nil { // Handle error return } // Submit write query err = query.Submit() if err != nil { // Handle error return } // Validate query type _, err = query.Type() if err != nil { // Handle error return } // Finalize Write err = query.Finalize() if err != nil { // Handle error return } // Close and prepare to delete err = array.Close() if err != nil { // Handle error return } // Prepare a Delete query for elements dim1[2,3] // Reopen array for deletion err = array.Open(TILEDB_DELETE) if err != nil { // Handle error return } query, err = NewQuery(context, array) if err != nil { // Handle error return } condition, err := NewQueryCondition(context, "dim1", TILEDB_QUERY_CONDITION_GE, int8(2)) if err != nil { // Handle error return } err = query.SetQueryCondition(condition) if err != nil { // Handle error return } // submit and finalize query err = query.Submit() if err != nil { // Handle error return } err = query.Finalize() if err != nil { // Handle error return } // Close and prepare to read err = array.Close() if err != nil { // Handle error return } // Reopen array for reading err = array.Open(TILEDB_READ) if err != nil { // Handle error return } query, err = NewQuery(context, array) if err != nil { // Handle error return } // Set coordinates, since test is 1d, this is subarray _, err = query.SetDataBuffer("dim1", subArray) if err != nil { // Handle error return } // Set empty buffers for reading readBufferA1 := make([]int32, 4) _, err = query.SetDataBuffer("a1", readBufferA1) if err != nil { // Handle error return } // Set read layout err = query.SetLayout(TILEDB_ROW_MAJOR) if err != nil { // Handle error return } // Submit read query async err = query.Submit() if err != nil { // Handle error return } // Validate query type _, err = query.Type() if err != nil { // Handle error return } // Results should be returned _, err = query.HasResults() if err != nil { // Handle error return }
Output:
func NewQueryConditionCombination ¶ added in v0.12.0
func NewQueryConditionCombination(tdbCtx *Context, left *QueryCondition, op QueryConditionCombinationOp, right *QueryCondition) (*QueryCondition, error)
NewQueryConditionCombination combines two query conditions to create a new query condition. The underlying conditions are unchanged.
func NewQueryConditionNegated ¶ added in v0.22.0
func NewQueryConditionNegated(tdbCtx *Context, qc *QueryCondition) (*QueryCondition, error)
NewQueryConditionNegated returns the negation of the query condition. The initial condition is unchanged.
func (*QueryCondition) Context ¶ added in v0.14.2
func (qc *QueryCondition) Context() *Context
Context exposes the internal TileDB context used to initialize the query condition
func (*QueryCondition) Free ¶ added in v0.12.0
func (qc *QueryCondition) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*QueryCondition) UseEnumeration ¶ added in v0.27.1
func (qc *QueryCondition) UseEnumeration(useEnum bool) error
UseEnumerations set true to allow query conditions with enumeration literals.
type QueryConditionCombinationOp ¶ added in v0.12.0
type QueryConditionCombinationOp uint8
QueryConditionCombinationOp operation type for a query condition combination
const ( // TILEDB_QUERY_CONDITION_AND defines the query condition for an and combination TILEDB_QUERY_CONDITION_AND QueryConditionCombinationOp = C.TILEDB_AND // TILEDB_QUERY_CONDITION_AND defines the query condition for an or combination TILEDB_QUERY_CONDITION_OR QueryConditionCombinationOp = C.TILEDB_OR // TILEDB_QUERY_CONDITION_AND defines the query condition for a not combination TILEDB_QUERY_CONDITION_NOT QueryConditionCombinationOp = C.TILEDB_NOT )
type QueryConditionOp ¶ added in v0.12.0
type QueryConditionOp uint8
QueryConditionOp operation type for a query condition
const ( // TILEDB_QUERY_CONDITION_LT defines the query condition for a less than comparison TILEDB_QUERY_CONDITION_LT QueryConditionOp = C.TILEDB_LT // TILEDB_QUERY_CONDITION_LE defines the query condition for a less than or equal to comparison TILEDB_QUERY_CONDITION_LE QueryConditionOp = C.TILEDB_LE // TILEDB_QUERY_CONDITION_GT defines the query condition for a greater than comparison TILEDB_QUERY_CONDITION_GT QueryConditionOp = C.TILEDB_GT // TILEDB_QUERY_CONDITION_GE defines the query condition for a greater than or equal to comparison TILEDB_QUERY_CONDITION_GE QueryConditionOp = C.TILEDB_GE // TILEDB_QUERY_CONDITION_EQ defines the query condition for an equal to comparison TILEDB_QUERY_CONDITION_EQ QueryConditionOp = C.TILEDB_EQ // TILEDB_QUERY_CONDITION_NE defines the query condition for a not equal to comparison TILEDB_QUERY_CONDITION_NE QueryConditionOp = C.TILEDB_NE )
type QueryStatus ¶
type QueryStatus int8
QueryStatus status of a query
const ( // TILEDB_FAILED Query failed TILEDB_FAILED QueryStatus = C.TILEDB_FAILED // TILEDB_COMPLETED Query completed (all data has been read) TILEDB_COMPLETED QueryStatus = C.TILEDB_COMPLETED // TILEDB_INPROGRESS Query is in progress TILEDB_INPROGRESS QueryStatus = C.TILEDB_INPROGRESS // TILEDB_INCOMPLETE Query completed (but not all data has been read) TILEDB_INCOMPLETE QueryStatus = C.TILEDB_INCOMPLETE // TILEDB_UNINITIALIZED Query not initialized. TILEDB_UNINITIALIZED QueryStatus = C.TILEDB_UNINITIALIZED // TILEDB_INITIALIZED Query initialized. TILEDB_INITIALIZED QueryStatus = C.TILEDB_INITIALIZED )
func (QueryStatus) String ¶ added in v0.11.8
func (q QueryStatus) String() string
String returns a string representation.
type QueryStatusDetails ¶ added in v0.27.1
type QueryStatusDetails struct {
IncompleteReason QueryStatusDetailsReason
}
QueryStatusDetails contains detailed information about the query status
type QueryStatusDetailsReason ¶ added in v0.20.3
type QueryStatusDetailsReason uint8
QueryStatusDetailsReason indicates extended information about a returned query status in order to allow improved client-side handling of buffers and potential resubmissions.
const ( // TILEDB_REASON_NONE No additional details available TILEDB_REASON_NONE QueryStatusDetailsReason = C.TILEDB_REASON_NONE // TILEDB_REASON_USER_BUFFER_SIZE User buffers are too small TILEDB_REASON_USER_BUFFER_SIZE QueryStatusDetailsReason = C.TILEDB_REASON_USER_BUFFER_SIZE // TILEDB_REASON_MEMORY_BUDGET Exceeded memory budget: can resubmit without resize TILEDB_REASON_MEMORY_BUDGET QueryStatusDetailsReason = C.TILEDB_REASON_MEMORY_BUDGET )
func (QueryStatusDetailsReason) String ¶ added in v0.20.3
func (r QueryStatusDetailsReason) String() string
String returns a string representation.
type QueryType ¶
type QueryType int8
QueryType read or write query
const ( // TILEDB_READ Read query TILEDB_READ QueryType = C.TILEDB_READ // TILEDB_WRITE Write query TILEDB_WRITE QueryType = C.TILEDB_WRITE // TILEDB_DELETE Delete query TILEDB_DELETE QueryType = C.TILEDB_DELETE // TILEDB_MODIFY_EXCLUSIVE Modify exclusive query TILEDB_MODIFY_EXCLUSIVE QueryType = C.TILEDB_MODIFY_EXCLUSIVE )
func QueryTypeFromString ¶ added in v0.19.0
QueryTypeFromString returns the internal representation of the query type.
type Range ¶ added in v0.23.1
type Range struct {
// contains filtered or unexported fields
}
Range is an 1D range along a subarray dimension
func MakeRange ¶ added in v0.23.1
func MakeRange[T DimensionType](start, end T) Range
MakeRange returns a typed range [from, to]. It can be used with AddRange to add ranges to a dimension.
type RangeLimits ¶ added in v0.7.1
type RangeLimits struct {
// contains filtered or unexported fields
}
RangeLimits defines a query range
func (RangeLimits) MarshalJSON ¶ added in v0.8.1
func (r RangeLimits) MarshalJSON() ([]byte, error)
MarshalJSON implements the Marshaler interface for RangeLimits.
type SerializationType ¶ added in v0.6.0
type SerializationType int8
SerializationType how data is serialized
const ( // TILEDB_JSON Serialization to/from json TILEDB_JSON SerializationType = C.TILEDB_JSON // TILEDB_JSON Serialization to/from capnp TILEDB_CAPNP SerializationType = C.TILEDB_CAPNP )
type Subarray ¶ added in v0.23.1
type Subarray struct {
// contains filtered or unexported fields
}
Subarray is a container of dimension ranges for a tiledb Query.
func (*Subarray) AddDimensionLabelRange ¶ added in v0.27.1
AddDimensionLabelRange adds a range for a dimension label. It checks the types of range and label and if the datatype of the range is not the same as the type of the label it returns an error.
func (*Subarray) AddRange ¶ added in v0.23.1
AddRange adds a range along a subarray dimension. It checks the types of range and dimension and if the datatype of the range is not the same as the type of the dimension it returns an error.
func (*Subarray) AddRangeByName ¶ added in v0.23.1
AddRangeByName adds a range along a subarray dimension. It checks the types of range and dimension and if the datatype of the range is not the same as the type of the dimension it returns an error.
func (*Subarray) Free ¶ added in v0.23.1
func (sa *Subarray) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object.
func (*Subarray) GetDimensionLabelRange ¶ added in v0.27.1
GetDimensionLabelRange retrieves a specific range of the subarray along a given dimension label name.
func (*Subarray) GetDimensionLabelRangeNum ¶ added in v0.27.1
GetDimensionLabelRangeNum returns the number of ranges for a dimension label
func (*Subarray) GetRange ¶ added in v0.23.1
GetRange retrieves a specific range of the subarray along a given dimension index.
func (*Subarray) GetRangeFromName ¶ added in v0.23.1
GetRangeFromName retrieves a specific range of the subarray along a given dimension name.
func (*Subarray) GetRangeNum ¶ added in v0.23.1
GetRangeNum retrieves the number of ranges of the query subarray along a given dimension index.
func (*Subarray) GetRangeNumFromName ¶ added in v0.23.1
GetRangeNum retrieves the number of ranges of the query subarray along a given dimension name.
func (*Subarray) GetRanges ¶ added in v0.30.2
GetRanges gets the number of dimensions from the array under current subarray and builds an array of dimensions that have as memmbers arrays of ranges.
func (*Subarray) SetCoalesceRanges ¶ added in v0.23.1
SetCoalesceRanges sets coalesce_ranges property on a TileDB subarray object. Intended to be used just after array.NewSubarray to replace the initial coalesce_ranges == true with coalesce_ranges = false if needed.
func (*Subarray) SetConfig ¶ added in v0.23.1
SetConfig sets the subarray config. Currently it overrides only sm.read_range_oob.
func (*Subarray) SetSubArray ¶ added in v0.30.2
SetSubArray sets a subarray, defined in the order dimensions were added. Coordinates are inclusive. For the case of writes, this is meaningful only for dense arrays, and specifically dense writes.
type VFS ¶
type VFS struct {
// contains filtered or unexported fields
}
VFS Implements a virtual filesystem that enables performing directory/file operations with a unified API on different filesystems, such as local posix/windows, HDFS, AWS S3, etc.
func NewVFS ¶
NewVFS alloc a new context using tiledb_vfs_alloc. This also registers the `runtime.SetFinalizer` for handling the free'ing of the c data structure on garbage collection
Example ¶
ExampleNewVFS show basic usage of tiledb's vfs functionality
// Create a new config config, err := NewConfig() if err != nil { // return err } // Optionally set config settings here // config.Set("key", "value") // Create a context context, err := NewContext(config) if err != nil { // return err } // Create a VFS instance vfs, err := NewVFS(context, config) if err != nil { // return err } uri := "file:///tmp/tiledb_example_folder" // Check if directory exists if isDir, err := vfs.IsDir(uri); err != nil { fmt.Println(err) } else { // Directory exists if isDir { fmt.Println("URI is a directory") } else { fmt.Println("URI is not a directory")
Output: URI is not a directory
func (*VFS) Close ¶
Close closes a file. This is flushes the buffered data into the file when the file was opened in write (or append) mode. It is particularly important to be called after S3 writes, as otherwise the writes will not take effect.
func (*VFS) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the vfs.
func (*VFS) CopyFile ¶ added in v0.10.2
CopyFile renames a TileDB file from an old URI to a new URI.
func (*VFS) CreateBucket ¶
CreateBucket creates an object-store bucket with the input URI.
func (*VFS) Free ¶
func (v *VFS) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*VFS) IsEmptyBucket ¶
IsEmptyBucket checks if a bucket is empty.
func (*VFS) NumOfFragmentsInPath ¶ added in v0.10.0
NumOfFragmentsInPath returns the number of folders in a path.
func (*VFS) RemoveBucket ¶
RemoveBucket deletes an object-store bucket with the input URI.
func (*VFS) RemoveFile ¶
RemoveFile deletes a file with the input URI.
func (*VFS) VisitRecursive ¶ added in v0.35.0
func (v *VFS) VisitRecursive(path string, callback VisitRecursiveCallback) error
VisitRecursive calls a function for every file in a path recursively. This function returns if the listing ends, or if the callback returns false or an error.
type VFSMode ¶
type VFSMode int8
VFSMode is virtual file system file open mode
const ( // TILEDB_VFS_READ open file in read mode TILEDB_VFS_READ VFSMode = C.TILEDB_VFS_READ // TILEDB_VFS_WRITE open file in write mode TILEDB_VFS_WRITE VFSMode = C.TILEDB_VFS_WRITE // TILEDB_VFS_APPENDopen file in write append mode TILEDB_VFS_APPEND VFSMode = C.TILEDB_VFS_APPEND )
type VFSfh ¶
type VFSfh struct {
// contains filtered or unexported fields
}
VFSfh is a virtual file system file handler
func (*VFSfh) Close ¶ added in v0.10.3
Close closes a file. This flushes the buffered data into the file when the file was opened in write (or append) mode. It is particularly important to be called after S3 writes, as otherwise the writes will not take effect.
func (*VFSfh) Context ¶ added in v0.14.2
Context exposes the internal TileDB context used to initialize the vfsh.
func (*VFSfh) Free ¶
func (v *VFSfh) Free()
Free releases the internal TileDB core data that was allocated on the C heap. It is automatically called when this object is garbage collected, but can be called earlier to manually release memory if needed. Free is idempotent and can safely be called many times on the same object; if it has already been freed, it will not be freed again.
func (*VFSfh) IsClosed ¶
IsClosed checks a vfs file handler to see if it is closed. Return true if file handler is closed, false if its not closed and error is non-nil on error
func (*VFSfh) ReadAt ¶ added in v0.35.0
ReadAt reads part of a file at a given offset, without updating the object's internal offset.
type VisitRecursiveCallback ¶ added in v0.35.0
VisitRecursiveCallback gets called by VFS.VisitRecursive. It returns whether visiting should continue, and maybe an error to propagate to the caller. If err is not nil, visiting always stops.
type WalkOrder ¶ added in v0.10.3
type WalkOrder int8
WalkOrder
const ( // Pre-order traversal TILEDB_PREORDER WalkOrder = C.TILEDB_PREORDER // Post-order traversal TILEDB_POSTORDER WalkOrder = C.TILEDB_POSTORDER )
Source Files
¶
- array.go
- array_experimental.go
- array_schema.go
- array_schema_evolution_experimental.go
- attribute.go
- buffer.go
- buffer_list.go
- cgo_flags.go
- common.go
- config.go
- config_iter.go
- context.go
- dimension.go
- dimension_label_experimental.go
- doc.go
- domain.go
- enumeration_experimental.go
- enums.go
- epoch.go
- filestore_experimental.go
- filter.go
- filter_list.go
- fragment_info.go
- group.go
- memory.go
- object.go
- query.go
- query_condition.go
- query_experimental.go
- range.go
- reflection.go
- serialize.go
- stats.go
- string.go
- subarray.go
- version.go
- vfs.go
Directories
¶
Path | Synopsis |
---|---|
Package bytesizes provides constants with the size in bytes of numeric types.
|
Package bytesizes provides constants with the size in bytes of numeric types. |
cmd
|
|
tiledb-go-examples
tiledb-go-examples runs all of TileDB's example code.
|
tiledb-go-examples runs all of TileDB's example code. |