Documentation
¶
Overview ¶
Package ffi binds the subset of the lance-c C ABI used by lance-go.
Responsibility split: this package owns native calls, native error extraction and the purego bindings. Library discovery and loading belong to internal/loader; Arrow C Data structures will belong to internal/cdata.
Threading contract: lance-c stores its last error in Rust thread-local storage. Every native call that can set an error must run while the goroutine is locked to its OS thread, and lance_last_error_code must be read before lance_last_error_message. Reading the message takes the pending error out of TLS, so a later code read would incorrectly report success. The returned message is owned by lance-c and must be copied and then released with lance_free_string; reading it after the free would be a use-after-free.
Only the minimal dataset open/close surface is bound in this foundation slice. Do not add empty bindings or public stubs ahead of the features that use them.
Index ¶
- Constants
- Variables
- func BlobField(name string, nullable bool) (arrow.Field, error)
- func BlobFieldWithOptions(name string, nullable bool, options BlobFieldOptions) (arrow.Field, error)
- func BuildRQModel(dimension, numBits uint32) ([]byte, error)
- func CommitBatch(uri string, txs []*Transaction, opts CommitOptions) (*Dataset, *Transaction, error)
- func CommitBatchWithAccessor(uri string, txs []*Transaction, opts CommitOptions, ...) (*Dataset, *Transaction, error)
- func CommitBatchWithAccessorAndCommitLock(uri string, txs []*Transaction, opts CommitOptions, ...) (*Dataset, *Transaction, error)
- func DecodeStringMap(raw string) (map[string]string, error)
- func SessionHandle(s *Session) uintptr
- func ValidateStorageOptions(values map[string]string) error
- type AutoCleanupParams
- type BasePath
- type BaseStoreParams
- type BatchInfo
- type BatchUDF
- type BatchUDFStore
- type BlobDescriptorBuilder
- func (bld *BlobDescriptorBuilder) AppendDedicated(blobID uint32, length uint64) error
- func (bld *BlobDescriptorBuilder) AppendExternal(baseID uint32, uri string, offset, length uint64) error
- func (bld *BlobDescriptorBuilder) AppendInline(data []byte) error
- func (bld *BlobDescriptorBuilder) AppendManaged(uri string, offset, length uint64, baseID *uint32) error
- func (bld *BlobDescriptorBuilder) AppendNull() error
- func (bld *BlobDescriptorBuilder) AppendPacked(blobID uint32, offset, length uint64) error
- func (bld *BlobDescriptorBuilder) Close()
- func (bld *BlobDescriptorBuilder) ExtendPacked(blobID uint32, ranges []BlobRange) error
- func (bld *BlobDescriptorBuilder) Field() (arrow.Field, error)
- func (bld *BlobDescriptorBuilder) Finish() (arrow.Array, arrow.Field, error)
- func (bld *BlobDescriptorBuilder) PushExternal(uri string, hasRange bool, offset, length uint64) error
- type BlobFieldOptions
- type BlobFile
- func (f *BlobFile) Close()
- func (f *BlobFile) ReadRange(offset uint64, dst []byte) error
- func (f *BlobFile) ReadRanges(ranges []BlobRange, destinations [][]byte) error
- func (f *BlobFile) ReadUpTo(dst []byte) (uint64, error)
- func (f *BlobFile) Seek(pos uint64) error
- func (f *BlobFile) SetBufferSize(size uint64) error
- func (f *BlobFile) Size() (uint64, error)
- func (f *BlobFile) Tell() (uint64, error)
- type BlobRange
- type BlobRangeRequest
- type BlobReadOptions
- type BranchIdentifier
- type BranchInfo
- type BranchOptions
- type BranchVersionMapping
- type CacheSpec
- type CacheSpecKind
- type CacheStats
- type CallResult
- type Code
- type ColumnAlteration
- type ColumnOrdering
- type ColumnUpdate
- type CommitLock
- type CommitLockCallbacks
- type CommitOptions
- type CommitTimeout
- type CommitTimeoutMode
- type CompactionPlan
- type CompactionTask
- func (t *CompactionTask) Close()
- func (t *CompactionTask) Execute(dataset *Dataset) (*RewriteResult, error)
- func (t *CompactionTask) FragmentCount() (uint64, error)
- func (t *CompactionTask) FragmentMetadataJSONAt(index uint64) (string, error)
- func (t *CompactionTask) JSON() (string, error)
- func (t *CompactionTask) ReadVersion() (uint64, error)
- type ContextProvider
- type CustomNamespaceDispatcher
- type DataFile
- func (f *DataFile) BaseID() (uint32, bool, error)
- func (f *DataFile) Clone() (*DataFile, error)
- func (f *DataFile) Close()
- func (f *DataFile) ColumnIndexAt(index uint64) (int32, error)
- func (f *DataFile) ColumnIndexCount() (uint64, error)
- func (f *DataFile) FieldIDAt(index uint64) (int32, error)
- func (f *DataFile) FieldIDCount() (uint64, error)
- func (f *DataFile) FileSize() (uint64, bool, error)
- func (f *DataFile) FileVersion() (uint32, uint32, error)
- func (f *DataFile) Path() (string, error)
- type DataReplacementGroup
- type Dataset
- func Commit(uri string, tx *Transaction, opts CommitOptions) (*Dataset, error)
- func CommitWithAccessor(uri string, tx *Transaction, opts CommitOptions, ...) (*Dataset, error)
- func CommitWithAccessorAndCommitLock(uri string, tx *Transaction, opts CommitOptions, ...) (*Dataset, error)
- func OpenDataset(uri string, version uint64) (*Dataset, error)
- func OpenDatasetWithOptions(uri string, opts OpenOptions) (*Dataset, error)
- func Write(uri string, reader array.RecordReader, opts WriteOptions, ...) (*Dataset, error)
- func WriteWithAccessor(uri string, reader array.RecordReader, opts WriteOptions, ...) (*Dataset, error)
- func WriteWithAccessorAndCommitLock(uri string, reader array.RecordReader, opts WriteOptions, ...) (*Dataset, error)
- func WriteWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, ...) (*Dataset, error)
- func (d *Dataset) AddBases(bases []BasePath, properties map[string]string) error
- func (d *Dataset) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) error
- func (d *Dataset) AddColumnsNulls(schema *arrow.Schema) error
- func (d *Dataset) AddColumnsSQL(columns []SQLColumn, batchSize uint64) error
- func (d *Dataset) AddColumnsStream(reader array.RecordReader, batchSize uint64) error
- func (d *Dataset) AlterColumns(alterations []ColumnAlteration) error
- func (d *Dataset) BasePaths() (map[uint32]BasePath, error)
- func (d *Dataset) Branch(name string) (BranchInfo, error)
- func (d *Dataset) Branches() ([]BranchInfo, error)
- func (d *Dataset) CheckoutBranch(branch string) (*Dataset, error)
- func (d *Dataset) CheckoutRef(ref Ref) (*Dataset, error)
- func (d *Dataset) Cleanup(policy compaction.CleanupPolicy, options *compaction.CleanupOperationOptions) (compaction.RemovalStats, error)
- func (d *Dataset) CleanupExplain(policy compaction.CleanupPolicy, options *compaction.CleanupOperationOptions) (*compaction.CleanupExplanation, error)
- func (d *Dataset) CleanupOldVersions(options compaction.CleanupOldVersionsOptions) (compaction.RemovalStats, error)
- func (d *Dataset) Clone() (*Dataset, error)
- func (d *Dataset) Close()
- func (d *Dataset) CommitCompaction(results []*RewriteResult, options *compaction.Options) (compaction.Metrics, error)
- func (d *Dataset) CommitIndexSegments(indexName, column string, segments [][]byte) error
- func (d *Dataset) CommitOptimizeIndices(results []*IndexSegmentResult, options *compaction.OptimizeOptions) error
- func (d *Dataset) CompactFiles(options *compaction.Options) (compaction.Metrics, error)
- func (d *Dataset) Config() (map[string]string, error)
- func (d *Dataset) CountRows() (uint64, error)
- func (d *Dataset) CountRowsFiltered(filter string) (uint64, error)
- func (d *Dataset) CreateBranch(name string, ref Ref, options *BranchOptions) (*Dataset, error)
- func (d *Dataset) CreateDataFile(path string, baseID *uint32) (*DataFile, error)
- func (d *Dataset) CreateScalarIndex(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, ...) error
- func (d *Dataset) CreateScalarIndexWithOptionsAndProgress(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, ...) error
- func (d *Dataset) CreateScalarIndexWithProgress(column, name string, indexType int32, params []byte, ...) error
- func (d *Dataset) CreateTag(name string, ref Ref) error
- func (d *Dataset) CreateVectorIndex(column, name string, opts *VectorIndexOptions, replace bool) error
- func (d *Dataset) CreateVectorIndexWithOptionsAndProgress(column, name string, opts *VectorIndexOptions, ...) error
- func (d *Dataset) CurrentBranchIdentifier() (BranchIdentifier, error)
- func (d *Dataset) CurrentVersion() (VersionInfo, error)
- func (d *Dataset) DataStatistics() ([]FieldStatistics, error)
- func (d *Dataset) Delete(predicate string) (uint64, error)
- func (d *Dataset) DeleteBranch(name string) error
- func (d *Dataset) DeleteTag(name string) error
- func (d *Dataset) DescribeIndicesJSON() ([]byte, error)
- func (d *Dataset) DropColumns(columns []string) error
- func (d *Dataset) DropIndex(name string) error
- func (d *Dataset) FieldIDAt(index uint64) (int32, error)
- func (d *Dataset) FieldIDCount() (uint64, error)
- func (d *Dataset) ForceDeleteBranch(name string) error
- func (d *Dataset) FragmentCount() (uint64, error)
- func (d *Dataset) FragmentIDs() ([]uint64, error)
- func (d *Dataset) IndexCount() (uint64, error)
- func (d *Dataset) IndexListJSON() ([]byte, error)
- func (d *Dataset) IndexSegmentCount(name string) (uint64, error)
- func (d *Dataset) IndexSegments(name string) ([]byte, error)
- func (d *Dataset) IndexSegmentsJSON() ([]byte, error)
- func (d *Dataset) IndexStatisticsJSON(name string) ([]byte, error)
- func (d *Dataset) LatestVersion() (uint64, error)
- func (d *Dataset) Merge(leftOn, rightOn string, source array.RecordReader) error
- func (d *Dataset) MergeIndexMetadata(uuid [16]byte, indexType string, batchReadhead *uint64, ...) error
- func (d *Dataset) MergeIndexSegments(segments [][]byte) ([]byte, error)
- func (d *Dataset) MergeInsert(onColumns []string, source array.RecordReader, params MergeInsertParams) (MergeInsertResult, error)
- func (d *Dataset) MetadataJSON() (string, error)
- func (d *Dataset) NativeSchema() (*Schema, error)
- func (d *Dataset) NewScalarSegmentBuilder(column, name string, indexType int32, params []byte, ...) (*SegmentBuilder, error)
- func (d *Dataset) NewVectorSegmentBuilder(column, name string, options *VectorIndexOptions, selection SegmentSelection) (*SegmentBuilder, error)
- func (d *Dataset) OpenFragment(id uint64) (*Fragment, error)
- func (d *Dataset) OptimizeIndices(options *compaction.OptimizeOptions) error
- func (d *Dataset) PlanCompaction(options *compaction.Options) (*CompactionPlan, error)
- func (d *Dataset) PlanOptimizeIndices(options *compaction.OptimizeOptions) (*OptimizeIndicesPlan, error)
- func (d *Dataset) PrepareFTSMatchQuery(column, query string, matchOperator int32, maxFuzzyDistance uint32, ...) (*FTSQueryContext, error)
- func (d *Dataset) PrepareFTSPhraseQuery(column, query string, slop int32, coverage int32) (*FTSQueryContext, error)
- func (d *Dataset) PrewarmIndex(name string, opts *PrewarmOptions) error
- func (d *Dataset) ReadBlobRanges(column string, selector int32, requests []BlobRangeRequest, ...) (*StreamReader, error)
- func (d *Dataset) ReadBlobs(column string, selector int32, rows []uint64, options *BlobReadOptions) (*StreamReader, error)
- func (d *Dataset) ReadTransaction() (*Transaction, error)
- func (d *Dataset) ReadTransactionByVersion(version uint64) (*Transaction, error)
- func (d *Dataset) ReplaceBranchMetadata(name string, metadata map[string]string) error
- func (d *Dataset) ReplaceTagMetadata(name string, metadata map[string]string) error
- func (d *Dataset) ResolveFieldID(ref FieldReference) (int32, error)
- func (d *Dataset) Restore(version uint64) (*Dataset, error)
- func (d *Dataset) Schema() (schema *arrow.Schema, err error)
- func (d *Dataset) Tag(name string) (TagInfo, error)
- func (d *Dataset) Tags() ([]TagInfo, error)
- func (d *Dataset) Take(indices []uint64, columns []string) ([]arrow.RecordBatch, error)
- func (d *Dataset) TakeBlobs(rowIDs []uint64, column string) ([]*BlobFile, error)
- func (d *Dataset) TakeBlobsByAddresses(rowAddresses []uint64, column string) ([]*BlobFile, error)
- func (d *Dataset) TakeBlobsByIndices(indices []uint64, column string) ([]*BlobFile, error)
- func (d *Dataset) TakeRows(rowIDs []uint64, columns []string) ([]arrow.RecordBatch, error)
- func (d *Dataset) TrainIVFModel(column string, numPartitions uint32, metric int32, fragmentIDs []uint32, ...) (arrow.Array, arrow.Field, error)
- func (d *Dataset) TrainPQModel(column string, numSubVectors, numBits uint32, metric int32, ...) (arrow.Array, arrow.Field, error)
- func (d *Dataset) Truncate() error
- func (d *Dataset) URI() (string, error)
- func (d *Dataset) Update(predicate string, updates []ColumnUpdate) (uint64, error)
- func (d *Dataset) UpdateConfigJSON(keys []string, values []*string, mode int32) (map[string]string, error)
- func (d *Dataset) UpdateFieldMetadata(updates []FieldMetadataUpdate) error
- func (d *Dataset) UpdateMetadataJSON(keys []string, values []*string, mode int32) (string, error)
- func (d *Dataset) UpdateSchemaMetadataJSON(keys []string, values []*string, mode int32) (string, error)
- func (d *Dataset) UpdateTag(name string, ref Ref) error
- func (d *Dataset) Validate() error
- func (d *Dataset) Version() (uint64, error)
- func (d *Dataset) VersionRefs() ([]uint64, error)
- func (d *Dataset) Versions() ([]VersionInfo, error)
- type DedicatedBlobWriter
- type DelimitedList
- type Error
- type FTSBoostOptions
- type FTSCombinedFieldsOptions
- type FTSMatchOptions
- type FTSMultiMatchOptions
- type FTSPhraseOptions
- type FTSQuery
- func NewFTSBooleanQuery(occurs []int32, queries []*FTSQuery) (*FTSQuery, error)
- func NewFTSBoostQuery(positive, negative *FTSQuery, opts FTSBoostOptions) (*FTSQuery, error)
- func NewFTSCombinedFieldsQuery(terms string, columns []string, opts FTSCombinedFieldsOptions) (*FTSQuery, error)
- func NewFTSMatchQuery(terms string, column *string, opts FTSMatchOptions) (*FTSQuery, error)
- func NewFTSMultiMatchQuery(terms string, columns []string, opts FTSMultiMatchOptions) (*FTSQuery, error)
- func NewFTSPhraseQuery(terms string, column *string, opts FTSPhraseOptions) (*FTSQuery, error)
- type FTSQueryContext
- type FieldMetadataUpdate
- type FieldReference
- type FieldReferenceKind
- type FieldStatistics
- type FileBufferDescriptor
- type FileCacheMode
- type FileColumnMetadata
- type FileColumnStatistics
- type FileEncodingDescriptor
- type FileEncodingKind
- type FileMetadata
- type FileMetadataInfo
- type FilePageMetadata
- type FileReader
- func (r *FileReader) Close()
- func (r *FileReader) IOStats() (FileScanStats, error)
- func (r *FileReader) Metadata() (*FileMetadata, error)
- func (r *FileReader) NumRows() (uint64, error)
- func (r *FileReader) ReadAll(batchSize, batchReadahead uint32) (*StreamReader, error)
- func (r *FileReader) ReadGlobalBuffer(index uint32) ([]byte, error)
- func (r *FileReader) ReadIndices(indices []uint32, batchSize, batchReadahead uint32) (*StreamReader, error)
- func (r *FileReader) ReadRange(offset, numRows uint64, batchSize, batchReadahead uint32) (*StreamReader, error)
- func (r *FileReader) Statistics() (*FileStatistics, error)
- type FileReaderOptions
- type FileRegistryStats
- type FileScanStats
- type FileSchedulerConfig
- type FileSession
- func (s *FileSession) BasePath() (string, error)
- func (s *FileSession) Close()
- func (s *FileSession) Contains(relativePath string) (bool, error)
- func (s *FileSession) DeleteFile(relativePath string) error
- func (s *FileSession) DownloadFile(relativeRemotePath, localPath string) error
- func (s *FileSession) List(relativePath string) ([]string, error)
- func (s *FileSession) ListWithDelimiter(relativePath string) (DelimitedList, error)
- func (s *FileSession) OpenDedicatedBlobWriter(dataFilePath string, blobID uint32) (*DedicatedBlobWriter, error)
- func (s *FileSession) OpenPackedBlobWriter(dataFilePath string, blobID uint32) (*PackedBlobWriter, error)
- func (s *FileSession) OpenReader(relativePath string, options *FileReaderOptions) (*FileReader, error)
- func (s *FileSession) OpenWriter(relativePath string, schema *arrow.Schema, options *FileWriterOptions) (*FileWriter, error)
- func (s *FileSession) ReadRange(relativePath string, offset, length uint64) ([]byte, error)
- func (s *FileSession) RegistryStats() (FileRegistryStats, error)
- func (s *FileSession) SchedulerStats() (FileScanStats, error)
- func (s *FileSession) StoreIOStats() (FileStoreIOStats, error)
- func (s *FileSession) StoreInfo() (FileStoreInfo, error)
- func (s *FileSession) UploadFile(localPath, relativeRemotePath string) error
- type FileStatistics
- type FileStoreIOStats
- type FileStoreInfo
- type FileWriteSummary
- type FileWriter
- func (w *FileWriter) Abort() error
- func (w *FileWriter) AddGlobalBuffer(data []byte) (uint32, error)
- func (w *FileWriter) AddSchemaMetadata(key, value string) error
- func (w *FileWriter) Close()
- func (w *FileWriter) Finish() (FileWriteSummary, error)
- func (w *FileWriter) WriteBatch(batch arrow.RecordBatch) error
- type FileWriterOptions
- type Fragment
- func CreateFragment(uri string, fragmentID uint64, reader array.RecordReader, ...) (*Fragment, error)
- func CreateFragmentFromFile(dataset *Dataset, filename string, fragmentID uint64, physicalRows *uint64) (*Fragment, error)
- func WriteFragments(uri string, reader array.RecordReader, options FragmentCreateOptions) ([]*Fragment, error)
- func (f *Fragment) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) (*Fragment, *Schema, error)
- func (f *Fragment) AddColumnsNulls(columns *arrow.Schema) (*Fragment, *Schema, error)
- func (f *Fragment) AddColumnsSQL(columns []SQLColumn, batchSize *uint32) (*Fragment, *Schema, error)
- func (f *Fragment) AddColumnsStream(reader array.RecordReader, batchSize *uint32) (*Fragment, *Schema, error)
- func (f *Fragment) Close()
- func (f *Fragment) CountRows(filter *string) (uint64, error)
- func (f *Fragment) DataFileAt(index uint64) (*DataFile, error)
- func (f *Fragment) DataFileCount() (uint64, error)
- func (f *Fragment) DataFileForField(fieldID int32) (*DataFile, error)
- func (f *Fragment) Delete(predicate string) (*Fragment, error)
- func (f *Fragment) DeleteRows(offsets []uint32) (*Fragment, error)
- func (f *Fragment) DeletedRows() (uint64, error)
- func (f *Fragment) ID() uint64
- func (f *Fragment) IsBound() (bool, error)
- func (f *Fragment) LogicalRows() (uint64, error)
- func (f *Fragment) MergeColumns(reader array.RecordReader, leftOn, rightOn string) (*Fragment, *Schema, error)
- func (f *Fragment) MetadataJSON() ([]byte, error)
- func (f *Fragment) NativeSchema() (*Schema, error)
- func (f *Fragment) PhysicalRows() (uint64, error)
- func (f *Fragment) Scan(opts ScannerOptions, initialize func(*Scanner) error) (*Scanner, error)
- func (f *Fragment) Schema() (*arrow.Schema, error)
- func (f *Fragment) String() string
- func (f *Fragment) Take(indices []uint32, columns []string) ([]arrow.RecordBatch, error)
- func (f *Fragment) UpdateColumns(reader array.RecordReader, leftOn, rightOn string) (*UpdateColumnsResult, error)
- func (f *Fragment) WriteColumnWithVersion(schema *Schema, reader array.RecordReader, fileVersion int32) (*DataReplacementGroup, error)
- func (f *Fragment) WriteColumns(schema *Schema, reader array.RecordReader) (*DataReplacementGroup, error)
- type FragmentCreateOptions
- type FragmentOffsets
- type FragmentWriteOptions
- type IndexSegmentResult
- func (r *IndexSegmentResult) Close()
- func (r *IndexSegmentResult) Group() (uint32, error)
- func (r *IndexSegmentResult) JSON() (string, error)
- func (r *IndexSegmentResult) PlanID() ([16]byte, error)
- func (r *IndexSegmentResult) ReadVersion() (uint64, error)
- func (r *IndexSegmentResult) ReplaceCount() (uint64, error)
- func (r *IndexSegmentResult) ReplaceUUIDAt(index uint64) ([16]byte, error)
- func (r *IndexSegmentResult) Segment() (*SegmentMetadata, error)
- type MergeInsertParams
- type MergeInsertResult
- type Namespace
- func NewConnectNamespace(implName string, properties map[string]string, provider ContextProvider) (*Namespace, error)
- func NewCustomNamespace(dispatcher CustomNamespaceDispatcher, namespaceID string) (*Namespace, error)
- func NewDirectoryNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)
- func NewRestNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)
- func (n *Namespace) Call(operation, requestJSON string, requestBytes []byte) (*CallResult, error)
- func (n *Namespace) Close()
- func (n *Namespace) CommitNamespaceURI(tableIDJSON, uri string, tx *Transaction, opts CommitOptions, session *Session) (*Dataset, error)
- func (n *Namespace) ID() (string, error)
- func (n *Namespace) NativeHandle() uintptr
- func (n *Namespace) OpenDataset(tableIDJSON string, storageOptions map[string]string, version uint64, ...) (*Dataset, error)
- func (n *Namespace) OpsMetrics() ([]byte, error)
- func (n *Namespace) ResetOpsMetrics() error
- func (n *Namespace) StartRESTAdapter(host string, port uint16) (*RESTAdapter, error)
- func (n *Namespace) WriteDataset(tableIDJSON string, reader array.RecordReader, opts WriteOptions, ...) (*Dataset, error)
- type NamespaceError
- type NativeWriteOptions
- type NativeWriteOptionsSpec
- type NearestMode
- type NearestQuery
- type OpenOptions
- type Operation
- func NewAppendOperation(fragments []*Fragment) (*Operation, error)
- func NewDataReplacementOperation(groups []*DataReplacementGroup) (*Operation, error)
- func NewDeleteOperation(updated []*Fragment, deletedIDs []uint64, predicate string) (*Operation, error)
- func NewMergeOperation(schema *Schema, fragments []*Fragment, preservesNullability bool) (*Operation, error)
- func NewProjectOperation(schema *Schema, preservesNullability bool) (*Operation, error)
- func NewReserveFragmentsOperation(count uint32) (*Operation, error)
- func NewRestoreOperation(version uint64) (*Operation, error)
- func NewUpdateBasesOperation(bases []BasePath) (*Operation, error)
- func NewUpdateOperation(options UpdateOperationOptions) (*Operation, error)
- func (o *Operation) AppendFragmentAt(index uint64) (*Fragment, error)
- func (o *Operation) AppendFragmentCount() (uint64, error)
- func (o *Operation) BasePathAt(index uint64) (BasePath, error)
- func (o *Operation) Close()
- func (o *Operation) DataReplacementAt(index uint64) (*DataReplacementGroup, error)
- func (o *Operation) DataReplacementCount() (uint64, error)
- func (o *Operation) DeleteDeletedFragmentCount() (uint64, error)
- func (o *Operation) DeleteDeletedFragmentIDAt(index uint64) (uint64, error)
- func (o *Operation) DeletePredicate() (string, error)
- func (o *Operation) DeleteUpdatedFragmentCount() (uint64, error)
- func (o *Operation) DeleteUpdatedFragmentMetadataJSONAt(index uint64) ([]byte, error)
- func (o *Operation) FragmentCount() (uint64, error)
- func (o *Operation) Kind() (OperationKind, error)
- func (o *Operation) MergeFragmentAt(index uint64) (*Fragment, error)
- func (o *Operation) MergeFragmentCount() (uint64, error)
- func (o *Operation) NativeSchema() (*Schema, error)
- func (o *Operation) PreservesNullability() (bool, error)
- func (o *Operation) ReserveFragmentsCount() (uint32, error)
- func (o *Operation) RestoreVersion() (uint64, error)
- func (o *Operation) Schema() (*arrow.Schema, error)
- func (o *Operation) UpdateBasesCount() (uint64, error)
- func (o *Operation) UpdateFieldsModified() ([]uint32, error)
- func (o *Operation) UpdateUpdatedFragmentAt(index uint64) (*Fragment, error)
- func (o *Operation) UpdateUpdatedFragmentCount() (uint64, error)
- func (o *Operation) UpdateUpdatedFragmentOffsets() (*UpdatedFragmentOffsets, bool, error)
- type OperationKind
- type OptimizeIndexMerge
- func (m *OptimizeIndexMerge) Close()
- func (m *OptimizeIndexMerge) Execute(dataset *Dataset, results []*IndexSegmentResult) (*IndexSegmentResult, error)
- func (m *OptimizeIndexMerge) Group() (uint32, error)
- func (m *OptimizeIndexMerge) JSON() (string, error)
- func (m *OptimizeIndexMerge) OldSegmentAt(index uint64) (*SegmentMetadata, error)
- func (m *OptimizeIndexMerge) OldSegmentCount() (uint64, error)
- func (m *OptimizeIndexMerge) PlanID() ([16]byte, error)
- func (m *OptimizeIndexMerge) ReadVersion() (uint64, error)
- func (m *OptimizeIndexMerge) ReplaceCount() (uint64, error)
- func (m *OptimizeIndexMerge) ReplaceUUIDAt(index uint64) ([16]byte, error)
- type OptimizeIndexTask
- func (t *OptimizeIndexTask) Close()
- func (t *OptimizeIndexTask) EnablePartitionRebalancing() (bool, error)
- func (t *OptimizeIndexTask) Execute(dataset *Dataset) (*IndexSegmentResult, error)
- func (t *OptimizeIndexTask) FragmentCount() (uint64, error)
- func (t *OptimizeIndexTask) FragmentIDAt(index uint64) (uint32, error)
- func (t *OptimizeIndexTask) Group() (uint32, error)
- func (t *OptimizeIndexTask) JSON() (string, error)
- func (t *OptimizeIndexTask) NumIndicesToMerge() (compaction.Optional[uint64], error)
- func (t *OptimizeIndexTask) OldSegmentAt(index uint64) (*SegmentMetadata, error)
- func (t *OptimizeIndexTask) OldSegmentCount() (uint64, error)
- func (t *OptimizeIndexTask) PlanID() ([16]byte, error)
- func (t *OptimizeIndexTask) ReadVersion() (uint64, error)
- func (t *OptimizeIndexTask) Reference() (*SegmentMetadata, error)
- func (t *OptimizeIndexTask) Retrain() (bool, error)
- type OptimizeIndicesPlan
- func (p *OptimizeIndicesPlan) Close()
- func (p *OptimizeIndicesPlan) JSON() (string, error)
- func (p *OptimizeIndicesPlan) MergeAt(index uint64) (*OptimizeIndexMerge, error)
- func (p *OptimizeIndicesPlan) MergeCount() (uint64, error)
- func (p *OptimizeIndicesPlan) PlanID() ([16]byte, error)
- func (p *OptimizeIndicesPlan) ReadVersion() (uint64, error)
- func (p *OptimizeIndicesPlan) TaskAt(index uint64) (*OptimizeIndexTask, error)
- func (p *OptimizeIndicesPlan) TaskCount() (uint64, error)
- type PackedBlobWriter
- func (w *PackedBlobWriter) BlobID() uint32
- func (w *PackedBlobWriter) Close()
- func (w *PackedBlobWriter) FinishArray(fieldName string) (arrow.Field, arrow.Array, error)
- func (w *PackedBlobWriter) Path() (string, error)
- func (w *PackedBlobWriter) Write(data []byte) error
- func (w *PackedBlobWriter) WriteBlobs(payloads arrow.Array) error
- type PinnedLibrary
- type PrecomputedShuffleBuffers
- type PrewarmOptions
- type ProgressObservation
- type ProjectionColumn
- type RESTAdapter
- type Ref
- type RefKind
- type RewriteResult
- func (r *RewriteResult) Close()
- func (r *RewriteResult) JSON() (string, error)
- func (r *RewriteResult) Metrics() (compaction.Metrics, error)
- func (r *RewriteResult) NewFragmentCount() (uint64, error)
- func (r *RewriteResult) NewFragmentMetadataJSONAt(index uint64) (string, error)
- func (r *RewriteResult) OriginalFragmentCount() (uint64, error)
- func (r *RewriteResult) OriginalFragmentMetadataJSONAt(index uint64) (string, error)
- func (r *RewriteResult) ReadVersion() (uint64, error)
- type RuntimeState
- type SQLColumn
- type ScalarIndexOptions
- type ScanMetric
- type ScanStatistics
- type Scanner
- func (s *Scanner) AnalyzeCountPlan() (string, error)
- func (s *Scanner) AnalyzePlan() (string, error)
- func (s *Scanner) Close() error
- func (s *Scanner) CountRows() (uint64, error)
- func (s *Scanner) ExplainPlan(verbose bool) (string, error)
- func (s *Scanner) Next(ctx context.Context) (arrow.RecordBatch, bool, error)
- func (s *Scanner) Schema() *arrow.Schema
- func (s *Scanner) SetFTSIndexSegments(uuids []byte) error
- func (s *Scanner) SetFTSQuery(query *FTSQuery) error
- func (s *Scanner) SetFTSQueryContext(ctx *FTSQueryContext) error
- func (s *Scanner) SetMinHashQuery(column, text string) error
- func (s *Scanner) Statistics() ScanStatistics
- type ScannerOptions
- type Schema
- type SegmentBuilder
- type SegmentMetadata
- func (m *SegmentMetadata) BaseID() (uint32, bool, error)
- func (m *SegmentMetadata) Clone() (*SegmentMetadata, error)
- func (m *SegmentMetadata) CloneWithFragmentIDs(fragmentIDs []uint32) (*SegmentMetadata, error)
- func (m *SegmentMetadata) Close() error
- func (m *SegmentMetadata) CoveringFieldIDs() ([]int32, error)
- func (m *SegmentMetadata) CreatedAt() (int64, uint32, bool, error)
- func (m *SegmentMetadata) DatasetVersion() (uint64, error)
- func (m *SegmentMetadata) Details() ([]byte, bool, error)
- func (m *SegmentMetadata) DetailsTypeURL() (string, bool, error)
- func (m *SegmentMetadata) Encode() ([]byte, error)
- func (m *SegmentMetadata) FieldIDs() ([]int32, error)
- func (m *SegmentMetadata) FileCount() (uint64, error)
- func (m *SegmentMetadata) FilePathAt(index uint64) (string, error)
- func (m *SegmentMetadata) FileSizeAt(index uint64) (uint64, error)
- func (m *SegmentMetadata) FragmentIDs() ([]uint32, error)
- func (m *SegmentMetadata) IndexType() (int32, error)
- func (m *SegmentMetadata) IndexVersion() (int32, error)
- func (m *SegmentMetadata) Name() (string, error)
- func (m *SegmentMetadata) UUID() ([16]byte, error)
- type SegmentSelection
- type Session
- type StorageOptionsAccessor
- type StorageOptionsFetchFunc
- type StorageOptionsProvider
- type StreamReader
- type TagInfo
- type TrainerOptions
- type Transaction
- func NewTransaction(readVersion uint64, operation *Operation, opts TransactionOptions) (*Transaction, error)
- func ParseTransaction(data []byte) (*Transaction, error)
- func WriteUncommitted(uri string, reader array.RecordReader, opts WriteUncommittedOptions) (*Transaction, error)
- func WriteUncommittedWithAccessor(uri string, reader array.RecordReader, opts WriteUncommittedOptions, ...) (*Transaction, error)
- func WriteUncommittedWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, ...) (*Transaction, error)
- func (tx *Transaction) Close()
- func (tx *Transaction) HasProperties() (bool, error)
- func (tx *Transaction) MarshalBinary() ([]byte, error)
- func (t *Transaction) NativeHandle() uintptr
- func (tx *Transaction) Operation() (*Operation, error)
- func (tx *Transaction) Properties() (map[string]string, bool, error)
- func (tx *Transaction) PropertyCount() (uint64, error)
- func (tx *Transaction) ReadVersion() (uint64, error)
- func (tx *Transaction) Tag() (string, bool, error)
- func (tx *Transaction) UUID() (string, error)
- type TransactionOptions
- type UpdateColumnsResult
- type UpdateOperationOptions
- type UpdatedFragmentOffsets
- func (o *UpdatedFragmentOffsets) Clone() (*UpdatedFragmentOffsets, error)
- func (o *UpdatedFragmentOffsets) Close()
- func (o *UpdatedFragmentOffsets) Count() (uint64, error)
- func (o *UpdatedFragmentOffsets) FragmentIDAt(index uint64) (uint64, error)
- func (o *UpdatedFragmentOffsets) OffsetsAt(index uint64) ([]uint32, error)
- type VectorIndexOptions
- type VectorOptions
- type VersionInfo
- type WriteFragmentProgress
- type WriteMode
- type WriteOptions
- type WriteParams
- type WriteProgress
- type WriteStats
- type WriteUncommittedOptions
Constants ¶
const ( FileSchedulerAuto int32 = 0 FileSchedulerStandard int32 = 1 FileSchedulerLite int32 = 2 )
Variables ¶
var ErrClosed = errors.New("ffi: native handle is closed")
ErrClosed reports use of a native handle after it was closed.
Functions ¶
func BlobFieldWithOptions ¶
func BlobFieldWithOptions(name string, nullable bool, options BlobFieldOptions) (arrow.Field, error)
BlobFieldWithOptions exports the native blob v2 field with explicit threshold options. Nil thresholds select native defaults.
func BuildRQModel ¶
BuildRQModel returns the library JSON for an IVF-RQ rotation model.
func CommitBatch ¶
func CommitBatch(uri string, txs []*Transaction, opts CommitOptions) (*Dataset, *Transaction, error)
CommitBatch publishes append transactions through CommitBuilder::execute_batch.
func CommitBatchWithAccessor ¶
func CommitBatchWithAccessor(uri string, txs []*Transaction, opts CommitOptions, accessor *StorageOptionsAccessor) (*Dataset, *Transaction, error)
CommitBatchWithAccessor publishes append transactions using a reusable storage options accessor. The returned dataset retains the accessor.
func CommitBatchWithAccessorAndCommitLock ¶
func CommitBatchWithAccessorAndCommitLock(uri string, txs []*Transaction, opts CommitOptions, accessor *StorageOptionsAccessor, lock *CommitLock) (*Dataset, *Transaction, error)
CommitBatchWithAccessorAndCommitLock publishes append transactions through an external commit lock. The accessor may be nil; static storage options are not accepted on this path.
func DecodeStringMap ¶
decodeStringMap decodes a native JSON object containing string keys and string values. The native API returns complete maps, so an empty object is a valid empty map rather than a nil result.
func SessionHandle ¶
SessionHandle returns the native handle for a native call that borrows a session. The caller must keep s alive until the call returns.
func ValidateStorageOptions ¶
ValidateStorageOptions checks the presence-independent part of a storage options map before any native or callback context is allocated.
Types ¶
type AutoCleanupParams ¶
AutoCleanupParams mirrors LanceAutoCleanupParams.
type BasePath ¶
BasePath is one native base-path registration.
ID zero requests native ID allocation. A nil Name maps to native None; a non-nil Name, including a pointer to an empty string, is an explicit name.
type BaseStoreParams ¶
type BaseStoreParams struct {
StorageOptionsAccessor *StorageOptionsAccessor
BlockSize *uint64
S3CredentialsRefreshOffset *time.Duration
UseConstantSizeUploadParts *bool
ListIsLexicallyOrdered *bool
}
BaseStoreParams mirrors the representable fields of native ObjectStoreParams for one registered base path.
type BatchUDF ¶
type BatchUDF struct {
Mapper func(arrow.RecordBatch) (arrow.RecordBatch, error)
OutputSchema *cdata.ArrowSchema
Store BatchUDFStore
}
BatchUDF is the native-facing batch UDF configuration.
type BatchUDFStore ¶
type BatchUDFStore interface {
GetBatch(info BatchInfo) (arrow.RecordBatch, bool, error)
InsertBatch(info BatchInfo, batch arrow.RecordBatch) error
GetFragment(fragmentID uint32) (string, bool, error)
InsertFragment(fragmentID uint64, fragmentJSON string) error
}
BatchUDFStore is the checkpoint store used by a batch UDF. Every method is required. InsertBatch receives the exact native batch schema, including opaque schema metadata that native uses to validate cached batches. Keep the batch and its schema together and return the retained batch from GetBatch; rebuilding it from the declared output schema drops the opaque metadata and native rejects the hit. Batches passed to InsertBatch are borrowed for the call; retain a batch before keeping it beyond the return. Batches returned by GetBatch are owned by the adapter and released after the callback exports them.
type BlobDescriptorBuilder ¶
type BlobDescriptorBuilder struct {
// contains filtered or unexported fields
}
BlobDescriptorBuilder builds one native prepared blob descriptor column.
func NewBlobDescriptorBuilder ¶
func NewBlobDescriptorBuilder(column string) (*BlobDescriptorBuilder, error)
NewBlobDescriptorBuilder creates a native descriptor builder for column.
func (*BlobDescriptorBuilder) AppendDedicated ¶
func (bld *BlobDescriptorBuilder) AppendDedicated(blobID uint32, length uint64) error
AppendDedicated appends one dedicated descriptor.
func (*BlobDescriptorBuilder) AppendExternal ¶
func (bld *BlobDescriptorBuilder) AppendExternal(baseID uint32, uri string, offset, length uint64) error
AppendExternal appends one external descriptor with an explicit base ID.
func (*BlobDescriptorBuilder) AppendInline ¶
func (bld *BlobDescriptorBuilder) AppendInline(data []byte) error
AppendInline appends one owned inline descriptor.
func (*BlobDescriptorBuilder) AppendManaged ¶
func (bld *BlobDescriptorBuilder) AppendManaged(uri string, offset, length uint64, baseID *uint32) error
AppendManaged appends one managed descriptor. A nil baseID selects the native None variant; a pointer selects Some, including Some(0).
func (*BlobDescriptorBuilder) AppendNull ¶
func (bld *BlobDescriptorBuilder) AppendNull() error
AppendNull appends one null blob descriptor.
func (*BlobDescriptorBuilder) AppendPacked ¶
func (bld *BlobDescriptorBuilder) AppendPacked(blobID uint32, offset, length uint64) error
AppendPacked appends one packed descriptor.
func (*BlobDescriptorBuilder) Close ¶
func (bld *BlobDescriptorBuilder) Close()
Close frees the native builder handle. It is safe after Finish.
func (*BlobDescriptorBuilder) ExtendPacked ¶
func (bld *BlobDescriptorBuilder) ExtendPacked(blobID uint32, ranges []BlobRange) error
ExtendPacked appends packed descriptors in order. Native keeps the already appended prefix if a later range fails.
func (*BlobDescriptorBuilder) Field ¶
func (bld *BlobDescriptorBuilder) Field() (arrow.Field, error)
Field exports the prepared field owned by the builder. It remains available after Finish until Close releases the builder.
func (*BlobDescriptorBuilder) Finish ¶
Finish consumes the native builder and returns the owned prepared array and field. The caller must release the array.
func (*BlobDescriptorBuilder) PushExternal ¶
func (bld *BlobDescriptorBuilder) PushExternal(uri string, hasRange bool, offset, length uint64) error
PushExternal appends an external descriptor through native push_external. A false hasRange stores offset 0 and length 0.
type BlobFieldOptions ¶
type BlobFieldOptions struct {
InlineSizeThreshold uint64
HasInlineSizeThreshold bool
DedicatedSizeThreshold uint64
HasDedicatedSizeThreshold bool
}
BlobFieldOptions selects native blob storage thresholds. A nil threshold leaves the native default in place; a present zero inline threshold is valid, while a present zero dedicated threshold is rejected natively.
type BlobFile ¶
type BlobFile struct {
// contains filtered or unexported fields
}
BlobFile is a native blob handle. It is independent of the dataset that produced it and owns the state needed to read the blob after dataset close. Callers serialize access through the public BlobFile.
func (*BlobFile) Close ¶
func (f *BlobFile) Close()
Close frees the native handle allocation. It does not perform a native close; the public wrapper only calls it after no operation is in flight.
func (*BlobFile) ReadRange ¶
ReadRange reads exactly len(dst) bytes at offset without moving the cursor.
func (*BlobFile) ReadRanges ¶
ReadRanges reads several ranges without moving the cursor. The native call validates the complete request before writing any destination.
func (*BlobFile) ReadUpTo ¶
ReadUpTo reads at most len(dst) bytes from the cursor and returns the number of bytes read. A read at or past the end returns zero without an error.
func (*BlobFile) SetBufferSize ¶
SetBufferSize sets the native read-ahead buffer size. Zero disables read-ahead; the setting never changes the visible bytes or cursor.
type BlobRangeRequest ¶
BlobRangeRequest asks for a byte range from one row selected by a blob read.
type BlobReadOptions ¶
BlobReadOptions mirrors LanceBlobReadOptions. A nil pointer selects native defaults; an explicit zero IOBufferSize is forwarded and rejected natively.
type BranchIdentifier ¶
type BranchIdentifier struct {
VersionMapping []BranchVersionMapping
}
BranchIdentifier maps a branch's versions to the manifest UUIDs they were cloned from.
func (*BranchIdentifier) UnmarshalJSON ¶
func (b *BranchIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes native camelCase-independent wire data without converting integer identifiers through float64.
type BranchInfo ¶
type BranchInfo struct {
Name string
ParentBranch string
ParentVersion uint64
CreateAt time.Time
ManifestSize uint64
Metadata map[string]string
Identifier BranchIdentifier
}
BranchInfo is a copied snapshot of one named branch.
type BranchOptions ¶
BranchOptions selects branch creation behavior.
A nil *BranchOptions inherits the source dataset's store parameters. A non-nil value, including one with an empty StorageOptions map, passes explicit storage options to native branch creation.
type BranchVersionMapping ¶
BranchVersionMapping records one version-to-manifest mapping in a branch identifier. UUID is empty when the native manifest reference has no UUID.
type CacheSpec ¶
type CacheSpec struct {
Kind CacheSpecKind
SizeBytes uint64
URI string
BackendKind string
Options map[string]string
}
CacheSpec describes one session cache. Only the field group selected by Kind is passed to native code.
type CacheSpecKind ¶
type CacheSpecKind int32
CacheSpecKind selects one field group in a native session cache spec.
const ( CacheSpecDefault CacheSpecKind = 0 CacheSpecSize CacheSpecKind = 1 CacheSpecURI CacheSpecKind = 2 CacheSpecConfig CacheSpecKind = 3 )
type CacheStats ¶
type CacheStats struct {
IndexCacheHits uint64
IndexCacheMisses uint64
IndexCacheEntries uint64
IndexCacheSizeBytes uint64
MetadataCacheHits uint64
MetadataCacheMisses uint64
MetadataCacheEntries uint64
MetadataCacheSizeBytes uint64
}
CacheStats is a snapshot of both native session caches.
type CallResult ¶
CallResult holds the two independent result channels of a namespace call. Both fields are copied out of native memory before the result is closed.
type Code ¶
type Code int32
Code mirrors LanceErrorCode from include/lance/lance.h.
type ColumnAlteration ¶
type ColumnAlteration struct {
Path string
Rename *string
NullableMode int32
DataType arrow.DataType
}
ColumnAlteration is one native alter_columns entry. Rename nil keeps the name; NullableMode uses the native sentinel values; DataType nil keeps the type. At least one of them must change.
type ColumnOrdering ¶
ColumnOrdering is one native order-by key.
type ColumnUpdate ¶
ColumnUpdate assigns Value, a SQL scalar expression, to Column.
type CommitLock ¶
type CommitLock struct {
// contains filtered or unexported fields
}
CommitLock is an owned native commit-lock handle. Native datasets, transactions and scanners retain their own native owner after Close, so the lock may be closed while those objects remain usable.
func NewCommitLock ¶
func NewCommitLock(callbacks CommitLockCallbacks) (*CommitLock, error)
NewCommitLock constructs a native commit lock. The callback context is transferred to native code only on success. Construction failure drops the Go context without invoking release_context.
func (*CommitLock) Close ¶
func (l *CommitLock) Close()
Close drops this handle's native owner. It is idempotent; native objects that already retained the lock keep their own owner.
func (*CommitLock) Handle ¶
func (l *CommitLock) Handle() uintptr
Handle returns the native commit-lock pointer, or zero after Close.
type CommitLockCallbacks ¶
type CommitLockCallbacks struct {
Acquire func(version uint64) (any, error)
Release func(lease any, success bool) error
Destroy func(lease any)
}
CommitLockCallbacks implements the native commit-lock contract. Acquire and Release run synchronously on native threads and may be invoked concurrently. Acquire owns the returned lease value even when it also returns an error; native code destroys such a partial lease exactly once without releasing it. Release may be called more than once for the same lease and must be idempotent. Destroy runs exactly once for every returned lease, including nil for a stateless lease; when nil it only drops internal lease tracking.
type CommitOptions ¶
type CommitOptions struct {
UseStableRowIDs *bool
EnableV2ManifestPaths *bool
MaxRetries *uint32
RetryTimeout *time.Duration
Timeout CommitTimeout
Detached bool
SkipAutoCleanup bool
DataStorageVersion *string
StorageOptions map[string]string
Session *Session
}
CommitOptions controls native transaction publication.
type CommitTimeout ¶
type CommitTimeout struct {
Mode CommitTimeoutMode
Duration time.Duration
}
CommitTimeout selects the native overall commit timeout.
type CommitTimeoutMode ¶
type CommitTimeoutMode int32
CommitTimeoutMode mirrors LanceCommitTimeoutMode.
const ( CommitTimeoutDefault CommitTimeoutMode = 0 CommitTimeoutDisabled CommitTimeoutMode = 1 CommitTimeoutExplicit CommitTimeoutMode = 2 )
type CompactionPlan ¶
type CompactionPlan struct {
// contains filtered or unexported fields
}
CompactionPlan is an opaque native LanceCompactionPlan handle.
func CompactionPlanFromJSON ¶
func CompactionPlanFromJSON(data string) (*CompactionPlan, error)
CompactionPlanFromJSON restores a native plan from serialized JSON.
func (*CompactionPlan) Close ¶
func (p *CompactionPlan) Close()
Close releases the native plan handle. It is not safe for concurrent use.
func (*CompactionPlan) JSON ¶
func (p *CompactionPlan) JSON() (string, error)
JSON returns the plan's native serialized JSON.
func (*CompactionPlan) ReadVersion ¶
func (p *CompactionPlan) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the plan was created from.
func (*CompactionPlan) TaskAt ¶
func (p *CompactionPlan) TaskAt(index uint64) (*CompactionTask, error)
TaskAt returns an owned snapshot of one plan task.
func (*CompactionPlan) TaskCount ¶
func (p *CompactionPlan) TaskCount() (uint64, error)
TaskCount returns the number of tasks in the plan.
type CompactionTask ¶
type CompactionTask struct {
// contains filtered or unexported fields
}
CompactionTask is an opaque native LanceCompactionTask handle.
func CompactionTaskFromJSON ¶
func CompactionTaskFromJSON(data string) (*CompactionTask, error)
CompactionTaskFromJSON restores a native task from serialized JSON.
func (*CompactionTask) Close ¶
func (t *CompactionTask) Close()
Close releases the native task handle. It is not safe for concurrent use.
func (*CompactionTask) Execute ¶
func (t *CompactionTask) Execute(dataset *Dataset) (*RewriteResult, error)
Execute executes the task against dataset at the task's read version.
func (*CompactionTask) FragmentCount ¶
func (t *CompactionTask) FragmentCount() (uint64, error)
FragmentCount returns the number of source fragments in the task.
func (*CompactionTask) FragmentMetadataJSONAt ¶
func (t *CompactionTask) FragmentMetadataJSONAt(index uint64) (string, error)
FragmentMetadataJSONAt returns one source fragment's metadata JSON.
func (*CompactionTask) JSON ¶
func (t *CompactionTask) JSON() (string, error)
JSON returns the task's native serialized JSON.
func (*CompactionTask) ReadVersion ¶
func (t *CompactionTask) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the task must read.
type ContextProvider ¶
type ContextProvider interface {
ProvideContext(operation, objectID string) (map[string]string, error)
}
ContextProvider supplies dynamic request context for a namespace. The operation name and object identifier are native OperationInfo values and must not be retained: the callback copies them only for the call. Returning an error or panicking is logged by native code and treated as an empty context; the request continues.
type CustomNamespaceDispatcher ¶
type CustomNamespaceDispatcher interface {
DispatchNamespace(operation string, requestJSON []byte) ([]byte, error)
}
CustomNamespaceDispatcher implements the single native dispatch callback used by a custom namespace. The operation string identifies which typed request model requestJSON contains. The returned JSON must be a response model for that operation.
type DataFile ¶
type DataFile struct {
// contains filtered or unexported fields
}
DataFile is an owned snapshot of native Lance DataFile metadata. It remains valid after the dataset, fragment or operation that produced it is closed.
func (*DataFile) Close ¶
func (f *DataFile) Close()
Close releases the data-file handle. It is idempotent.
func (*DataFile) ColumnIndexAt ¶
ColumnIndexAt returns one native column index, including the native -1 marker.
func (*DataFile) ColumnIndexCount ¶
ColumnIndexCount returns the number of native column indices.
func (*DataFile) FieldIDCount ¶
FieldIDCount returns the number of native field IDs.
func (*DataFile) FileVersion ¶
FileVersion returns the native data-file format version.
type DataReplacementGroup ¶
type DataReplacementGroup struct {
// contains filtered or unexported fields
}
DataReplacementGroup is an owned native data replacement group.
func NewDataReplacementGroup ¶
func NewDataReplacementGroup(fragmentID uint64, newFile *DataFile) (*DataReplacementGroup, error)
NewDataReplacementGroup clones newFile into a new group.
func (*DataReplacementGroup) Clone ¶
func (g *DataReplacementGroup) Clone() (*DataReplacementGroup, error)
Clone returns an independent snapshot.
func (*DataReplacementGroup) Close ¶
func (g *DataReplacementGroup) Close()
Close releases the group handle. It is idempotent.
func (*DataReplacementGroup) File ¶
func (g *DataReplacementGroup) File() (*DataFile, error)
File clones the group's data file.
func (*DataReplacementGroup) FragmentID ¶
func (g *DataReplacementGroup) FragmentID() (uint64, error)
FragmentID returns the native fragment ID. Zero is valid.
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset is an opaque native LanceDataset handle.
A Dataset owns one native handle. Close releases it and is idempotent, so only the first call reaches native code even when several goroutines call Close.
func Commit ¶
func Commit(uri string, tx *Transaction, opts CommitOptions) (*Dataset, error)
Commit publishes one transaction through CommitBuilder::execute.
func CommitWithAccessor ¶
func CommitWithAccessor(uri string, tx *Transaction, opts CommitOptions, accessor *StorageOptionsAccessor) (*Dataset, error)
CommitWithAccessor publishes one transaction using a reusable storage options accessor. The returned dataset retains the accessor for later I/O; the transaction metadata does not.
func CommitWithAccessorAndCommitLock ¶
func CommitWithAccessorAndCommitLock(uri string, tx *Transaction, opts CommitOptions, accessor *StorageOptionsAccessor, lock *CommitLock) (*Dataset, error)
CommitWithAccessorAndCommitLock publishes one transaction through an external commit lock. The accessor may be nil; static storage options are not accepted on this path. The returned dataset retains both native owners.
func OpenDataset ¶
OpenDataset opens the dataset at uri. A zero version selects the latest version. This compatibility wrapper uses no storage options or session.
func OpenDatasetWithOptions ¶
func OpenDatasetWithOptions(uri string, opts OpenOptions) (*Dataset, error)
OpenDatasetWithOptions opens a dataset with storage options, optional per-base store parameters, a version and an optional shared session.
func Write ¶
func Write(uri string, reader array.RecordReader, opts WriteOptions, storageOptions map[string]string) (*Dataset, error)
Write writes reader to uri. The stream is consumed by native code on every return path after export. The caller keeps ownership of reader, but must not use it after this call unless it retained an independent reference before.
func WriteWithAccessor ¶
func WriteWithAccessor(uri string, reader array.RecordReader, opts WriteOptions, accessor *StorageOptionsAccessor) (*Dataset, error)
WriteWithAccessor writes reader using a reusable storage-options accessor. The accessor is mutually exclusive with static storage options and is retained by the returned dataset for later I/O.
func WriteWithAccessorAndCommitLock ¶
func WriteWithAccessorAndCommitLock(uri string, reader array.RecordReader, opts WriteOptions, accessor *StorageOptionsAccessor, session *Session, lock *CommitLock) (*Dataset, error)
WriteWithAccessorAndCommitLock writes reader through an external commit lock. The accessor and session may be nil. Native retains both owners in the returned dataset.
func WriteWithNativeOptions ¶
func WriteWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, options *NativeWriteOptions) (*Dataset, error)
WriteWithNativeOptions writes reader using an owned native options handle.
func (*Dataset) AddBases ¶
AddBases registers bases on this handle and commits one native version.
The native transaction copies the inputs before committing; ID allocation and conflict validation stay in Lance core. A nil properties map passes native None, while a non-nil map, including an empty one, passes an explicitly present property map.
func (*Dataset) AddColumnsBatchUDF ¶
func (d *Dataset) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) error
AddColumnsBatchUDF computes one or more new columns through a Go mapper. readColumnsSet distinguishes the C NULL read-columns option from an empty list. batchSize nil likewise means the option is absent; a non-nil value is forwarded verbatim, including zero.
func (*Dataset) AddColumnsSQL ¶
func (*Dataset) AddColumnsStream ¶
func (d *Dataset) AddColumnsStream(reader array.RecordReader, batchSize uint64) error
func (*Dataset) AlterColumns ¶
func (d *Dataset) AlterColumns(alterations []ColumnAlteration) error
func (*Dataset) BasePaths ¶
BasePaths returns the current snapshot's base-path registry keyed by native base ID. The map and its values are independent copies of the snapshot.
func (*Dataset) Branch ¶
func (d *Dataset) Branch(name string) (BranchInfo, error)
Branch fetches one branch by name.
func (*Dataset) Branches ¶
func (d *Dataset) Branches() ([]BranchInfo, error)
Branches snapshots all branches. The result is ordered by name.
func (*Dataset) CheckoutBranch ¶
CheckoutBranch returns an independent dataset at the latest branch version.
func (*Dataset) CheckoutRef ¶
CheckoutRef returns an independent dataset checked out at ref.
func (*Dataset) Cleanup ¶
func (d *Dataset) Cleanup(policy compaction.CleanupPolicy, options *compaction.CleanupOperationOptions) (compaction.RemovalStats, error)
Cleanup runs native cleanup with an explicit policy.
func (*Dataset) CleanupExplain ¶
func (d *Dataset) CleanupExplain(policy compaction.CleanupPolicy, options *compaction.CleanupOperationOptions) (*compaction.CleanupExplanation, error)
CleanupExplain reports cleanup candidates for the current dataset state.
func (*Dataset) CleanupOldVersions ¶
func (d *Dataset) CleanupOldVersions(options compaction.CleanupOldVersionsOptions) (compaction.RemovalStats, error)
CleanupOldVersions removes versions older than the requested duration.
Cleanup is destructive storage maintenance. It does not take a snapshot lease and cannot roll back successful deletions if a later deletion fails. Snapshot handles do not protect removed files.
func (*Dataset) Clone ¶
Clone returns an independent handle to the same native snapshot as d.
The clone shares the underlying Arc<Dataset> but has its own lock, so mutating or closing either handle does not change the other handle's snapshot. Cloning is an in-memory operation: it performs no storage I/O and does not reopen the dataset by URI.
func (*Dataset) Close ¶
func (d *Dataset) Close()
Close releases the native dataset handle. It is idempotent.
func (*Dataset) CommitCompaction ¶
func (d *Dataset) CommitCompaction(results []*RewriteResult, options *compaction.Options) (compaction.Metrics, error)
CommitCompaction commits rewrite results to a dataset.
func (*Dataset) CommitIndexSegments ¶
CommitIndexSegments commits encoded segment metadata to the open dataset in one version. The native call mutates the handle in place.
func (*Dataset) CommitOptimizeIndices ¶
func (d *Dataset) CommitOptimizeIndices(results []*IndexSegmentResult, options *compaction.OptimizeOptions) error
CommitOptimizeIndices commits merged index results to a dataset.
func (*Dataset) CompactFiles ¶
func (d *Dataset) CompactFiles(options *compaction.Options) (compaction.Metrics, error)
CompactFiles runs native CompactionOptionsV2 compaction in place on d.
func (*Dataset) Config ¶
Config returns a stable copy of the dataset configuration snapshot. The native snapshot is valid independently of the dataset handle, but this method still copies every key and value before closing it.
func (*Dataset) CountRowsFiltered ¶
CountRowsFiltered returns the row count matching a native SQL filter.
func (*Dataset) CreateBranch ¶
CreateBranch shallow-clones ref into a new branch and returns its dataset.
func (*Dataset) CreateDataFile ¶
CreateDataFile creates native data-file metadata from an existing Lance file.
func (*Dataset) CreateScalarIndex ¶
func (d *Dataset) CreateScalarIndex(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, replace bool) error
CreateScalarIndex creates a scalar index. Empty params forwards NULL so the native plugin supplies defaults; non-empty params are forwarded verbatim.
func (*Dataset) CreateScalarIndexWithOptionsAndProgress ¶
func (d *Dataset) CreateScalarIndexWithOptionsAndProgress(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, progress func(ProgressObservation), replace bool) error
CreateScalarIndexWithOptionsAndProgress creates a scalar index with additive train controls and a progress observer.
func (*Dataset) CreateScalarIndexWithProgress ¶
func (d *Dataset) CreateScalarIndexWithProgress(column, name string, indexType int32, params []byte, progress func(ProgressObservation), replace bool) error
CreateScalarIndexWithProgress creates a scalar index through the legacy entry point with a progress observer.
func (*Dataset) CreateVectorIndex ¶
func (d *Dataset) CreateVectorIndex(column, name string, opts *VectorIndexOptions, replace bool) error
CreateVectorIndex creates a vector index on the open dataset handle.
func (*Dataset) CreateVectorIndexWithOptionsAndProgress ¶
func (d *Dataset) CreateVectorIndexWithOptionsAndProgress(column, name string, opts *VectorIndexOptions, progress func(ProgressObservation), replace bool) error
CreateVectorIndexWithOptionsAndProgress creates a vector index from additive options with a progress observer.
func (*Dataset) CurrentBranchIdentifier ¶
func (d *Dataset) CurrentBranchIdentifier() (BranchIdentifier, error)
CurrentBranchIdentifier reports the receiver's branch lineage.
func (*Dataset) CurrentVersion ¶
func (d *Dataset) CurrentVersion() (VersionInfo, error)
CurrentVersion reports the version checked out by this handle.
func (*Dataset) DataStatistics ¶
func (d *Dataset) DataStatistics() ([]FieldStatistics, error)
DataStatistics computes per-field compressed on-disk statistics.
func (*Dataset) DeleteBranch ¶
DeleteBranch removes a branch using native reference-protection rules.
func (*Dataset) DescribeIndicesJSON ¶
DescribeIndicesJSON returns the native index description JSON.
func (*Dataset) DropColumns ¶
func (*Dataset) FieldIDCount ¶
func (*Dataset) ForceDeleteBranch ¶
ForceDeleteBranch removes a branch even when its BranchContents is missing.
func (*Dataset) FragmentCount ¶
FragmentCount returns the number of fragments in the dataset snapshot.
func (*Dataset) FragmentIDs ¶
FragmentIDs returns the fragment IDs in manifest order.
func (*Dataset) IndexCount ¶
IndexCount returns the number of user indexes in the snapshot.
func (*Dataset) IndexListJSON ¶
IndexListJSON returns the native user index list JSON.
func (*Dataset) IndexSegmentCount ¶
IndexSegmentCount returns the number of physical segments for index name.
func (*Dataset) IndexSegments ¶
IndexSegments returns the raw 16-byte UUIDs of index name's segments.
func (*Dataset) IndexSegmentsJSON ¶
IndexSegmentsJSON returns the native physical segment list JSON.
func (*Dataset) IndexStatisticsJSON ¶
IndexStatisticsJSON returns the native family-specific statistics JSON.
func (*Dataset) LatestVersion ¶
LatestVersion returns the latest committed dataset version.
func (*Dataset) Merge ¶
func (d *Dataset) Merge(leftOn, rightOn string, source array.RecordReader) error
Merge left-joins columns from source into this handle. The source stream is consumed by the native call on every return path after export.
func (*Dataset) MergeIndexMetadata ¶
func (d *Dataset) MergeIndexMetadata(uuid [16]byte, indexType string, batchReadhead *uint64, progress func(ProgressObservation)) error
MergeIndexMetadata writes or merges the root artifact of one index. It does not commit a dataset version; publication requires a separate index creation.
func (*Dataset) MergeIndexSegments ¶
MergeIndexSegments merges encoded uncommitted segment metadata without committing it. An empty set is forwarded so native validation decides.
func (*Dataset) MergeInsert ¶
func (d *Dataset) MergeInsert(onColumns []string, source array.RecordReader, params MergeInsertParams) (MergeInsertResult, error)
MergeInsert merges source into this handle on the given keys. The source stream is consumed by the native call on every return path after export.
func (*Dataset) MetadataJSON ¶
func (*Dataset) NativeSchema ¶
NativeSchema clones the dataset's native logical schema.
func (*Dataset) NewScalarSegmentBuilder ¶
func (d *Dataset) NewScalarSegmentBuilder(column, name string, indexType int32, params []byte, options *ScalarIndexOptions, selection SegmentSelection) (*SegmentBuilder, error)
NewScalarSegmentBuilder creates a scalar segment builder. A non-nil options value forwards its train flag; params is the plugin-specific JSON options blob, with nil meaning the native default.
func (*Dataset) NewVectorSegmentBuilder ¶
func (d *Dataset) NewVectorSegmentBuilder(column, name string, options *VectorIndexOptions, selection SegmentSelection) (*SegmentBuilder, error)
NewVectorSegmentBuilder creates a vector segment builder. The builder takes its own dataset snapshot, so the dataset handle does not need to outlive it.
func (*Dataset) OpenFragment ¶
OpenFragment resolves a bound fragment snapshot by ID.
func (*Dataset) OptimizeIndices ¶
func (d *Dataset) OptimizeIndices(options *compaction.OptimizeOptions) error
OptimizeIndices runs native single-process index optimization in place on d.
func (*Dataset) PlanCompaction ¶
func (d *Dataset) PlanCompaction(options *compaction.Options) (*CompactionPlan, error)
PlanCompaction creates a native compaction plan from a dataset snapshot.
func (*Dataset) PlanOptimizeIndices ¶
func (d *Dataset) PlanOptimizeIndices(options *compaction.OptimizeOptions) (*OptimizeIndicesPlan, error)
PlanOptimizeIndices creates a native index-optimization plan from a dataset snapshot.
func (*Dataset) PrepareFTSMatchQuery ¶
func (d *Dataset) PrepareFTSMatchQuery(column, query string, matchOperator int32, maxFuzzyDistance uint32, coverage int32) (*FTSQueryContext, error)
PrepareFTSMatchQuery prepares a Match query context pinned to d's snapshot.
func (*Dataset) PrepareFTSPhraseQuery ¶
func (d *Dataset) PrepareFTSPhraseQuery(column, query string, slop int32, coverage int32) (*FTSQueryContext, error)
PrepareFTSPhraseQuery prepares a Phrase query context pinned to d's snapshot.
func (*Dataset) PrewarmIndex ¶
func (d *Dataset) PrewarmIndex(name string, opts *PrewarmOptions) error
PrewarmIndex warms index segments. A nil opts value uses the legacy all-segment call.
func (*Dataset) ReadBlobRanges ¶
func (d *Dataset) ReadBlobRanges(column string, selector int32, requests []BlobRangeRequest, options *BlobReadOptions) (*StreamReader, error)
ReadBlobRanges plans a blob-range read and returns a stream reader. The caller owns the reader and must release it.
func (*Dataset) ReadBlobs ¶
func (d *Dataset) ReadBlobs(column string, selector int32, rows []uint64, options *BlobReadOptions) (*StreamReader, error)
ReadBlobs plans a whole-blob read and returns a stream reader. The caller owns the reader and must release it.
func (*Dataset) ReadTransaction ¶
func (d *Dataset) ReadTransaction() (*Transaction, error)
ReadTransaction reads the current snapshot's transaction. It returns (nil, nil) when the manifest has no transaction file.
func (*Dataset) ReadTransactionByVersion ¶
func (d *Dataset) ReadTransactionByVersion(version uint64) (*Transaction, error)
ReadTransactionByVersion reads a specific version's transaction.
func (*Dataset) ReplaceBranchMetadata ¶
ReplaceBranchMetadata replaces all metadata on an existing branch.
func (*Dataset) ReplaceTagMetadata ¶
ReplaceTagMetadata replaces all metadata on an existing tag.
func (*Dataset) ResolveFieldID ¶
func (d *Dataset) ResolveFieldID(ref FieldReference) (int32, error)
func (*Dataset) Restore ¶
Restore commits a new version whose content is the requested version and returns an independent dataset at that new commit.
func (*Dataset) Take ¶
Take reads rows by zero-based offsets. The returned batches are owned by the caller and must each be released.
func (*Dataset) TakeBlobsByAddresses ¶
func (*Dataset) TakeBlobsByIndices ¶
func (*Dataset) TakeRows ¶
TakeRows reads rows by dataset row IDs. Missing or deleted row IDs may be omitted by native Lance. The returned batches are owned by the caller and must each be released.
func (*Dataset) TrainIVFModel ¶
func (d *Dataset) TrainIVFModel(column string, numPartitions uint32, metric int32, fragmentIDs []uint32, options *TrainerOptions) (arrow.Array, arrow.Field, error)
TrainIVFModel exports a trained IVF centroids model. The returned array is owned by the caller and must be released.
func (*Dataset) TrainPQModel ¶
func (d *Dataset) TrainPQModel(column string, numSubVectors, numBits uint32, metric int32, ivfCentroids arrow.Array, fragmentIDs []uint32, options *TrainerOptions) (arrow.Array, arrow.Field, error)
TrainPQModel exports a trained PQ codebook conditioned on the given IVF centroids. Both the centroids and the returned array remain caller-owned; the native trainer borrows the centroid array synchronously.
func (*Dataset) URI ¶ added in v0.2.0
URI returns a copy of the snapshot's fully qualified native URI.
The value is stable for the lifetime of the native snapshot and is copied into Go memory before return, so it remains valid after the dataset closes.
func (*Dataset) Update ¶
func (d *Dataset) Update(predicate string, updates []ColumnUpdate) (uint64, error)
Update applies SQL expressions to rows matching predicate. An empty predicate updates every row and is passed to C as NULL.
func (*Dataset) UpdateConfigJSON ¶
func (d *Dataset) UpdateConfigJSON(keys []string, values []*string, mode int32) (map[string]string, error)
UpdateConfigJSON merges or replaces the complete configuration and returns the complete updated map. A nil value removes the key.
func (*Dataset) UpdateFieldMetadata ¶
func (d *Dataset) UpdateFieldMetadata(updates []FieldMetadataUpdate) error
func (*Dataset) UpdateMetadataJSON ¶
func (*Dataset) UpdateSchemaMetadataJSON ¶
func (*Dataset) VersionRefs ¶
VersionRefs snapshots the lightweight manifest reference ids.
func (*Dataset) Versions ¶
func (d *Dataset) Versions() ([]VersionInfo, error)
Versions snapshots the committed version history in ascending version order.
type DedicatedBlobWriter ¶
type DedicatedBlobWriter struct {
// contains filtered or unexported fields
}
DedicatedBlobWriter is an opaque native dedicated blob sidecar writer.
func (*DedicatedBlobWriter) BlobID ¶
func (w *DedicatedBlobWriter) BlobID() uint32
BlobID returns the native blob id.
func (*DedicatedBlobWriter) Close ¶
func (w *DedicatedBlobWriter) Close()
Close frees the native allocation. It is idempotent.
func (*DedicatedBlobWriter) FinishArray ¶
FinishArray consumes the native writer and returns the prepared descriptor.
func (*DedicatedBlobWriter) Path ¶
func (w *DedicatedBlobWriter) Path() (string, error)
Path returns the native sidecar path.
func (*DedicatedBlobWriter) Write ¶
func (w *DedicatedBlobWriter) Write(data []byte) error
Write appends bytes to the dedicated sidecar.
type DelimitedList ¶
DelimitedList is a copied native list_with_delimiter result.
type FTSBoostOptions ¶
type FTSBoostOptions struct {
NegativeBoost *float32
}
FTSBoostOptions holds Boost query options. A nil NegativeBoost keeps the native default.
type FTSCombinedFieldsOptions ¶
FTSCombinedFieldsOptions holds CombinedFields query options.
type FTSMatchOptions ¶
type FTSMatchOptions struct {
Boost *float32
Fuzziness int64
MaxExpansions *uint64
MatchOperator int32
PrefixLength uint32
DocumentGranularity int32
}
FTSMatchOptions holds Match query options. Nil optional fields keep native defaults.
type FTSMultiMatchOptions ¶
FTSMultiMatchOptions holds MultiMatch query options.
type FTSPhraseOptions ¶
FTSPhraseOptions holds Phrase query options.
type FTSQuery ¶
type FTSQuery struct {
// contains filtered or unexported fields
}
FTSQuery is an immutable native full-text query value.
func NewFTSBooleanQuery ¶
NewFTSBooleanQuery creates an immutable Boolean query. Occurs and queries must have the same length; the native constructor accepts an empty query.
func NewFTSBoostQuery ¶
func NewFTSBoostQuery(positive, negative *FTSQuery, opts FTSBoostOptions) (*FTSQuery, error)
NewFTSBoostQuery creates an immutable Boost query.
func NewFTSCombinedFieldsQuery ¶
func NewFTSCombinedFieldsQuery(terms string, columns []string, opts FTSCombinedFieldsOptions) (*FTSQuery, error)
NewFTSCombinedFieldsQuery creates an immutable CombinedFields query.
func NewFTSMatchQuery ¶
func NewFTSMatchQuery(terms string, column *string, opts FTSMatchOptions) (*FTSQuery, error)
NewFTSMatchQuery creates an immutable Match query. A nil column lets scan planning resolve the indexed columns.
func NewFTSMultiMatchQuery ¶
func NewFTSMultiMatchQuery(terms string, columns []string, opts FTSMultiMatchOptions) (*FTSQuery, error)
NewFTSMultiMatchQuery creates an immutable MultiMatch query.
func NewFTSPhraseQuery ¶
func NewFTSPhraseQuery(terms string, column *string, opts FTSPhraseOptions) (*FTSQuery, error)
NewFTSPhraseQuery creates an immutable Phrase query.
type FTSQueryContext ¶
type FTSQueryContext struct {
// contains filtered or unexported fields
}
FTSQueryContext is a prepared, process-local query context pinned to one native dataset snapshot.
func (*FTSQueryContext) Close ¶
func (c *FTSQueryContext) Close() error
Close releases the native prepared context. It is idempotent and waits for in-flight scanner attachment.
type FieldMetadataUpdate ¶
type FieldMetadataUpdate struct {
Field FieldReference
Keys []string
Values []*string
Mode int32
}
FieldMetadataUpdate replaces or merges metadata for one field.
type FieldReference ¶
type FieldReference struct {
Kind FieldReferenceKind
FieldID int32
Path string
}
FieldReference identifies a field by id or by nested path.
type FieldReferenceKind ¶
type FieldReferenceKind int32
FieldReferenceKind selects how a field reference identifies a field.
const ( FieldReferenceID FieldReferenceKind = 0 FieldReferencePath FieldReferenceKind = 1 )
type FieldStatistics ¶
FieldStatistics reports compressed on-disk bytes for one schema field.
type FileBufferDescriptor ¶
FileBufferDescriptor mirrors LanceBufferDescriptor.
type FileCacheMode ¶
type FileCacheMode int32
FileCacheMode mirrors LanceFileCacheMode.
const ( FileCacheNone FileCacheMode = 0 FileCacheSession FileCacheMode = 1 )
type FileColumnMetadata ¶
type FileColumnMetadata struct {
Buffers []FileBufferDescriptor
Pages []FilePageMetadata
Encoding FileEncodingDescriptor
}
FileColumnMetadata is a copied column descriptor.
type FileColumnStatistics ¶
FileColumnStatistics mirrors LanceColumnStatistics.
type FileEncodingDescriptor ¶
type FileEncodingDescriptor struct {
Kind FileEncodingKind
BufferLocation uint64
BufferLength uint64
DirectBytes []byte
}
FileEncodingDescriptor is a copied encoding descriptor. DirectBytes is copied out of the native metadata snapshot.
type FileEncodingKind ¶
type FileEncodingKind int32
FileEncodingKind mirrors LanceFileEncodingKind.
const ( FileEncodingAbsent FileEncodingKind = 0 FileEncodingNone FileEncodingKind = 1 FileEncodingDirect FileEncodingKind = 2 FileEncodingIndirect FileEncodingKind = 3 )
type FileMetadata ¶
type FileMetadata struct {
// contains filtered or unexported fields
}
FileMetadata is an owned native metadata snapshot.
func (*FileMetadata) Columns ¶
func (m *FileMetadata) Columns() ([]FileColumnMetadata, error)
Columns copies per-column and per-page descriptors.
func (*FileMetadata) GlobalBuffers ¶
func (m *FileMetadata) GlobalBuffers() ([]FileBufferDescriptor, error)
GlobalBuffers copies global buffer descriptors (not contents).
func (*FileMetadata) Info ¶
func (m *FileMetadata) Info() (FileMetadataInfo, error)
Info copies scalar metadata.
type FileMetadataInfo ¶
type FileMetadataInfo struct {
FormatVersion int32
MajorVersion uint16
MinorVersion uint16
NumRows uint64
NumDataBytes uint64
NumColumnMetadataBytes uint64
NumGlobalBufferBytes uint64
FileSizeBytes uint64
NumColumns uint64
NumPhysicalColumns uint64
NumGlobalBuffers uint64
}
FileMetadataInfo mirrors LanceFileMetadataInfo.
type FilePageMetadata ¶
type FilePageMetadata struct {
Buffers []FileBufferDescriptor
NumRows uint64
Priority uint64
Encoding FileEncodingDescriptor
EncodingDescription string
}
FilePageMetadata is a copied page descriptor.
type FileReader ¶
type FileReader struct {
// contains filtered or unexported fields
}
FileReader is an opaque native raw Lance-file reader.
func OpenFileReader ¶
func OpenFileReader(uri string, storage *StorageOptionsAccessor, options *FileReaderOptions, session *Session, scheduler *FileSchedulerConfig) (*FileReader, error)
OpenFileReader opens uri as a raw Lance file. A nil storage accessor selects native None. Scheduler nil selects native defaults.
func (*FileReader) Close ¶
func (r *FileReader) Close()
Close releases the reader allocation. Streams already returned stay usable.
func (*FileReader) IOStats ¶
func (r *FileReader) IOStats() (FileScanStats, error)
IOStats returns cumulative native IO counters.
func (*FileReader) Metadata ¶
func (r *FileReader) Metadata() (*FileMetadata, error)
Metadata returns an independent metadata snapshot.
func (*FileReader) NumRows ¶
func (r *FileReader) NumRows() (uint64, error)
NumRows returns the file row count.
func (*FileReader) ReadAll ¶
func (r *FileReader) ReadAll(batchSize, batchReadahead uint32) (*StreamReader, error)
ReadAll streams all rows. batchSize and batchReadahead must be positive; the native C API does not supply defaults.
func (*FileReader) ReadGlobalBuffer ¶
func (r *FileReader) ReadGlobalBuffer(index uint32) ([]byte, error)
ReadGlobalBuffer reads global buffer index. Index 0 is the serialized schema; writer-added buffers start at 1.
func (*FileReader) ReadIndices ¶
func (r *FileReader) ReadIndices(indices []uint32, batchSize, batchReadahead uint32) (*StreamReader, error)
ReadIndices streams rows at strictly increasing, unique row indices. An empty slice reads no rows.
func (*FileReader) ReadRange ¶
func (r *FileReader) ReadRange(offset, numRows uint64, batchSize, batchReadahead uint32) (*StreamReader, error)
ReadRange streams numRows rows starting at offset.
func (*FileReader) Statistics ¶
func (r *FileReader) Statistics() (*FileStatistics, error)
Statistics returns an independent statistics snapshot.
type FileReaderOptions ¶
type FileReaderOptions struct {
Columns []string
CacheMode FileCacheMode
ReadChunkSize *uint64
BatchSizeBytes *uint64
CacheRepetitionIndex *bool
ValidateOnDecode *bool
InlineScheduling *bool
}
FileReaderOptions mirrors LanceFileReaderOptions. Pointer fields preserve the difference between an unset option and an explicit zero value. A nil Columns slice leaves projection unset; a non-nil empty slice forwards an explicit empty projection.
type FileRegistryStats ¶
FileRegistryStats mirrors LanceObjectStoreRegistryStats.
type FileScanStats ¶
FileScanStats mirrors LanceScanStats.
type FileSchedulerConfig ¶
FileSchedulerConfig mirrors LanceSchedulerConfig.
type FileSession ¶
type FileSession struct {
// contains filtered or unexported fields
}
FileSession is an opaque native raw Lance-file session.
func OpenFileSession ¶
func OpenFileSession(baseURI string, storage *StorageOptionsAccessor, session *Session, scheduler *FileSchedulerConfig) (*FileSession, error)
OpenFileSession opens a session over baseURI. A nil storage accessor selects native None; a non-nil accessor must stay open for the duration of this call.
func (*FileSession) BasePath ¶
func (s *FileSession) BasePath() (string, error)
BasePath returns the native resolved base path.
func (*FileSession) Close ¶
func (s *FileSession) Close()
Close releases the session allocation. Readers, writers, streams, and blob writers retain their shared native resources.
func (*FileSession) Contains ¶
func (s *FileSession) Contains(relativePath string) (bool, error)
Contains reports whether relativePath exists in the session store.
func (*FileSession) DeleteFile ¶
func (s *FileSession) DeleteFile(relativePath string) error
DeleteFile removes relativePath.
func (*FileSession) DownloadFile ¶
func (s *FileSession) DownloadFile(relativeRemotePath, localPath string) error
DownloadFile downloads relativeRemotePath to localPath.
func (*FileSession) List ¶
func (s *FileSession) List(relativePath string) ([]string, error)
List returns paths relative to the session base. An empty relativePath lists the base itself, which native represents as a NULL path.
func (*FileSession) ListWithDelimiter ¶
func (s *FileSession) ListWithDelimiter(relativePath string) (DelimitedList, error)
ListWithDelimiter lists paths and common prefixes relative to the session base. An empty relativePath lists the base itself.
func (*FileSession) OpenDedicatedBlobWriter ¶
func (s *FileSession) OpenDedicatedBlobWriter(dataFilePath string, blobID uint32) (*DedicatedBlobWriter, error)
OpenDedicatedBlobWriter opens a dedicated blob writer relative to the session base.
func (*FileSession) OpenPackedBlobWriter ¶
func (s *FileSession) OpenPackedBlobWriter(dataFilePath string, blobID uint32) (*PackedBlobWriter, error)
OpenPackedBlobWriter opens a packed blob writer relative to the session base.
func (*FileSession) OpenReader ¶
func (s *FileSession) OpenReader(relativePath string, options *FileReaderOptions) (*FileReader, error)
OpenReader opens a raw file reader relative to the session base.
func (*FileSession) OpenWriter ¶
func (s *FileSession) OpenWriter(relativePath string, schema *arrow.Schema, options *FileWriterOptions) (*FileWriter, error)
OpenWriter opens a raw file writer relative to the session base. A nil schema creates a lazy writer that adopts the first batch schema.
func (*FileSession) ReadRange ¶
func (s *FileSession) ReadRange(relativePath string, offset, length uint64) ([]byte, error)
ReadRange reads length bytes at offset from relativePath.
func (*FileSession) RegistryStats ¶
func (s *FileSession) RegistryStats() (FileRegistryStats, error)
RegistryStats returns a snapshot of object-store registry counters.
func (*FileSession) SchedulerStats ¶
func (s *FileSession) SchedulerStats() (FileScanStats, error)
SchedulerStats returns a snapshot of scheduler counters.
func (*FileSession) StoreIOStats ¶
func (s *FileSession) StoreIOStats() (FileStoreIOStats, error)
StoreIOStats returns a snapshot of object-store IO counters.
func (*FileSession) StoreInfo ¶
func (s *FileSession) StoreInfo() (FileStoreInfo, error)
StoreInfo returns a snapshot of the resolved object store's properties.
func (*FileSession) UploadFile ¶
func (s *FileSession) UploadFile(localPath, relativeRemotePath string) error
UploadFile uploads localPath to relativeRemotePath.
type FileStatistics ¶
type FileStatistics struct {
// contains filtered or unexported fields
}
FileStatistics is an owned native statistics snapshot.
func (*FileStatistics) Close ¶
func (s *FileStatistics) Close()
Close releases the statistics snapshot.
func (*FileStatistics) Columns ¶
func (s *FileStatistics) Columns() ([]FileColumnStatistics, error)
Columns copies per-column statistics.
type FileStoreIOStats ¶
type FileStoreIOStats struct {
ReadIOPS uint64
ReadBytes uint64
WriteIOPS uint64
WrittenBytes uint64
}
FileStoreIOStats mirrors LanceObjectStoreIoStats.
type FileStoreInfo ¶
type FileStoreInfo struct {
BlockSize uint64
MaxIOPSize uint64
IOParallelism uint64
IsLocal bool
IsCloud bool
PrefersLiteScheduler bool
}
FileStoreInfo mirrors LanceObjectStoreInfo.
type FileWriteSummary ¶
FileWriteSummary mirrors LanceFileWriteSummary.
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
FileWriter is an opaque native raw Lance-file writer.
func OpenFileWriter ¶
func OpenFileWriter(uri string, schema *arrow.Schema, options *FileWriterOptions, storage *StorageOptionsAccessor, session *Session) (*FileWriter, error)
OpenFileWriter opens a standalone raw Lance-file writer. A nil schema creates a lazy writer that adopts the first batch schema. A nil storage accessor selects native None.
func (*FileWriter) AddGlobalBuffer ¶
func (w *FileWriter) AddGlobalBuffer(data []byte) (uint32, error)
AddGlobalBuffer appends a global buffer and returns its one-based index.
func (*FileWriter) AddSchemaMetadata ¶
func (w *FileWriter) AddSchemaMetadata(key, value string) error
AddSchemaMetadata adds one schema metadata entry.
func (*FileWriter) Close ¶
func (w *FileWriter) Close()
Close drops the writer allocation. It is idempotent and does not imply a successful finish.
func (*FileWriter) Finish ¶
func (w *FileWriter) Finish() (FileWriteSummary, error)
Finish finalizes the file and returns the native write summary.
func (*FileWriter) WriteBatch ¶
func (w *FileWriter) WriteBatch(batch arrow.RecordBatch) error
WriteBatch writes one borrowed Arrow batch.
type FileWriterOptions ¶
type FileWriterOptions struct {
DataCacheBytes *uint64
MaxPageBytes *uint64
KeepOriginalArray *bool
Version string
}
FileWriterOptions mirrors LanceFileWriterOptions. Pointer fields preserve unset versus explicit zero. Version is forwarded only when non-empty.
type Fragment ¶
type Fragment struct {
// contains filtered or unexported fields
}
Fragment is an owned snapshot of native Lance fragment metadata. A bound fragment reads the dataset version it was opened from and remains valid after the source dataset is closed or mutated. A detached fragment supports metadata inspection and operation construction only.
func CreateFragment ¶
func CreateFragment(uri string, fragmentID uint64, reader array.RecordReader, options FragmentCreateOptions) (*Fragment, error)
CreateFragment writes one uncommitted fragment and returns detached metadata. It does not publish a version. The stream is consumed by native code on every return path after export; reader is borrowed exactly as in Write.
func CreateFragmentFromFile ¶
func CreateFragmentFromFile(dataset *Dataset, filename string, fragmentID uint64, physicalRows *uint64) (*Fragment, error)
CreateFragmentFromFile creates one detached fragment from a stored Lance data file. filename is relative to the dataset's data directory. physicalRows is nil to let native code infer the row count; a non-nil pointer is forwarded explicitly, including a pointer to zero.
func WriteFragments ¶
func WriteFragments(uri string, reader array.RecordReader, options FragmentCreateOptions) ([]*Fragment, error)
WriteFragments writes zero or more uncommitted fragments. Native code owns max_rows_per_file splitting. Each returned fragment is independently owned. The stream is consumed by native code on every return path after export.
func (*Fragment) AddColumnsBatchUDF ¶
func (f *Fragment) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) (*Fragment, *Schema, error)
AddColumnsBatchUDF stages columns produced by udf.
func (*Fragment) AddColumnsNulls ¶
AddColumnsNulls stages all-null columns described by columns.
func (*Fragment) AddColumnsSQL ¶
func (f *Fragment) AddColumnsSQL(columns []SQLColumn, batchSize *uint32) (*Fragment, *Schema, error)
AddColumnsSQL stages SQL-computed columns on a clone of the fragment.
func (*Fragment) AddColumnsStream ¶
func (f *Fragment) AddColumnsStream(reader array.RecordReader, batchSize *uint32) (*Fragment, *Schema, error)
AddColumnsStream stages columns read from reader. The stream retains its own reference; reader remains owned by the caller.
func (*Fragment) Close ¶
func (f *Fragment) Close()
Close releases the fragment handle. It is idempotent.
func (*Fragment) CountRows ¶
CountRows counts fragment rows, optionally applying a native SQL filter. A nil filter selects no filter; a non-nil empty string is passed as Some("").
func (*Fragment) DataFileAt ¶
DataFileAt clones one native base data file.
func (*Fragment) DataFileCount ¶
DataFileCount returns the number of native base data files. Overlay and deletion files are not included.
func (*Fragment) DataFileForField ¶
DataFileForField finds the base data file storing fieldID. It returns (nil, nil) when the field is not present in any base data file.
func (*Fragment) Delete ¶
Delete stages a deletion on this fragment snapshot and returns the updated metadata. It returns (nil, nil) when the predicate deletes every row.
func (*Fragment) DeleteRows ¶
DeleteRows stages physical offsets on a clone of the fragment. A NULL native output means the offsets deleted every physical row.
func (*Fragment) DeletedRows ¶
DeletedRows returns the deleted-row count.
func (*Fragment) LogicalRows ¶
LogicalRows returns the logical row count.
func (*Fragment) MergeColumns ¶
func (f *Fragment) MergeColumns(reader array.RecordReader, leftOn, rightOn string) (*Fragment, *Schema, error)
MergeColumns merges reader into the fragment using leftOn/rightOn.
func (*Fragment) MetadataJSON ¶
MetadataJSON returns the native Fragment JSON serialization.
func (*Fragment) NativeSchema ¶
NativeSchema clones the fragment's native logical schema.
func (*Fragment) PhysicalRows ¶
PhysicalRows returns the physical row count, including deleted rows.
func (*Fragment) Scan ¶
Scan starts a scanner over the fragment's bound snapshot.
Native fragment scans do not accept initial column selection or a SQL filter; callers must use projection expressions or filter through the returned scanner's supported setters.
func (*Fragment) Take ¶
Take returns fragment-local logical rows by index. A nil columns slice selects the full logical schema; a non-nil empty slice requests an explicit empty projection.
func (*Fragment) UpdateColumns ¶
func (f *Fragment) UpdateColumns(reader array.RecordReader, leftOn, rightOn string) (*UpdateColumnsResult, error)
UpdateColumns stages an update from reader using leftOn/rightOn.
func (*Fragment) WriteColumnWithVersion ¶
func (f *Fragment) WriteColumnWithVersion(schema *Schema, reader array.RecordReader, fileVersion int32) (*DataReplacementGroup, error)
WriteColumnWithVersion stages a replacement data file with an explicit native file format version.
func (*Fragment) WriteColumns ¶
func (f *Fragment) WriteColumns(schema *Schema, reader array.RecordReader) (*DataReplacementGroup, error)
WriteColumns stages a replacement data file for schema.
type FragmentCreateOptions ¶
type FragmentCreateOptions struct {
Schema *Schema
Mode WriteMode
Write *FragmentWriteOptions
StorageOptions map[string]string
Session *Session
}
FragmentCreateOptions mirrors LanceFragmentCreateOptions.
A nil Schema leaves native schema inference in place. A non-nil Schema is borrowed for the call and cloned by native code before the asynchronous write starts. A nil Session or empty StorageOptions map selects native defaults.
type FragmentOffsets ¶
FragmentOffsets is one fragment entry for NewUpdatedFragmentOffsets.
type FragmentWriteOptions ¶
type FragmentWriteOptions struct {
Params WriteParams
AutoCleanup *AutoCleanupParams
SkipAutoCleanup bool
}
FragmentWriteOptions mirrors the native write-parameter portion of LanceFragmentCreateOptions. It is separate from WriteOptions because the fragment-create entry points carry the write mode in their own field.
type IndexSegmentResult ¶
type IndexSegmentResult struct {
// contains filtered or unexported fields
}
IndexSegmentResult is an opaque native LanceIndexSegmentResult handle.
func IndexSegmentResultFromJSON ¶
func IndexSegmentResultFromJSON(data string) (*IndexSegmentResult, error)
IndexSegmentResultFromJSON restores a native result from serialized JSON.
func (*IndexSegmentResult) Close ¶
func (r *IndexSegmentResult) Close()
Close releases the native result handle. It is not safe for concurrent use.
func (*IndexSegmentResult) Group ¶
func (r *IndexSegmentResult) Group() (uint32, error)
Group returns the result's merge group.
func (*IndexSegmentResult) JSON ¶
func (r *IndexSegmentResult) JSON() (string, error)
JSON returns the result's native serialized JSON.
func (*IndexSegmentResult) PlanID ¶
func (r *IndexSegmentResult) PlanID() ([16]byte, error)
PlanID returns the native plan identifier for this result.
func (*IndexSegmentResult) ReadVersion ¶
func (r *IndexSegmentResult) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the result read.
func (*IndexSegmentResult) ReplaceCount ¶
func (r *IndexSegmentResult) ReplaceCount() (uint64, error)
ReplaceCount returns the number of index segments replaced by the result.
func (*IndexSegmentResult) ReplaceUUIDAt ¶
func (r *IndexSegmentResult) ReplaceUUIDAt(index uint64) ([16]byte, error)
ReplaceUUIDAt returns one replaced segment's UUID.
func (*IndexSegmentResult) Segment ¶
func (r *IndexSegmentResult) Segment() (*SegmentMetadata, error)
Segment returns an owned copy of the produced segment metadata.
type MergeInsertParams ¶
type MergeInsertParams struct {
WhenMatched int32
WhenMatchedExpression string
WhenNotMatched int32
WhenNotMatchedBySource int32
WhenNotMatchedBySourceExpression string
}
MergeInsertParams mirrors LanceMergeInsertParams. Field values are native discriminants; the root package maps its typed enums onto them.
type MergeInsertResult ¶
MergeInsertResult reports the rows affected by MergeInsert.
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace is an opaque native namespace handle. Directory, REST and Connected namespaces all share it; the native implementation owns discovery, retries, routing and credential refresh.
func NewConnectNamespace ¶
func NewConnectNamespace(implName string, properties map[string]string, provider ContextProvider) (*Namespace, error)
NewConnectNamespace creates a native ConnectedNamespace for implName.
func NewCustomNamespace ¶
func NewCustomNamespace(dispatcher CustomNamespaceDispatcher, namespaceID string) (*Namespace, error)
NewCustomNamespace creates a native custom namespace backed by dispatcher. The namespace ID is optional; an empty value asks native code to generate a lifetime-stable identity. Native code owns the callback context and releases it exactly once, including when this constructor fails.
func NewDirectoryNamespace ¶
func NewDirectoryNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)
NewDirectoryNamespace creates a native DirectoryNamespace from properties. A nil or empty map uses native defaults.
func NewRestNamespace ¶
func NewRestNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)
NewRestNamespace creates a native RestNamespace from properties.
func (*Namespace) Call ¶
func (n *Namespace) Call(operation, requestJSON string, requestBytes []byte) (*CallResult, error)
Call executes one namespace operation. Empty requestJSON is sent as "{}". The native call is synchronous and cannot be cancelled once entered.
func (*Namespace) Close ¶
func (n *Namespace) Close()
Close releases the native namespace. It must be called exactly once by the owner of the handle.
func (*Namespace) CommitNamespaceURI ¶
func (n *Namespace) CommitNamespaceURI(tableIDJSON, uri string, tx *Transaction, opts CommitOptions, session *Session) (*Dataset, error)
CommitNamespaceURI commits tx to a namespace-managed publication URI.
func (*Namespace) NativeHandle ¶
NativeHandle returns the raw native handle for the internal owner boundary.
func (*Namespace) OpenDataset ¶
func (n *Namespace) OpenDataset(tableIDJSON string, storageOptions map[string]string, version uint64, session *Session) (*Dataset, error)
OpenDataset opens a namespace-managed table. A zero version selects the latest version. storageOptions may be nil.
func (*Namespace) OpsMetrics ¶
OpsMetrics returns the native operation counters as JSON. Directory and REST namespaces provide counters; Connected namespaces return an error.
func (*Namespace) ResetOpsMetrics ¶
ResetOpsMetrics resets the native operation counters.
func (*Namespace) StartRESTAdapter ¶
func (n *Namespace) StartRESTAdapter(host string, port uint16) (*RESTAdapter, error)
StartRESTAdapter starts a native REST adapter in front of ns. host may be empty to use the native default; port zero selects an ephemeral port.
func (*Namespace) WriteDataset ¶
func (n *Namespace) WriteDataset(tableIDJSON string, reader array.RecordReader, opts WriteOptions, storageOptions map[string]string, session *Session, branch string) (*Dataset, error)
WriteDataset writes reader through a namespace-managed destination. The stream is consumed on every return path after export.
type NamespaceError ¶
NamespaceError is a failure reported through LanceNamespaceResult. Its Code is the Lance Namespace ErrorCode and is meaningful even when it is zero (Unsupported).
func (*NamespaceError) Error ¶
func (e *NamespaceError) Error() string
type NativeWriteOptions ¶
type NativeWriteOptions struct {
// contains filtered or unexported fields
}
NativeWriteOptions is an owned native-backed write-options handle.
func NewNativeWriteOptions ¶
func NewNativeWriteOptions(spec NativeWriteOptionsSpec) (*NativeWriteOptions, error)
NewNativeWriteOptions creates an owned native-backed write-options handle. On success native owns the progress callback context; on failure Go drops it without invoking the release callback.
func (*NativeWriteOptions) Close ¶
func (o *NativeWriteOptions) Close()
Close releases the caller's native handle. Native writes clone the values they need. Close only after every call borrowing this handle has returned.
func (*NativeWriteOptions) Handle ¶
func (o *NativeWriteOptions) Handle() uintptr
Handle returns the native handle, or zero after Close.
type NativeWriteOptionsSpec ¶
type NativeWriteOptionsSpec struct {
WriteOptions *WriteOptions
TransactionProperties map[string]string
HasTransactionProperties bool
EnableV2ManifestPaths *bool
InitialBases []BasePath
TargetBases []uint32
TargetBaseNamesOrPaths []string
TargetAllBases *bool
BaseStoreParams map[string]BaseStoreParams
AllowExternalBlobOutsideBases bool
ExternalBlobMode int32
BlobPackFileSizeThreshold *uint64
FileWriterOptions *FileWriterOptions
Session *Session
StorageOptionsAccessor *StorageOptionsAccessor
CommitLock *CommitLock
Progress *WriteProgress
}
NativeWriteOptionsSpec mirrors LanceNativeWriteOptionsSpec.
CommitLock is forwarded as NULL when nil. Namespace and fragment-create entry points still accept only the older options structure, so callers must reject native-only fields there instead of dropping them.
type NearestMode ¶
type NearestMode int32
NearestMode identifies the shape of a nearest-query input.
const ( // NearestSingle is one query vector of Count elements. NearestSingle NearestMode = 0 // NearestBatch is Count row-major query vectors of Dimension elements. NearestBatch NearestMode = 1 // NearestMultiVector is Count row-major subvectors of Dimension elements. NearestMultiVector NearestMode = 2 )
type NearestQuery ¶
type NearestQuery struct {
Column string
Data unsafe.Pointer
DataType int32
K uint32
Mode NearestMode
Dimension int
Count int
}
NearestQuery describes one raw nearest-query input. Data points to Count*Dimension elements for batch and multi-vector queries, or to Count elements for a single query. The native setter copies the data before it returns, but the caller must keep Data alive until then.
type OpenOptions ¶
type OpenOptions struct {
// StorageOptions are passed to lance-c as NULL-terminated key/value pairs.
StorageOptions map[string]string
// StorageOptionsAccessor is a reusable native accessor. It is mutually
// exclusive with StorageOptions.
StorageOptionsAccessor *StorageOptionsAccessor
// BaseStoreParams binds native ObjectStoreParams to exact BasePath.path
// keys. A nil map keeps the ordinary open path; a non-nil map, including
// an empty one, uses the optional per-base open entry. When non-nil,
// StorageOptions must be nil; callers bridge static options to a
// StorageOptionsAccessor.
BaseStoreParams map[string]BaseStoreParams
// Version selects a dataset version. Zero selects the latest version.
Version uint64
// Session shares caches with other datasets. It may be nil.
Session *Session
// CommitLock routes commit acquisition and release through an optional
// external lock. Static StorageOptions are not accepted on this path;
// supply a StorageOptionsAccessor instead.
CommitLock *CommitLock
}
OpenOptions controls dataset opening and metadata selection.
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
Operation is an owned native transaction operation.
func NewAppendOperation ¶
NewAppendOperation clones fragments into a native Append operation.
func NewDataReplacementOperation ¶
func NewDataReplacementOperation(groups []*DataReplacementGroup) (*Operation, error)
NewDataReplacementOperation constructs a native DataReplacement operation.
func NewDeleteOperation ¶
func NewDeleteOperation(updated []*Fragment, deletedIDs []uint64, predicate string) (*Operation, error)
NewDeleteOperation clones updated fragments and deleted IDs into a native Delete operation.
func NewMergeOperation ¶
func NewMergeOperation(schema *Schema, fragments []*Fragment, preservesNullability bool) (*Operation, error)
NewMergeOperation clones a complete final fragment list and complete schema.
func NewProjectOperation ¶
NewProjectOperation constructs a native Project operation from a native schema.
func NewReserveFragmentsOperation ¶
NewReserveFragmentsOperation constructs a native ReserveFragments operation.
func NewRestoreOperation ¶
NewRestoreOperation constructs a native Restore operation.
func NewUpdateBasesOperation ¶
NewUpdateBasesOperation constructs a native UpdateBases operation.
func NewUpdateOperation ¶
func NewUpdateOperation(options UpdateOperationOptions) (*Operation, error)
NewUpdateOperation clones updated fragments and options into a native Update.
func (*Operation) AppendFragmentAt ¶
AppendFragmentAt clones one Append fragment as an independent detached handle.
func (*Operation) AppendFragmentCount ¶
AppendFragmentCount returns the number of fragments in an Append operation.
func (*Operation) BasePathAt ¶
BasePathAt copies one borrowed base-path view from an UpdateBases operation.
func (*Operation) Close ¶
func (o *Operation) Close()
Close releases the operation handle. It is idempotent.
func (*Operation) DataReplacementAt ¶
func (o *Operation) DataReplacementAt(index uint64) (*DataReplacementGroup, error)
DataReplacementAt clones one data replacement group.
func (*Operation) DataReplacementCount ¶
DataReplacementCount returns the number of data replacement groups.
func (*Operation) DeleteDeletedFragmentCount ¶
DeleteDeletedFragmentCount returns the number of fully deleted fragment IDs.
func (*Operation) DeleteDeletedFragmentIDAt ¶
DeleteDeletedFragmentIDAt returns one fully deleted fragment ID.
func (*Operation) DeletePredicate ¶
DeletePredicate returns the Delete operation's SQL predicate.
func (*Operation) DeleteUpdatedFragmentCount ¶
DeleteUpdatedFragmentCount returns the number of updated Delete fragments.
func (*Operation) DeleteUpdatedFragmentMetadataJSONAt ¶
DeleteUpdatedFragmentMetadataJSONAt serializes one updated Delete fragment.
func (*Operation) FragmentCount ¶
FragmentCount returns the fragment count for Append or Overwrite.
func (*Operation) Kind ¶
func (o *Operation) Kind() (OperationKind, error)
Kind returns the operation variant.
func (*Operation) MergeFragmentAt ¶
MergeFragmentAt clones one fragment from a Merge operation.
func (*Operation) MergeFragmentCount ¶
MergeFragmentCount returns the number of fragments in a Merge operation.
func (*Operation) NativeSchema ¶
NativeSchema clones the in-memory native operation schema.
func (*Operation) PreservesNullability ¶
PreservesNullability reads the assertion from a Merge or Project operation.
func (*Operation) ReserveFragmentsCount ¶
ReserveFragmentsCount returns the reserved fragment count.
func (*Operation) RestoreVersion ¶
RestoreVersion returns the target version of a Restore operation.
func (*Operation) Schema ¶
Schema exports a lossy Arrow view of an Overwrite, Merge or Project schema.
func (*Operation) UpdateBasesCount ¶
UpdateBasesCount returns the number of new base paths.
func (*Operation) UpdateFieldsModified ¶
UpdateFieldsModified returns the operation's modified field IDs.
func (*Operation) UpdateUpdatedFragmentAt ¶
UpdateUpdatedFragmentAt clones one updated fragment.
func (*Operation) UpdateUpdatedFragmentCount ¶
UpdateUpdatedFragmentCount returns the number of updated fragments.
func (*Operation) UpdateUpdatedFragmentOffsets ¶
func (o *Operation) UpdateUpdatedFragmentOffsets() (*UpdatedFragmentOffsets, bool, error)
UpdateUpdatedFragmentOffsets returns the native offset value when present.
type OperationKind ¶
type OperationKind int32
OperationKind mirrors LanceOperationKind.
const ( OperationUnknown OperationKind = 0 OperationAppend OperationKind = 1 OperationDelete OperationKind = 2 OperationOverwrite OperationKind = 3 OperationCreateIndex OperationKind = 4 OperationRewrite OperationKind = 5 OperationDataReplacement OperationKind = 6 OperationDataOverlay OperationKind = 7 OperationMerge OperationKind = 8 OperationRestore OperationKind = 9 OperationReserveFragments OperationKind = 10 OperationUpdate OperationKind = 11 OperationProject OperationKind = 12 OperationUpdateConfig OperationKind = 13 OperationUpdateMemWALState OperationKind = 14 OperationClone OperationKind = 15 OperationUpdateBases OperationKind = 16 )
type OptimizeIndexMerge ¶
type OptimizeIndexMerge struct {
// contains filtered or unexported fields
}
OptimizeIndexMerge is an opaque native LanceOptimizeIndexMerge handle.
func OptimizeIndexMergeFromJSON ¶
func OptimizeIndexMergeFromJSON(data string) (*OptimizeIndexMerge, error)
OptimizeIndexMergeFromJSON restores a native merge from serialized JSON.
func (*OptimizeIndexMerge) Close ¶
func (m *OptimizeIndexMerge) Close()
Close releases the native merge handle. It is not safe for concurrent use.
func (*OptimizeIndexMerge) Execute ¶
func (m *OptimizeIndexMerge) Execute(dataset *Dataset, results []*IndexSegmentResult) (*IndexSegmentResult, error)
Execute runs the merge against a dataset snapshot and task results. A nil result means native optimization found no work for this group.
func (*OptimizeIndexMerge) Group ¶
func (m *OptimizeIndexMerge) Group() (uint32, error)
Group returns the merge group.
func (*OptimizeIndexMerge) JSON ¶
func (m *OptimizeIndexMerge) JSON() (string, error)
JSON returns the merge's native serialized JSON.
func (*OptimizeIndexMerge) OldSegmentAt ¶
func (m *OptimizeIndexMerge) OldSegmentAt(index uint64) (*SegmentMetadata, error)
OldSegmentAt returns an owned copy of one old segment's metadata.
func (*OptimizeIndexMerge) OldSegmentCount ¶
func (m *OptimizeIndexMerge) OldSegmentCount() (uint64, error)
OldSegmentCount returns the number of old segments this merge folds into its output.
func (*OptimizeIndexMerge) PlanID ¶
func (m *OptimizeIndexMerge) PlanID() ([16]byte, error)
PlanID returns the native plan identifier for this merge.
func (*OptimizeIndexMerge) ReadVersion ¶
func (m *OptimizeIndexMerge) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the merge reads.
func (*OptimizeIndexMerge) ReplaceCount ¶
func (m *OptimizeIndexMerge) ReplaceCount() (uint64, error)
ReplaceCount returns the number of index segments replaced by the merge.
func (*OptimizeIndexMerge) ReplaceUUIDAt ¶
func (m *OptimizeIndexMerge) ReplaceUUIDAt(index uint64) ([16]byte, error)
ReplaceUUIDAt returns one replaced segment's UUID.
type OptimizeIndexTask ¶
type OptimizeIndexTask struct {
// contains filtered or unexported fields
}
OptimizeIndexTask is an opaque native LanceOptimizeIndexTask handle.
func OptimizeIndexTaskFromJSON ¶
func OptimizeIndexTaskFromJSON(data string) (*OptimizeIndexTask, error)
OptimizeIndexTaskFromJSON restores a native task from serialized JSON.
func (*OptimizeIndexTask) Close ¶
func (t *OptimizeIndexTask) Close()
Close releases the native task handle. It is not safe for concurrent use.
func (*OptimizeIndexTask) EnablePartitionRebalancing ¶
func (t *OptimizeIndexTask) EnablePartitionRebalancing() (bool, error)
EnablePartitionRebalancing reports the task's rebalancing flag.
func (*OptimizeIndexTask) Execute ¶
func (t *OptimizeIndexTask) Execute(dataset *Dataset) (*IndexSegmentResult, error)
Execute runs the task against a dataset snapshot. A nil result means native optimization found no work for this task.
func (*OptimizeIndexTask) FragmentCount ¶
func (t *OptimizeIndexTask) FragmentCount() (uint64, error)
FragmentCount returns the number of source fragments.
func (*OptimizeIndexTask) FragmentIDAt ¶
func (t *OptimizeIndexTask) FragmentIDAt(index uint64) (uint32, error)
FragmentIDAt returns one source fragment id.
func (*OptimizeIndexTask) Group ¶
func (t *OptimizeIndexTask) Group() (uint32, error)
Group returns the task's merge group.
func (*OptimizeIndexTask) JSON ¶
func (t *OptimizeIndexTask) JSON() (string, error)
JSON returns the task's native serialized JSON.
func (*OptimizeIndexTask) NumIndicesToMerge ¶
func (t *OptimizeIndexTask) NumIndicesToMerge() (compaction.Optional[uint64], error)
NumIndicesToMerge returns the task's optional merge limit.
func (*OptimizeIndexTask) OldSegmentAt ¶
func (t *OptimizeIndexTask) OldSegmentAt(index uint64) (*SegmentMetadata, error)
OldSegmentAt returns an owned copy of one old segment's metadata.
func (*OptimizeIndexTask) OldSegmentCount ¶
func (t *OptimizeIndexTask) OldSegmentCount() (uint64, error)
OldSegmentCount returns the number of old index segments the task may fold into its output.
func (*OptimizeIndexTask) PlanID ¶
func (t *OptimizeIndexTask) PlanID() ([16]byte, error)
PlanID returns the native plan identifier for this task.
func (*OptimizeIndexTask) ReadVersion ¶
func (t *OptimizeIndexTask) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the task reads.
func (*OptimizeIndexTask) Reference ¶
func (t *OptimizeIndexTask) Reference() (*SegmentMetadata, error)
Reference returns an owned copy of the task's reference segment metadata.
func (*OptimizeIndexTask) Retrain ¶
func (t *OptimizeIndexTask) Retrain() (bool, error)
Retrain reports the task's retrain flag.
type OptimizeIndicesPlan ¶
type OptimizeIndicesPlan struct {
// contains filtered or unexported fields
}
OptimizeIndicesPlan is an opaque native LanceOptimizeIndicesPlan handle.
func OptimizeIndicesPlanFromJSON ¶
func OptimizeIndicesPlanFromJSON(data string) (*OptimizeIndicesPlan, error)
OptimizeIndicesPlanFromJSON restores a native plan from serialized JSON.
func (*OptimizeIndicesPlan) Close ¶
func (p *OptimizeIndicesPlan) Close()
Close releases the native plan handle. It is not safe for concurrent use.
func (*OptimizeIndicesPlan) JSON ¶
func (p *OptimizeIndicesPlan) JSON() (string, error)
JSON returns the plan's native serialized JSON.
func (*OptimizeIndicesPlan) MergeAt ¶
func (p *OptimizeIndicesPlan) MergeAt(index uint64) (*OptimizeIndexMerge, error)
MergeAt returns an owned snapshot of one plan merge.
func (*OptimizeIndicesPlan) MergeCount ¶
func (p *OptimizeIndicesPlan) MergeCount() (uint64, error)
MergeCount returns the number of merges in the plan.
func (*OptimizeIndicesPlan) PlanID ¶
func (p *OptimizeIndicesPlan) PlanID() ([16]byte, error)
PlanID returns the native plan identifier.
func (*OptimizeIndicesPlan) ReadVersion ¶
func (p *OptimizeIndicesPlan) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the plan was created from.
func (*OptimizeIndicesPlan) TaskAt ¶
func (p *OptimizeIndicesPlan) TaskAt(index uint64) (*OptimizeIndexTask, error)
TaskAt returns an owned snapshot of one plan task.
func (*OptimizeIndicesPlan) TaskCount ¶
func (p *OptimizeIndicesPlan) TaskCount() (uint64, error)
TaskCount returns the number of tasks in the plan.
type PackedBlobWriter ¶
type PackedBlobWriter struct {
// contains filtered or unexported fields
}
PackedBlobWriter is an opaque native packed blob sidecar writer.
func (*PackedBlobWriter) BlobID ¶
func (w *PackedBlobWriter) BlobID() uint32
BlobID returns the native blob id.
func (*PackedBlobWriter) Close ¶
func (w *PackedBlobWriter) Close()
Close frees the native allocation. It is idempotent.
func (*PackedBlobWriter) FinishArray ¶
FinishArray consumes the native writer and returns the prepared descriptor.
func (*PackedBlobWriter) Path ¶
func (w *PackedBlobWriter) Path() (string, error)
Path returns the native sidecar path.
func (*PackedBlobWriter) Write ¶
func (w *PackedBlobWriter) Write(data []byte) error
Write appends one payload.
func (*PackedBlobWriter) WriteBlobs ¶
func (w *PackedBlobWriter) WriteBlobs(payloads arrow.Array) error
WriteBlobs appends one borrowed Arrow array of Binary, LargeBinary, or FixedSizeBinary payloads. The Arrow bridge rejects BinaryView. Native code consumes the exported array on every return, while payloads itself remains owned by the caller.
type PinnedLibrary ¶
PinnedLibrary is the lance-c build this package was compiled against. The values are build-time metadata; lance_c_version() reports only the binding release, so a loaded library cannot be verified against them.
type PrecomputedShuffleBuffers ¶
PrecomputedShuffleBuffers mirrors the native precomputed shuffle buffers.
type PrewarmOptions ¶
PrewarmOptions selects index segments to prewarm. SegmentUUIDs holds raw 16-byte UUIDs; HasSelection distinguishes "all" from an explicit empty selection.
type ProgressObservation ¶
type ProgressObservation struct {
Event int32
Stage string
Total uint64
Unit string
Completed uint64
}
ProgressObservation is one native index-build progress report. Event values and their field semantics are defined by the LanceIndexBuildProgressCallback header contract; the root package maps them to its public progress type.
type ProjectionColumn ¶
ProjectionColumn selects an output column by SQL expression.
type RESTAdapter ¶
type RESTAdapter struct {
// contains filtered or unexported fields
}
RESTAdapter is an opaque native REST adapter handle.
func (*RESTAdapter) Close ¶
func (a *RESTAdapter) Close()
Close stops the adapter when it is still serving and releases the native handle. It is safe after Shutdown and is idempotent at the owner boundary.
func (*RESTAdapter) NativeHandle ¶
func (a *RESTAdapter) NativeHandle() uintptr
NativeHandle returns the raw native handle for the internal owner boundary.
func (*RESTAdapter) Port ¶
func (a *RESTAdapter) Port() (uint16, error)
Port returns the bound adapter port, or zero when the adapter is stopped.
func (*RESTAdapter) Shutdown ¶
func (a *RESTAdapter) Shutdown()
Shutdown stops serving. It is idempotent.
type Ref ¶
Ref is a lightweight native version reference. Build values with its constructors; the zero value is invalid.
type RefKind ¶
type RefKind uint8
RefKind identifies the native reference variant carried by Ref.
const ( // RefVersionNumber addresses a version number on the current branch. RefVersionNumber RefKind = iota + 1 // RefBranchVersion addresses a version number on a named branch. RefBranchVersion // RefBranchLatest addresses the latest version of a named branch. RefBranchLatest // RefTag addresses the version named by a tag. RefTag )
type RewriteResult ¶
type RewriteResult struct {
// contains filtered or unexported fields
}
RewriteResult is an opaque native LanceRewriteResult handle.
func RewriteResultFromJSON ¶
func RewriteResultFromJSON(data string) (*RewriteResult, error)
RewriteResultFromJSON restores a native rewrite result from serialized JSON.
func (*RewriteResult) Close ¶
func (r *RewriteResult) Close()
Close releases the native rewrite result handle. It is not safe for concurrent use.
func (*RewriteResult) JSON ¶
func (r *RewriteResult) JSON() (string, error)
JSON returns the rewrite result's native serialized JSON.
func (*RewriteResult) Metrics ¶
func (r *RewriteResult) Metrics() (compaction.Metrics, error)
Metrics returns the rewrite metrics.
func (*RewriteResult) NewFragmentCount ¶
func (r *RewriteResult) NewFragmentCount() (uint64, error)
NewFragmentCount returns the number of rewritten fragments.
func (*RewriteResult) NewFragmentMetadataJSONAt ¶
func (r *RewriteResult) NewFragmentMetadataJSONAt(index uint64) (string, error)
NewFragmentMetadataJSONAt returns one rewritten fragment's metadata JSON.
func (*RewriteResult) OriginalFragmentCount ¶
func (r *RewriteResult) OriginalFragmentCount() (uint64, error)
OriginalFragmentCount returns the number of source fragments.
func (*RewriteResult) OriginalFragmentMetadataJSONAt ¶
func (r *RewriteResult) OriginalFragmentMetadataJSONAt(index uint64) (string, error)
OriginalFragmentMetadataJSONAt returns one source fragment's metadata JSON.
func (*RewriteResult) ReadVersion ¶
func (r *RewriteResult) ReadVersion() (uint64, error)
ReadVersion returns the dataset version the result read.
type RuntimeState ¶
type RuntimeState struct {
// Loaded reports whether a native library has been opened successfully.
Loaded bool
// FFIReady reports whether the mandatory C symbols are bound and native
// calls are ready. It is false when Loaded is false.
FFIReady bool
// Library describes the opened library. It is the zero value when Loaded
// is false.
Library loader.State
// Expected is the build-time lance-c pin.
Expected PinnedLibrary
}
RuntimeState is a side-effect-free snapshot of the native loader and FFI binding state.
func InspectRuntime ¶
func InspectRuntime() RuntimeState
InspectRuntime observes the loader and binding state without discovering, extracting, loading, binding, retrying, or otherwise changing it.
type ScalarIndexOptions ¶
type ScalarIndexOptions struct {
Train *bool
}
ScalarIndexOptions holds additive scalar index build options.
type ScanMetric ¶
ScanMetric is one native scanner metric.
type ScanStatistics ¶
type ScanStatistics struct {
IOPS uint64
Requests uint64
BytesRead uint64
IndicesLoaded uint64
IndexPartitionsLoaded uint64
IndexComparisons uint64
Metrics []ScanMetric
}
ScanStatistics is a snapshot of native scanner statistics.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is a single-use native scan. Next may be called by one goroutine at a time; Close is safe concurrently with Next.
func NewScanner ¶
func NewScanner(ds *Dataset, opts ScannerOptions, initialize func(*Scanner) error) (*Scanner, error)
NewScanner creates and configures a native scanner for ds. initialize attaches search configuration before the output schema is resolved. It runs synchronously during construction and must not publish the scanner.
func (*Scanner) AnalyzeCountPlan ¶
AnalyzeCountPlan returns the runtime analysis of the configured COUNT(*) plan without starting or advancing normal iteration.
func (*Scanner) AnalyzePlan ¶
AnalyzePlan executes the configured native plan and returns its runtime analysis without starting or advancing normal iteration.
func (*Scanner) Close ¶
Close releases the native scanner. It waits for an in-flight poll to leave native code before closing, then removes the Go waker and statistics handles after native close has joined callbacks.
func (*Scanner) CountRows ¶
CountRows executes the configured COUNT(*) plan without starting or advancing normal iteration. A zero result is valid, so the thread-local error is always consumed.
func (*Scanner) ExplainPlan ¶
ExplainPlan returns the configured native plan without starting iteration.
func (*Scanner) Next ¶
Next polls the scanner once, waiting without holding an OS thread when the native stream is pending. The returned batch is owned by the caller.
func (*Scanner) Schema ¶
Schema returns the scanner output schema. The schema is immutable and stays valid after the scanner closes.
func (*Scanner) SetFTSIndexSegments ¶
SetFTSIndexSegments restricts the scan to the given raw 16-byte UUIDs. An empty slice clears the selection.
func (*Scanner) SetFTSQuery ¶
SetFTSQuery attaches a typed FTS query to the scanner.
func (*Scanner) SetFTSQueryContext ¶
func (s *Scanner) SetFTSQueryContext(ctx *FTSQueryContext) error
SetFTSQueryContext attaches a prepared FTS query context to the scanner.
func (*Scanner) SetMinHashQuery ¶
SetMinHashQuery attaches a MinHash LSH query to the scanner.
func (*Scanner) Statistics ¶
func (s *Scanner) Statistics() ScanStatistics
Statistics returns the most recent native statistics snapshot.
type ScannerOptions ¶
type ScannerOptions struct {
Columns []string
Filter *string
Limit *int64
Offset *int64
BatchSize *int64
BatchSizeBytes *uint64
IOBufferSize *uint64
BatchReadahead *uint64
FragmentReadahead *uint64
TargetParallelism *uint64
ScanInOrder *bool
UseScalarIndex *bool
StrictBatchSize *bool
UseStats *bool
IncludeDeletedRows *bool
BlobHandling *int32
MaterializationStyle *int32
MaterializationEarly []string
FragmentIDs []uint64
FragmentIDsSet bool
DisableScoring bool
ScalarIndexSegment []byte
Projection []ProjectionColumn
OrderBy []ColumnOrdering
RowID *bool
RowAddress *bool
SubstraitFilter []byte
SubstraitAggregate []byte
AdditionalSQLFilters []string
Vector VectorOptions
}
ScannerOptions configures a native scanner before the scan starts.
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is an owned native Lance schema value. It preserves Lance field IDs, nested metadata, encodings and dictionary values that an ArrowSchema view cannot represent.
func (*Schema) Close ¶
func (s *Schema) Close()
Close releases the native schema handle. It is idempotent.
type SegmentBuilder ¶
type SegmentBuilder struct {
// contains filtered or unexported fields
}
SegmentBuilder owns one native uncommitted index segment builder. Builders are single-use and must be closed.
func (*SegmentBuilder) Close ¶
func (b *SegmentBuilder) Close() error
Close releases the native builder. It is idempotent and waits for a running Execute to return.
func (*SegmentBuilder) Execute ¶
func (b *SegmentBuilder) Execute() ([]byte, error)
Execute builds and returns the encoded IndexMetadata protobuf for one uncommitted segment. A builder can be executed at most once.
func (*SegmentBuilder) SetProgress ¶
func (b *SegmentBuilder) SetProgress(fn func(ProgressObservation)) error
SetProgress installs or replaces the progress observer. The callback must be installed before execution; its observer remains registered until Execute returns or the builder is closed.
type SegmentMetadata ¶
type SegmentMetadata struct {
// contains filtered or unexported fields
}
SegmentMetadata owns one parsed native IndexMetadata protobuf. A parsed value is independent of the dataset and of the bytes it was parsed from.
func ParseSegmentMetadata ¶
func ParseSegmentMetadata(encoded []byte) (*SegmentMetadata, error)
ParseSegmentMetadata decodes one encoded IndexMetadata protobuf.
func (*SegmentMetadata) BaseID ¶
func (m *SegmentMetadata) BaseID() (uint32, bool, error)
BaseID returns the optional base fragment ID recorded in the metadata.
func (*SegmentMetadata) Clone ¶
func (m *SegmentMetadata) Clone() (*SegmentMetadata, error)
Clone returns an independent copy of the metadata.
func (*SegmentMetadata) CloneWithFragmentIDs ¶
func (m *SegmentMetadata) CloneWithFragmentIDs(fragmentIDs []uint32) (*SegmentMetadata, error)
CloneWithFragmentIDs returns an independent copy with replaced coverage. A nil slice keeps the recorded coverage; a non-nil slice, including an empty one, replaces it.
func (*SegmentMetadata) Close ¶
func (m *SegmentMetadata) Close() error
Close releases the metadata. It is idempotent.
func (*SegmentMetadata) CoveringFieldIDs ¶
func (m *SegmentMetadata) CoveringFieldIDs() ([]int32, error)
CoveringFieldIDs returns the fields whose data the segment covers.
func (*SegmentMetadata) CreatedAt ¶
func (m *SegmentMetadata) CreatedAt() (int64, uint32, bool, error)
CreatedAt returns the recorded creation timestamp. The bool reports whether the optional timestamp is present.
func (*SegmentMetadata) DatasetVersion ¶
func (m *SegmentMetadata) DatasetVersion() (uint64, error)
DatasetVersion returns the dataset version the segment was built from.
func (*SegmentMetadata) Details ¶
func (m *SegmentMetadata) Details() ([]byte, bool, error)
Details returns the encoded index-details value. The bool reports whether the metadata carries one; a present but empty value returns a non-nil empty slice.
func (*SegmentMetadata) DetailsTypeURL ¶
func (m *SegmentMetadata) DetailsTypeURL() (string, bool, error)
DetailsTypeURL returns the index-details type URL when the metadata records an index_details value.
func (*SegmentMetadata) Encode ¶
func (m *SegmentMetadata) Encode() ([]byte, error)
Encode serializes the metadata back into its protobuf transport form.
func (*SegmentMetadata) FieldIDs ¶
func (m *SegmentMetadata) FieldIDs() ([]int32, error)
FieldIDs returns the field IDs the segment indexes.
func (*SegmentMetadata) FileCount ¶
func (m *SegmentMetadata) FileCount() (uint64, error)
FileCount returns the number of recorded index artifacts.
func (*SegmentMetadata) FilePathAt ¶
func (m *SegmentMetadata) FilePathAt(index uint64) (string, error)
FilePathAt returns the path of one recorded index artifact.
func (*SegmentMetadata) FileSizeAt ¶
func (m *SegmentMetadata) FileSizeAt(index uint64) (uint64, error)
FileSizeAt returns the recorded size of one index artifact.
func (*SegmentMetadata) FragmentIDs ¶
func (m *SegmentMetadata) FragmentIDs() ([]uint32, error)
FragmentIDs returns the fragment coverage recorded in the segment.
func (*SegmentMetadata) IndexType ¶
func (m *SegmentMetadata) IndexType() (int32, error)
IndexType returns the native index-type discriminant.
func (*SegmentMetadata) IndexVersion ¶
func (m *SegmentMetadata) IndexVersion() (int32, error)
IndexVersion returns the native index format version of the segment.
func (*SegmentMetadata) Name ¶
func (m *SegmentMetadata) Name() (string, error)
Name returns the segment name.
func (*SegmentMetadata) UUID ¶
func (m *SegmentMetadata) UUID() ([16]byte, error)
UUID returns the segment UUID.
type SegmentSelection ¶
SegmentSelection selects which fragments an index segment covers and optionally fixes its identity. FragmentIDs uses the native three-way convention: nil means the whole dataset, while a non-nil empty slice means an explicit empty coverage.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is an opaque native LanceSession handle. It owns shared index and metadata caches.
func NewSession ¶
NewSession creates a session with fixed-size index and metadata caches.
func NewSessionWithCacheSpecs ¶
NewSessionWithCacheSpecs creates a session with independently configured index and metadata caches. Both specs are required.
func (*Session) ApproxNumItems ¶
ApproxNumItems returns the approximate number of cached items.
func (*Session) CacheStats ¶
func (s *Session) CacheStats() (CacheStats, error)
CacheStats returns a snapshot of the session cache counters.
func (*Session) Close ¶
func (s *Session) Close()
Close releases the native session handle. Datasets opened with the session keep their shared cache state and remain valid.
func (*Session) NativeHandle ¶
NativeHandle returns the native session handle for internal call sites that hold an independent session lease. The caller must keep the Session open for the duration of the native call.
type StorageOptionsAccessor ¶
type StorageOptionsAccessor struct {
// contains filtered or unexported fields
}
StorageOptionsAccessor owns a native storage-options accessor. The accessor may contain fixed initial options, a dynamic provider, or both. Native owners retain their own references, so closing this handle does not invalidate a dataset, provider-backed store, or returned snapshot. Callers serialize Close against every native call that consumes the handle.
func NewStorageOptionsAccessor ¶
func NewStorageOptionsAccessor(values map[string]string) (*StorageOptionsAccessor, error)
NewStorageOptionsAccessor creates an accessor with fixed options. A nil or empty map creates Some(empty), not None; use a nil accessor for native None.
func NewStorageOptionsAccessorWithPresence ¶
func NewStorageOptionsAccessorWithPresence(initial map[string]string, hasInitial bool, provider *StorageOptionsProvider) (*StorageOptionsAccessor, error)
NewStorageOptionsAccessorWithPresence creates a native accessor. A nil initial map with hasInitial false becomes native None; a non-nil map, including an empty one, becomes native Some(initial).
func (*StorageOptionsAccessor) Close ¶
func (a *StorageOptionsAccessor) Close()
Close releases the caller's native accessor handle. Native owners retain their own references. It is idempotent but not safe to call concurrently with Snapshot or another native use of the same handle.
func (*StorageOptionsAccessor) Handle ¶
func (a *StorageOptionsAccessor) Handle() uintptr
Handle returns the native accessor pointer. The caller must serialize Close.
func (*StorageOptionsAccessor) Snapshot ¶
func (a *StorageOptionsAccessor) Snapshot() (map[string]string, bool, error)
Snapshot returns the accessor's current resolved options. A nil map with hasOptions false means native None; a non-nil empty map with true means native Some(empty). Native caching, expiration and fallback are preserved.
type StorageOptionsFetchFunc ¶
StorageOptionsFetchFunc resolves storage options for a native accessor. Returning a nil map means native None; a non-nil empty map means an explicitly empty option set.
type StorageOptionsProvider ¶
type StorageOptionsProvider struct {
// contains filtered or unexported fields
}
StorageOptionsProvider owns a native storage-options provider. The provider context is released when the final native owner (accessor, dataset, or object-store registry entry) is dropped.
func NewStorageOptionsProvider ¶
func NewStorageOptionsProvider(id string, fetch, force StorageOptionsFetchFunc) (*StorageOptionsProvider, error)
NewStorageOptionsProvider creates a provider backed by fetch. force may be nil, in which case native force-fetch falls back to fetch. The ID is copied by native code and defines native provider equality and registry cache identity.
func NewStorageOptionsProviderFromNamespace ¶
func NewStorageOptionsProviderFromNamespace(namespace *Namespace, tableIDJSON string) (*StorageOptionsProvider, error)
NewStorageOptionsProviderFromNamespace creates a native namespace-backed provider. The native provider retains the namespace and fetches vended credentials with typed table-id serialization.
func (*StorageOptionsProvider) Close ¶
func (p *StorageOptionsProvider) Close()
Close releases the caller's native provider handle. Native owners retain their own references, so datasets and accessors may outlive this call.
func (*StorageOptionsProvider) ID ¶
func (p *StorageOptionsProvider) ID() string
ID returns the provider identity copied into native code.
func (*StorageOptionsProvider) NativeID ¶
func (p *StorageOptionsProvider) NativeID() (string, error)
NativeID reads the identity back from native code. It is primarily useful for diagnostics and tests that assert the native copy is stable.
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader incrementally drains a native ArrowArrayStream. It owns the stream and releases it exactly once. Each batch returned by Next is owned by the caller. Next and Close are serialized; batches remain valid after Close.
func NewStreamReader ¶
func NewStreamReader(stream *cdata.ArrowArrayStream) (*StreamReader, error)
NewStreamReader takes ownership of stream and reads its schema immediately. On error the stream has already been released. On success stream.Release is cleared so the caller cannot release it a second time.
func (*StreamReader) Close ¶
func (r *StreamReader) Close()
Close releases the native stream. It is idempotent and does not invalidate batches that were already returned.
func (*StreamReader) Next ¶
func (r *StreamReader) Next() (arrow.RecordBatch, bool, error)
Next returns the next owned batch. A false return with a nil error marks the end of the stream. After an error every later call returns the same error.
func (*StreamReader) Schema ¶
func (r *StreamReader) Schema() *arrow.Schema
Schema returns the immutable stream schema.
type TagInfo ¶
type TagInfo struct {
Name string
Branch string
Version uint64
CreatedAt *time.Time
UpdatedAt *time.Time
ManifestSize uint64
Metadata map[string]string
}
TagInfo is a copied snapshot of one named tag.
type TrainerOptions ¶
TrainerOptions mirrors the additive standalone trainer controls. A nil field keeps the native default.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction is an owned native Lance transaction.
func NewTransaction ¶
func NewTransaction(readVersion uint64, operation *Operation, opts TransactionOptions) (*Transaction, error)
NewTransaction constructs a native transaction from an operation. The operation is cloned and remains usable.
func ParseTransaction ¶
func ParseTransaction(data []byte) (*Transaction, error)
ParseTransaction parses one complete native protobuf transaction.
func WriteUncommitted ¶
func WriteUncommitted(uri string, reader array.RecordReader, opts WriteUncommittedOptions) (*Transaction, error)
WriteUncommitted writes reader as uncommitted Lance data files.
func WriteUncommittedWithAccessor ¶
func WriteUncommittedWithAccessor(uri string, reader array.RecordReader, opts WriteUncommittedOptions, accessor *StorageOptionsAccessor) (*Transaction, error)
WriteUncommittedWithAccessor writes uncommitted data files using a reusable storage options accessor. The transaction metadata does not retain the accessor; pass it again when committing.
func WriteUncommittedWithNativeOptions ¶
func WriteUncommittedWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, options *NativeWriteOptions) (*Transaction, error)
WriteUncommittedWithNativeOptions stages reader using an owned native options handle. The returned transaction does not retain the options handle.
func (*Transaction) Close ¶
func (tx *Transaction) Close()
Close releases the transaction handle. It is idempotent.
func (*Transaction) HasProperties ¶
func (tx *Transaction) HasProperties() (bool, error)
HasProperties reports whether the native property map is Some, including Some(empty).
func (*Transaction) MarshalBinary ¶
func (tx *Transaction) MarshalBinary() ([]byte, error)
MarshalBinary serializes the transaction through native protobuf conversion.
func (*Transaction) NativeHandle ¶
func (t *Transaction) NativeHandle() uintptr
NativeHandle returns the native transaction handle for internal call sites that hold an independent transaction lease.
func (*Transaction) Operation ¶
func (tx *Transaction) Operation() (*Operation, error)
Operation clones the transaction's operation.
func (*Transaction) Properties ¶
func (tx *Transaction) Properties() (map[string]string, bool, error)
Properties returns the native transaction property map. The boolean reports whether the map is present, distinguishing absent from present-empty.
func (*Transaction) PropertyCount ¶
func (tx *Transaction) PropertyCount() (uint64, error)
PropertyCount returns the native transaction property count.
func (*Transaction) ReadVersion ¶
func (tx *Transaction) ReadVersion() (uint64, error)
ReadVersion returns the native read version. Zero is valid for an uncommitted create.
func (*Transaction) Tag ¶
func (tx *Transaction) Tag() (string, bool, error)
Tag returns the optional transaction tag.
func (*Transaction) UUID ¶
func (tx *Transaction) UUID() (string, error)
UUID returns the native transaction UUID.
type TransactionOptions ¶
type TransactionOptions struct {
UUID *string
Tag *string
Properties map[string]string
HasProperties bool
}
TransactionOptions controls native transaction construction.
type UpdateColumnsResult ¶
type UpdateColumnsResult struct {
// contains filtered or unexported fields
}
UpdateColumnsResult is the owned result of a native fragment update.
func (*UpdateColumnsResult) Close ¶
func (r *UpdateColumnsResult) Close()
Close releases the native result. It is idempotent.
func (*UpdateColumnsResult) FieldsModified ¶
func (r *UpdateColumnsResult) FieldsModified() ([]uint32, error)
FieldsModified returns the native modified field IDs in native order.
func (*UpdateColumnsResult) Fragment ¶
func (r *UpdateColumnsResult) Fragment() (*Fragment, error)
Fragment clones the detached updated fragment metadata.
func (*UpdateColumnsResult) MatchedOffsets ¶
func (r *UpdateColumnsResult) MatchedOffsets() ([]uint32, error)
MatchedOffsets returns an owned copy of the matched physical row offsets in native bitmap order.
type UpdateOperationOptions ¶
type UpdateOperationOptions struct {
UpdatedFragments []*Fragment
FieldsModified []uint32
UpdatedFragmentOffsets *UpdatedFragmentOffsets
}
UpdateOperationOptions carries the subset of native Update options needed to publish fragment update results.
type UpdatedFragmentOffsets ¶
type UpdatedFragmentOffsets struct {
// contains filtered or unexported fields
}
UpdatedFragmentOffsets is the owned native representation of physical row offsets grouped by fragment ID. Native owns ordering, duplicate handling and the underlying bitmap representation.
func NewUpdatedFragmentOffsets ¶
func NewUpdatedFragmentOffsets(entries []FragmentOffsets) (*UpdatedFragmentOffsets, error)
NewUpdatedFragmentOffsets copies entries into an owned native offsets value. Pass nil to produce the explicit empty value; omit the value entirely from NewUpdateOperation to represent native None.
func (*UpdatedFragmentOffsets) Clone ¶
func (o *UpdatedFragmentOffsets) Clone() (*UpdatedFragmentOffsets, error)
Clone returns an independently owned copy.
func (*UpdatedFragmentOffsets) Close ¶
func (o *UpdatedFragmentOffsets) Close()
Close releases the native value. It is idempotent.
func (*UpdatedFragmentOffsets) Count ¶
func (o *UpdatedFragmentOffsets) Count() (uint64, error)
Count returns the number of fragment entries.
func (*UpdatedFragmentOffsets) FragmentIDAt ¶
func (o *UpdatedFragmentOffsets) FragmentIDAt(index uint64) (uint64, error)
FragmentIDAt returns the fragment ID of one entry.
type VectorIndexOptions ¶
type VectorIndexOptions struct {
IndexType int32
Metric int32
NumPartitions *uint64
TargetPartitionSize *uint64
MaxIters *uint64
SampleRate *uint64
StreamingSampleRate *uint64
StreamingCoresetRate *uint64
StreamingRefinePasses uint64
PrecomputedPartitionsFile string
PrecomputedShuffleBuffers *PrecomputedShuffleBuffers
ShufflePartitionBatches *uint64
ShufflePartitionConcurrency *uint64
StorageOptions map[string]string
NumSubVectors *uint64
NumBits *uint64
IVFCentroids arrow.Array
PQCodebook arrow.Array
RabitQModelJSON []byte
HNSWMaxLevel *uint64
HNSWM *uint64
HNSWEFConstruction *uint64
FileVersion int32
SkipTranspose bool
RuntimeHints map[string]string
Train *bool
}
VectorIndexOptions holds native vector index build options. Optional fields are nil when absent; Arrow models are FixedSizeList arrays owned by the caller for the duration of the call.
type VectorOptions ¶
type VectorOptions struct {
Nearest *NearestQuery
Metric *int32
NProbes *uint32
MinNProbes *uint32
MaxNProbes *uint32
EF *uint32
RefineFactor *uint32
SearchEffort *float64
ApproxMode *int32
QueryParallelism *int32
UseIndex *bool
FastSearch *bool
Prefilter *bool
LowerDistance *float32
UpperDistance *float32
RowAllowlist []uint64
RowAllowlistSet bool
RowBlocklist []uint64
RowBlocklistSet bool
}
VectorOptions configures vector search and row masks. A nil pointer leaves the corresponding native default in place. Row masks use stable _rowid values; a set-but-empty mask therefore selects or excludes no rows.
type VersionInfo ¶
VersionInfo is one snapshot of a committed dataset version.
type WriteFragmentProgress ¶
WriteFragmentProgress is one native begin- or complete-fragment event.
type WriteOptions ¶
type WriteOptions struct {
Mode WriteMode
Params WriteParams
AutoCleanup *AutoCleanupParams
SkipAutoCleanup bool
}
WriteOptions controls a dataset write.
type WriteParams ¶
type WriteParams struct {
MaxRowsPerFile uint64
MaxRowsPerGroup uint64
MaxBytesPerFile uint64
DataStorageVersion string
EnableStableRowIDs bool
}
WriteParams mirrors LanceWriteParams. Zero values select native defaults, except EnableStableRowIDs which is always forwarded explicitly.
type WriteProgress ¶
type WriteProgress struct {
BeginFragment func(WriteFragmentProgress) error
CompleteFragment func(WriteFragmentProgress) error
WriteStats func(WriteStats)
}
WriteProgress receives native write callbacks. Callbacks run on native worker threads and must be safe for concurrent use.
type WriteStats ¶
WriteStats is a native cumulative write-statistics snapshot.
type WriteUncommittedOptions ¶
type WriteUncommittedOptions struct {
Write WriteOptions
StorageOptions map[string]string
TransactionProperties map[string]string
HasProperties bool
Session *Session
// CommitLock routes staged commit acquisition through an external lock.
// Static StorageOptions are not accepted on this path.
CommitLock *CommitLock
}
WriteUncommittedOptions augments a write with uncommitted transaction properties.
Source Files
¶
- abi.go
- base_paths.go
- batch_udf.go
- bindings.go
- blob.go
- branches.go
- byte_buffer.go
- callback_dispatch.go
- cleanup.go
- clone.go
- commit_lock.go
- compaction_options.go
- compaction_plan.go
- config.go
- context_release.go
- cstring.go
- data_file.go
- dataset.go
- dataset_new.go
- doc.go
- error.go
- errors.go
- file_options.go
- file_reader.go
- file_session.go
- file_writer.go
- fragment.go
- fragment_create.go
- fragment_mutation.go
- fts.go
- index.go
- index_metadata.go
- index_segment.go
- metadata.go
- mutation.go
- namespace.go
- namespace_callback.go
- namespace_custom.go
- namespace_types.go
- native_schema.go
- native_write_options.go
- optimize_options.go
- optimize_plan.go
- progress.go
- runtime.go
- scanner.go
- schema_evolution.go
- session.go
- storage_options_provider.go
- stream.go
- stream_reader.go
- tags.go
- transaction.go
- transaction_properties.go
- upstream.go
- version.go
- write.go