Documentation
¶
Overview ¶
Package namespace provides typed access to Lance namespaces through the native lance C API.
Namespace and REST adapter objects own independent native handles. Closing a namespace does not close datasets or adapters that were already acquired from it, and closing an object waits for in-flight native calls.
Every operation checks ctx before acquiring the native handle. The native call itself is synchronous and cannot be cancelled once it has started. A nil request sends an empty JSON object. Operations that return data also expose the raw Arrow IPC payload when the native protocol carries one.
Namespace failures and non-namespace native failures use distinct error types and code spaces. Error carries a namespace ErrorCode, prints its name and matches category sentinels through errors.Is; NativeError carries a lance-c code and is not classified into those categories.
Index ¶
- Variables
- func IsNotFound(err error) bool
- type AddColumnsEntry
- type AddVirtualColumnEntry
- type AddVirtualColumnOutputEntry
- type AlterColumnsEntry
- type AlterTableAddColumnsRequest
- type AlterTableAddColumnsResponse
- type AlterTableAlterColumnsRequest
- type AlterTableAlterColumnsResponse
- type AlterTableBackfillColumnsRequest
- type AlterTableBackfillColumnsResponse
- type AlterTableDropColumnsRequest
- type AlterTableDropColumnsResponse
- type AlterTransactionAction
- type AlterTransactionRequest
- type AlterTransactionResponse
- type AlterTransactionSetProperty
- type AlterTransactionSetStatus
- type AlterTransactionUnsetProperty
- type AlterVirtualColumnEntry
- type AnalyzeTableQueryPlanRequest
- type AnalyzeTableQueryPlanResponse
- type BatchCommitTablesRequest
- type BatchCommitTablesResponse
- type BatchCreateTableVersionsRequest
- type BatchCreateTableVersionsResponse
- type BatchDeleteTableVersionsRequest
- type BatchDeleteTableVersionsResponse
- type BooleanQuery
- type BoostQuery
- type BranchContents
- type CommitTableOperation
- type CommitTableResult
- type CountTableRowsRequest
- type CountTableRowsResponse
- type CreateMaterializedViewKind
- type CreateMaterializedViewRequest
- type CreateMaterializedViewResponse
- type CreateNamespaceRequest
- type CreateNamespaceResponse
- type CreateTableBranchRequest
- type CreateTableBranchResponse
- type CreateTableIndexRequest
- type CreateTableIndexResponse
- type CreateTableRequest
- type CreateTableResponse
- type CreateTableScalarIndexResponse
- type CreateTableTagRequest
- type CreateTableTagResponse
- type CreateTableVersionEntry
- type CreateTableVersionRequest
- type CreateTableVersionResponse
- type CustomClient
- type CustomClientError
- type CustomClientErrorCode
- type DeclareTableRequest
- type DeclareTableResponse
- type DeleteFromTableRequest
- type DeleteFromTableResponse
- type DeleteTableBranchRequest
- type DeleteTableBranchResponse
- type DeleteTableTagRequest
- type DeleteTableTagResponse
- type DeregisterTableRequest
- type DeregisterTableResponse
- type DescribeNamespaceRequest
- type DescribeNamespaceResponse
- type DescribeTableIndexStatsRequest
- type DescribeTableIndexStatsResponse
- type DescribeTableRequest
- type DescribeTableResponse
- type DescribeTableVersionRequest
- type DescribeTableVersionResponse
- type DescribeTransactionRequest
- type DescribeTransactionResponse
- type DropNamespaceRequest
- type DropNamespaceResponse
- type DropTableIndexRequest
- type DropTableIndexResponse
- type DropTableRequest
- type DropTableResponse
- type DynamicContextProvider
- type Error
- type ErrorCode
- type ErrorResponse
- type ExplainTableQueryPlanRequest
- type ExplainTableQueryPlanResponse
- type FragmentStats
- type FragmentSummary
- type FtsQuery
- type GetTableStatsRequest
- type GetTableStatsResponse
- type GetTableTagVersionRequest
- type GetTableTagVersionResponse
- type Identity
- type IndexContent
- type InsertIntoTableRequest
- type InsertIntoTableResponse
- type JsonArrowDataType
- type JsonArrowField
- type JsonArrowSchema
- type ListNamespacesRequest
- type ListNamespacesResponse
- type ListTableBranchesRequest
- type ListTableBranchesResponse
- type ListTableIndicesRequest
- type ListTableIndicesResponse
- type ListTableTagsRequest
- type ListTableTagsResponse
- type ListTableVersionsRequest
- type ListTableVersionsResponse
- type ListTablesRequest
- type ListTablesResponse
- type MatchQuery
- type MaterializedViewUdtfEntry
- type MaterializedViewUdtfKind
- type MergeInsertIntoTableRequest
- type MergeInsertIntoTableResponse
- type MultiMatchQuery
- type Namespace
- func NewConnect(implName string, properties map[string]string, opts ...Option) (Namespace, error)
- func NewCustom(client CustomClient, namespaceID string) (Namespace, error)
- func NewDirectory(properties map[string]string, opts ...Option) (Namespace, error)
- func NewRest(properties map[string]string, opts ...Option) (Namespace, error)
- type NamespaceErrordeprecated
- type NamespaceErrorCodedeprecated
- type NamespaceExistsRequest
- type NamespaceExistsResponse
- type NativeError
- type Nullable
- type Option
- type PartitionField
- type PartitionSpec
- type PartitionTransform
- type PhraseQuery
- type ProtocolError
- type QueryTableRequest
- type QueryTableRequestColumns
- type QueryTableRequestFullTextQuery
- type QueryTableRequestVector
- type QueryTableResponse
- type RESTAdapter
- type RefreshMaterializedViewRequest
- type RefreshMaterializedViewResponse
- type RegisterTableRequest
- type RegisterTableResponse
- type RenameTableRequest
- type RenameTableResponse
- type RestoreTableRequest
- type RestoreTableResponse
- type StringFtsQuery
- type StructuredFtsQuery
- type TableBasicStats
- type TableExistsRequest
- type TableExistsResponse
- type TableVersion
- type TagContents
- type UpdateFieldMetadataEntry
- type UpdateFieldMetadataRequest
- type UpdateFieldMetadataResponse
- type UpdateTableRequest
- type UpdateTableResponse
- type UpdateTableSchemaMetadataRequest
- type UpdateTableSchemaMetadataResponse
- type UpdateTableTagRequest
- type UpdateTableTagResponse
- type VersionRange
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = errors.New("namespace: not found") ErrAlreadyExists = errors.New("namespace: already exists") ErrInvalidInput = errors.New("namespace: invalid input") ErrPermissionDenied = errors.New("namespace: permission denied") ErrUnauthenticated = errors.New("namespace: unauthenticated") ErrConflict = errors.New("namespace: conflict") ErrUnsupported = errors.New("namespace: unsupported") ErrThrottled = errors.New("namespace: throttled") ErrInternal = errors.New("namespace: internal error") )
Category sentinels classify native namespace failures for errors.Is.
The namespace result channel preserves the exact native Lance Namespace code, so each category follows that code's meaning: the not-found codes, including TableColumnNotFound, are ErrNotFound; the already-exists codes are ErrAlreadyExists; ConcurrentModification is ErrConflict; InvalidInput, InvalidTableState, TableSchemaValidationError and NamespaceNotEmpty are ErrInvalidInput, matching the pinned lance-c mapping of those families; and the remaining codes keep their own category. Every code keeps its exact numeric value in Error.Code. A code added by a newer native library matches no sentinel; inspect Error.Code to handle it.
var ErrClosed = errors.New("namespace: closed")
ErrClosed is returned when a namespace or adapter is already closed.
Functions ¶
func IsNotFound ¶
IsNotFound reports whether err is a native not-found namespace error. It is shorthand for errors.Is(err, ErrNotFound) and includes ErrorCodeTableColumnNotFound, which the pinned native implementation reports as not found.
Types ¶
type AddColumnsEntry ¶
type AddColumnsEntry struct {
Name string `json:"name"`
Expression Nullable[string] `json:"expression,omitzero"`
Computed Nullable[string] `json:"computed,omitzero"`
VirtualColumn Nullable[AddVirtualColumnEntry] `json:"virtual_column,omitzero"`
}
AddColumnsEntry mirrors the Lance Namespace `AddColumnsEntry` schema.
func (*AddColumnsEntry) UnmarshalJSON ¶
func (v *AddColumnsEntry) UnmarshalJSON(data []byte) error
type AddVirtualColumnEntry ¶
type AddVirtualColumnEntry struct {
InputColumns []string `json:"input_columns"`
Outputs []AddVirtualColumnOutputEntry `json:"outputs"`
Image string `json:"image"`
UDF string `json:"udf"`
UDFName string `json:"udf_name"`
UDFVersion string `json:"udf_version"`
UDFBackend Nullable[string] `json:"udf_backend,omitzero"`
AutoBackfill Nullable[bool] `json:"auto_backfill,omitzero"`
Manifest Nullable[string] `json:"manifest,omitzero"`
ManifestChecksum Nullable[string] `json:"manifest_checksum,omitzero"`
FieldMetadata *map[string]string `json:"field_metadata,omitempty"`
}
AddVirtualColumnEntry mirrors the Lance Namespace `AddVirtualColumnEntry` schema.
func (*AddVirtualColumnEntry) UnmarshalJSON ¶
func (v *AddVirtualColumnEntry) UnmarshalJSON(data []byte) error
type AddVirtualColumnOutputEntry ¶
type AddVirtualColumnOutputEntry struct {
Column string `json:"column"`
StructField string `json:"struct_field"`
DataType any `json:"data_type"`
Nullable bool `json:"nullable"`
Metadata *map[string]string `json:"metadata,omitempty"`
}
AddVirtualColumnOutputEntry mirrors the Lance Namespace `AddVirtualColumnOutputEntry` schema.
type AlterColumnsEntry ¶
type AlterColumnsEntry struct {
Path string `json:"path"`
DataType *any `json:"data_type,omitempty"`
Rename Nullable[string] `json:"rename,omitzero"`
Nullable Nullable[bool] `json:"nullable,omitzero"`
VirtualColumn Nullable[AlterVirtualColumnEntry] `json:"virtual_column,omitzero"`
}
AlterColumnsEntry mirrors the Lance Namespace `AlterColumnsEntry` schema.
func (*AlterColumnsEntry) UnmarshalJSON ¶
func (v *AlterColumnsEntry) UnmarshalJSON(data []byte) error
type AlterTableAddColumnsRequest ¶
type AlterTableAddColumnsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
NewColumns []AddColumnsEntry `json:"new_columns"`
}
AlterTableAddColumnsRequest mirrors the Lance Namespace `AlterTableAddColumnsRequest` schema.
type AlterTableAddColumnsResponse ¶
type AlterTableAddColumnsResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version int64 `json:"version"`
}
AlterTableAddColumnsResponse mirrors the Lance Namespace `AlterTableAddColumnsResponse` schema.
type AlterTableAlterColumnsRequest ¶
type AlterTableAlterColumnsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Alterations []AlterColumnsEntry `json:"alterations"`
}
AlterTableAlterColumnsRequest mirrors the Lance Namespace `AlterTableAlterColumnsRequest` schema.
type AlterTableAlterColumnsResponse ¶
type AlterTableAlterColumnsResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version int64 `json:"version"`
}
AlterTableAlterColumnsResponse mirrors the Lance Namespace `AlterTableAlterColumnsResponse` schema.
type AlterTableBackfillColumnsRequest ¶
type AlterTableBackfillColumnsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Column string `json:"column"`
Where Nullable[string] `json:"where,omitzero"`
Concurrency Nullable[int32] `json:"concurrency,omitzero"`
IntraApplierConcurrency Nullable[int32] `json:"intra_applier_concurrency,omitzero"`
MinCheckpointSize Nullable[int32] `json:"min_checkpoint_size,omitzero"`
MaxCheckpointSize Nullable[int32] `json:"max_checkpoint_size,omitzero"`
BatchCheckpointFlushIntervalSeconds Nullable[float64] `json:"batch_checkpoint_flush_interval_seconds,omitzero"`
ReadVersion Nullable[int32] `json:"read_version,omitzero"`
TaskSize Nullable[int32] `json:"task_size,omitzero"`
NumFrags Nullable[int32] `json:"num_frags,omitzero"`
CheckpointSize Nullable[int32] `json:"checkpoint_size,omitzero"`
CommitGranularity Nullable[int32] `json:"commit_granularity,omitzero"`
Cluster Nullable[string] `json:"cluster,omitzero"`
Manifest Nullable[string] `json:"manifest,omitzero"`
}
AlterTableBackfillColumnsRequest mirrors the Lance Namespace `AlterTableBackfillColumnsRequest` schema.
func (*AlterTableBackfillColumnsRequest) UnmarshalJSON ¶
func (v *AlterTableBackfillColumnsRequest) UnmarshalJSON(data []byte) error
type AlterTableBackfillColumnsResponse ¶
type AlterTableBackfillColumnsResponse struct {
Context *map[string]string `json:"context,omitempty"`
JobID string `json:"job_id"`
}
AlterTableBackfillColumnsResponse mirrors the Lance Namespace `AlterTableBackfillColumnsResponse` schema.
type AlterTableDropColumnsRequest ¶
type AlterTableDropColumnsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Columns []string `json:"columns"`
}
AlterTableDropColumnsRequest mirrors the Lance Namespace `AlterTableDropColumnsRequest` schema.
type AlterTableDropColumnsResponse ¶
type AlterTableDropColumnsResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Version int64 `json:"version"`
}
AlterTableDropColumnsResponse mirrors the Lance Namespace `AlterTableDropColumnsResponse` schema.
type AlterTransactionAction ¶
type AlterTransactionAction struct {
SetStatusAction *AlterTransactionSetStatus `json:"setStatusAction,omitempty"`
SetPropertyAction *AlterTransactionSetProperty `json:"setPropertyAction,omitempty"`
UnsetPropertyAction *AlterTransactionUnsetProperty `json:"unsetPropertyAction,omitempty"`
}
AlterTransactionAction mirrors the Lance Namespace `AlterTransactionAction` schema.
type AlterTransactionRequest ¶
type AlterTransactionRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Actions []AlterTransactionAction `json:"actions"`
}
AlterTransactionRequest mirrors the Lance Namespace `AlterTransactionRequest` schema.
type AlterTransactionResponse ¶
type AlterTransactionResponse struct {
Context *map[string]string `json:"context,omitempty"`
Status string `json:"status"`
Properties *map[string]string `json:"properties,omitempty"`
}
AlterTransactionResponse mirrors the Lance Namespace `AlterTransactionResponse` schema.
type AlterTransactionSetProperty ¶
type AlterTransactionSetProperty struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
Mode *string `json:"mode,omitempty"`
}
AlterTransactionSetProperty mirrors the Lance Namespace `AlterTransactionSetProperty` schema.
type AlterTransactionSetStatus ¶
type AlterTransactionSetStatus struct {
Status *string `json:"status,omitempty"`
}
AlterTransactionSetStatus mirrors the Lance Namespace `AlterTransactionSetStatus` schema.
type AlterTransactionUnsetProperty ¶
type AlterTransactionUnsetProperty struct {
Key *string `json:"key,omitempty"`
Mode *string `json:"mode,omitempty"`
}
AlterTransactionUnsetProperty mirrors the Lance Namespace `AlterTransactionUnsetProperty` schema.
type AlterVirtualColumnEntry ¶
type AlterVirtualColumnEntry struct {
InputColumns Nullable[[]string] `json:"input_columns,omitzero"`
Image Nullable[string] `json:"image,omitzero"`
UDF Nullable[string] `json:"udf,omitzero"`
UDFName Nullable[string] `json:"udf_name,omitzero"`
UDFVersion Nullable[string] `json:"udf_version,omitzero"`
UDFBackend Nullable[string] `json:"udf_backend,omitzero"`
AutoBackfill Nullable[bool] `json:"auto_backfill,omitzero"`
Manifest Nullable[string] `json:"manifest,omitzero"`
ManifestChecksum Nullable[string] `json:"manifest_checksum,omitzero"`
FieldMetadata *map[string]string `json:"field_metadata,omitempty"`
}
AlterVirtualColumnEntry mirrors the Lance Namespace `AlterVirtualColumnEntry` schema.
func (*AlterVirtualColumnEntry) UnmarshalJSON ¶
func (v *AlterVirtualColumnEntry) UnmarshalJSON(data []byte) error
type AnalyzeTableQueryPlanRequest ¶
type AnalyzeTableQueryPlanRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
BypassVectorIndex *bool `json:"bypass_vector_index,omitempty"`
Columns *QueryTableRequestColumns `json:"columns,omitempty"`
DistanceType *string `json:"distance_type,omitempty"`
Ef *int32 `json:"ef,omitempty"`
FastSearch *bool `json:"fast_search,omitempty"`
Filter *string `json:"filter,omitempty"`
FullTextQuery *QueryTableRequestFullTextQuery `json:"full_text_query,omitempty"`
K int32 `json:"k"`
LowerBound *float32 `json:"lower_bound,omitempty"`
MaximumNprobes *int32 `json:"maximum_nprobes,omitempty"`
MinimumNprobes *int32 `json:"minimum_nprobes,omitempty"`
Nprobes *int32 `json:"nprobes,omitempty"`
Offset *int32 `json:"offset,omitempty"`
Prefilter *bool `json:"prefilter,omitempty"`
RefineFactor *int32 `json:"refine_factor,omitempty"`
UpperBound *float32 `json:"upper_bound,omitempty"`
Vector QueryTableRequestVector `json:"vector"`
VectorColumn *string `json:"vector_column,omitempty"`
Version *int64 `json:"version,omitempty"`
WithRowID *bool `json:"with_row_id,omitempty"`
}
AnalyzeTableQueryPlanRequest mirrors the Lance Namespace `AnalyzeTableQueryPlanRequest` schema.
type AnalyzeTableQueryPlanResponse ¶
type AnalyzeTableQueryPlanResponse struct {
Context *map[string]string `json:"context,omitempty"`
Analysis string `json:"analysis"`
}
AnalyzeTableQueryPlanResponse mirrors the Lance Namespace `AnalyzeTableQueryPlanResponse` schema.
type BatchCommitTablesRequest ¶
type BatchCommitTablesRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
Operations []CommitTableOperation `json:"operations"`
}
BatchCommitTablesRequest mirrors the Lance Namespace `BatchCommitTablesRequest` schema.
type BatchCommitTablesResponse ¶
type BatchCommitTablesResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Results []CommitTableResult `json:"results"`
}
BatchCommitTablesResponse mirrors the Lance Namespace `BatchCommitTablesResponse` schema.
type BatchCreateTableVersionsRequest ¶
type BatchCreateTableVersionsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
Entries []CreateTableVersionEntry `json:"entries"`
}
BatchCreateTableVersionsRequest mirrors the Lance Namespace `BatchCreateTableVersionsRequest` schema.
type BatchCreateTableVersionsResponse ¶
type BatchCreateTableVersionsResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Versions []TableVersion `json:"versions"`
}
BatchCreateTableVersionsResponse mirrors the Lance Namespace `BatchCreateTableVersionsResponse` schema.
type BatchDeleteTableVersionsRequest ¶
type BatchDeleteTableVersionsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Ranges []VersionRange `json:"ranges"`
}
BatchDeleteTableVersionsRequest mirrors the Lance Namespace `BatchDeleteTableVersionsRequest` schema.
type BatchDeleteTableVersionsResponse ¶
type BatchDeleteTableVersionsResponse struct {
Context *map[string]string `json:"context,omitempty"`
DeletedCount *int64 `json:"deleted_count,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
BatchDeleteTableVersionsResponse mirrors the Lance Namespace `BatchDeleteTableVersionsResponse` schema.
type BooleanQuery ¶
type BooleanQuery struct {
Must []FtsQuery `json:"must"`
MustNot []FtsQuery `json:"must_not"`
Should []FtsQuery `json:"should"`
}
BooleanQuery mirrors the Lance Namespace `BooleanQuery` schema.
type BoostQuery ¶
type BoostQuery struct {
Positive FtsQuery `json:"positive"`
Negative FtsQuery `json:"negative"`
NegativeBoost *float32 `json:"negative_boost,omitempty"`
}
BoostQuery mirrors the Lance Namespace `BoostQuery` schema.
type BranchContents ¶
type BranchContents struct {
ParentBranch *string `json:"parentBranch,omitempty"`
ParentVersion int64 `json:"parentVersion"`
CreateAt int64 `json:"createAt"`
ManifestSize int64 `json:"manifestSize"`
Metadata *map[string]string `json:"metadata,omitempty"`
}
BranchContents mirrors the Lance Namespace `BranchContents` schema.
type CommitTableOperation ¶
type CommitTableOperation struct {
DeclareTable *DeclareTableRequest `json:"declare_table,omitempty"`
CreateTableVersion *CreateTableVersionRequest `json:"create_table_version,omitempty"`
DeleteTableVersions *BatchDeleteTableVersionsRequest `json:"delete_table_versions,omitempty"`
DeregisterTable *DeregisterTableRequest `json:"deregister_table,omitempty"`
}
CommitTableOperation mirrors the Lance Namespace `CommitTableOperation` schema.
type CommitTableResult ¶
type CommitTableResult struct {
DeclareTable *DeclareTableResponse `json:"declare_table,omitempty"`
CreateTableVersion *CreateTableVersionResponse `json:"create_table_version,omitempty"`
DeleteTableVersions *BatchDeleteTableVersionsResponse `json:"delete_table_versions,omitempty"`
DeregisterTable *DeregisterTableResponse `json:"deregister_table,omitempty"`
}
CommitTableResult mirrors the Lance Namespace `CommitTableResult` schema.
type CountTableRowsRequest ¶
type CountTableRowsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
Branch *string `json:"branch,omitempty"`
Predicate *string `json:"predicate,omitempty"`
}
CountTableRowsRequest mirrors the Lance Namespace `CountTableRowsRequest` schema.
type CountTableRowsResponse ¶
type CountTableRowsResponse struct {
Context *map[string]string `json:"context,omitempty"`
Count *int64 `json:"count,omitempty"`
}
CountTableRowsResponse mirrors the Lance Namespace `CountTableRowsResponse` schema.
type CreateMaterializedViewKind ¶
type CreateMaterializedViewKind string
CreateMaterializedViewKind identifies the native materialized view kind for CreateMaterializedViewRequest.
const ( CreateMaterializedViewKindQuery CreateMaterializedViewKind = "query" CreateMaterializedViewKindUDTF CreateMaterializedViewKind = "udtf" CreateMaterializedViewKindChunker CreateMaterializedViewKind = "chunker" )
type CreateMaterializedViewRequest ¶
type CreateMaterializedViewRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Kind CreateMaterializedViewKind `json:"kind"`
SourceQuery string `json:"source_query"`
OutputSchema string `json:"output_schema"`
UDTFSpec Nullable[MaterializedViewUdtfEntry] `json:"udtf_spec,omitzero"`
WithNoData *bool `json:"with_no_data,omitempty"`
AutoRefresh Nullable[bool] `json:"auto_refresh,omitzero"`
}
CreateMaterializedViewRequest mirrors the Lance Namespace `CreateMaterializedViewRequest` schema.
func (*CreateMaterializedViewRequest) UnmarshalJSON ¶
func (v *CreateMaterializedViewRequest) UnmarshalJSON(data []byte) error
type CreateMaterializedViewResponse ¶
type CreateMaterializedViewResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version int64 `json:"version"`
JobID Nullable[string] `json:"job_id,omitzero"`
}
CreateMaterializedViewResponse mirrors the Lance Namespace `CreateMaterializedViewResponse` schema.
func (*CreateMaterializedViewResponse) UnmarshalJSON ¶
func (v *CreateMaterializedViewResponse) UnmarshalJSON(data []byte) error
type CreateNamespaceRequest ¶
type CreateNamespaceRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Mode *string `json:"mode,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
CreateNamespaceRequest mirrors the Lance Namespace `CreateNamespaceRequest` schema.
type CreateNamespaceResponse ¶
type CreateNamespaceResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
CreateNamespaceResponse mirrors the Lance Namespace `CreateNamespaceResponse` schema.
type CreateTableBranchRequest ¶
type CreateTableBranchRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Name string `json:"name"`
FromBranch *string `json:"from_branch,omitempty"`
FromVersion *int64 `json:"from_version,omitempty"`
}
CreateTableBranchRequest mirrors the Lance Namespace `CreateTableBranchRequest` schema.
type CreateTableBranchResponse ¶
type CreateTableBranchResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
CreateTableBranchResponse mirrors the Lance Namespace `CreateTableBranchResponse` schema.
type CreateTableIndexRequest ¶
type CreateTableIndexRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Column string `json:"column"`
IndexType string `json:"index_type"`
Name *string `json:"name,omitempty"`
DistanceType *string `json:"distance_type,omitempty"`
NumPartitions *int32 `json:"num_partitions,omitempty"`
NumSubVectors *int32 `json:"num_sub_vectors,omitempty"`
NumBits *int32 `json:"num_bits,omitempty"`
SampleRate *int32 `json:"sample_rate,omitempty"`
MaxIterations *int32 `json:"max_iterations,omitempty"`
TargetPartitionSize *int32 `json:"target_partition_size,omitempty"`
M *int32 `json:"m,omitempty"`
EfConstruction *int32 `json:"ef_construction,omitempty"`
WithPosition *bool `json:"with_position,omitempty"`
BaseTokenizer *string `json:"base_tokenizer,omitempty"`
Language *string `json:"language,omitempty"`
MaxTokenLength *int32 `json:"max_token_length,omitempty"`
LowerCase *bool `json:"lower_case,omitempty"`
Stem *bool `json:"stem,omitempty"`
RemoveStopWords *bool `json:"remove_stop_words,omitempty"`
AsciiFolding *bool `json:"ascii_folding,omitempty"`
}
CreateTableIndexRequest mirrors the Lance Namespace `CreateTableIndexRequest` schema.
type CreateTableIndexResponse ¶
type CreateTableIndexResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
CreateTableIndexResponse mirrors the Lance Namespace `CreateTableIndexResponse` schema.
type CreateTableRequest ¶
type CreateTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Mode *string `json:"mode,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
StorageOptions *map[string]string `json:"storage_options,omitempty"`
}
CreateTableRequest mirrors the Lance Namespace `CreateTableRequest` schema.
type CreateTableResponse ¶
type CreateTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Location *string `json:"location,omitempty"`
Version *int64 `json:"version,omitempty"`
StorageOptions *map[string]string `json:"storage_options,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
CreateTableResponse mirrors the Lance Namespace `CreateTableResponse` schema.
type CreateTableScalarIndexResponse ¶
type CreateTableScalarIndexResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
CreateTableScalarIndexResponse mirrors the Lance Namespace `CreateTableScalarIndexResponse` schema.
type CreateTableTagRequest ¶
type CreateTableTagRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Tag string `json:"tag"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
}
CreateTableTagRequest mirrors the Lance Namespace `CreateTableTagRequest` schema.
type CreateTableTagResponse ¶
type CreateTableTagResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
CreateTableTagResponse mirrors the Lance Namespace `CreateTableTagResponse` schema.
type CreateTableVersionEntry ¶
type CreateTableVersionEntry struct {
ID []string `json:"id"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
ManifestPath string `json:"manifest_path"`
ManifestSize *int64 `json:"manifest_size,omitempty"`
ETag *string `json:"e_tag,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
NamingScheme *string `json:"naming_scheme,omitempty"`
}
CreateTableVersionEntry mirrors the Lance Namespace `CreateTableVersionEntry` schema.
type CreateTableVersionRequest ¶
type CreateTableVersionRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
ManifestPath string `json:"manifest_path"`
ManifestSize *int64 `json:"manifest_size,omitempty"`
ETag *string `json:"e_tag,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
NamingScheme *string `json:"naming_scheme,omitempty"`
}
CreateTableVersionRequest mirrors the Lance Namespace `CreateTableVersionRequest` schema.
type CreateTableVersionResponse ¶
type CreateTableVersionResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Version *TableVersion `json:"version,omitempty"`
}
CreateTableVersionResponse mirrors the Lance Namespace `CreateTableVersionResponse` schema.
type CustomClient ¶
type CustomClient interface {
DescribeTable(request *DescribeTableRequest) (*DescribeTableResponse, error)
ListTableVersions(request *ListTableVersionsRequest) (*ListTableVersionsResponse, error)
CreateTableVersion(request *CreateTableVersionRequest) (*CreateTableVersionResponse, error)
DescribeTableVersion(request *DescribeTableVersionRequest) (*DescribeTableVersionResponse, error)
}
CustomClient implements the four managed-table operations a custom native namespace can dispatch. Implementations must be safe for concurrent use: native code may invoke the same client from multiple goroutines.
Requests and responses use the existing typed namespace models. Returned responses are encoded before the native call returns; the client must not mutate a response after returning it.
type CustomClientError ¶
type CustomClientError struct {
Code CustomClientErrorCode
Message string
}
CustomClientError reports a typed failure from a CustomClient back to native code. A returned CustomClientError is translated to the matching namespace error code; any other error is reported as an internal error. The error message is preserved in the resulting Error. Error uses a different code space: forwarding one directly also reports an internal error. A proxy client can translate it into a CustomClientError explicitly.
func (*CustomClientError) Error ¶
func (e *CustomClientError) Error() string
Error implements error.
func (*CustomClientError) ErrorCode ¶
func (e *CustomClientError) ErrorCode() int32
ErrorCode reports the native callback error code.
type CustomClientErrorCode ¶
type CustomClientErrorCode int32
CustomClientErrorCode is a typed error category reported by a CustomClient. The values match the native custom-dispatch callback contract. A custom client must use one of the declared constants; values without a mapped namespace error, including zero, are reported by native code as internal errors.
const ( CustomClientErrorInvalidInput CustomClientErrorCode = 1 CustomClientErrorIO CustomClientErrorCode = 2 CustomClientErrorNotFound CustomClientErrorCode = 3 CustomClientErrorAlreadyExists CustomClientErrorCode = 4 CustomClientErrorInternal CustomClientErrorCode = 6 CustomClientErrorUnsupported CustomClientErrorCode = 7 CustomClientErrorConflict CustomClientErrorCode = 8 )
type DeclareTableRequest ¶
type DeclareTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Location *string `json:"location,omitempty"`
VendCredentials *bool `json:"vend_credentials,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
DeclareTableRequest mirrors the Lance Namespace `DeclareTableRequest` schema.
type DeclareTableResponse ¶
type DeclareTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Location *string `json:"location,omitempty"`
StorageOptions *map[string]string `json:"storage_options,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
ManagedVersioning *bool `json:"managed_versioning,omitempty"`
}
DeclareTableResponse mirrors the Lance Namespace `DeclareTableResponse` schema.
type DeleteFromTableRequest ¶
type DeleteFromTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Predicate string `json:"predicate"`
}
DeleteFromTableRequest mirrors the Lance Namespace `DeleteFromTableRequest` schema.
type DeleteFromTableResponse ¶
type DeleteFromTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Version *int64 `json:"version,omitempty"`
}
DeleteFromTableResponse mirrors the Lance Namespace `DeleteFromTableResponse` schema.
type DeleteTableBranchRequest ¶
type DeleteTableBranchRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Name string `json:"name"`
}
DeleteTableBranchRequest mirrors the Lance Namespace `DeleteTableBranchRequest` schema.
type DeleteTableBranchResponse ¶
type DeleteTableBranchResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
DeleteTableBranchResponse mirrors the Lance Namespace `DeleteTableBranchResponse` schema.
type DeleteTableTagRequest ¶
type DeleteTableTagRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Tag string `json:"tag"`
}
DeleteTableTagRequest mirrors the Lance Namespace `DeleteTableTagRequest` schema.
type DeleteTableTagResponse ¶
type DeleteTableTagResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
DeleteTableTagResponse mirrors the Lance Namespace `DeleteTableTagResponse` schema.
type DeregisterTableRequest ¶
type DeregisterTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
}
DeregisterTableRequest mirrors the Lance Namespace `DeregisterTableRequest` schema.
type DeregisterTableResponse ¶
type DeregisterTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
ID *[]string `json:"id,omitempty"`
Location *string `json:"location,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
DeregisterTableResponse mirrors the Lance Namespace `DeregisterTableResponse` schema.
type DescribeNamespaceRequest ¶
type DescribeNamespaceRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
}
DescribeNamespaceRequest mirrors the Lance Namespace `DescribeNamespaceRequest` schema.
type DescribeNamespaceResponse ¶
type DescribeNamespaceResponse struct {
Context *map[string]string `json:"context,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
DescribeNamespaceResponse mirrors the Lance Namespace `DescribeNamespaceResponse` schema.
type DescribeTableIndexStatsRequest ¶
type DescribeTableIndexStatsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
Branch *string `json:"branch,omitempty"`
IndexName *string `json:"index_name,omitempty"`
}
DescribeTableIndexStatsRequest mirrors the Lance Namespace `DescribeTableIndexStatsRequest` schema.
type DescribeTableIndexStatsResponse ¶
type DescribeTableIndexStatsResponse struct {
Context *map[string]string `json:"context,omitempty"`
DistanceType *string `json:"distance_type,omitempty"`
IndexType *string `json:"index_type,omitempty"`
NumIndexedRows *int64 `json:"num_indexed_rows,omitempty"`
NumUnindexedRows *int64 `json:"num_unindexed_rows,omitempty"`
NumIndices *int32 `json:"num_indices,omitempty"`
}
DescribeTableIndexStatsResponse mirrors the Lance Namespace `DescribeTableIndexStatsResponse` schema.
type DescribeTableRequest ¶
type DescribeTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
Tag *string `json:"tag,omitempty"`
Branch *string `json:"branch,omitempty"`
WithTableURI *bool `json:"with_table_uri,omitempty"`
LoadDetailedMetadata *bool `json:"load_detailed_metadata,omitempty"`
CheckDeclared *bool `json:"check_declared,omitempty"`
VendCredentials *bool `json:"vend_credentials,omitempty"`
}
DescribeTableRequest mirrors the Lance Namespace `DescribeTableRequest` schema.
type DescribeTableResponse ¶
type DescribeTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
Table *string `json:"table,omitempty"`
Namespace *[]string `json:"namespace,omitempty"`
Version *int64 `json:"version,omitempty"`
Location *string `json:"location,omitempty"`
TableURI *string `json:"table_uri,omitempty"`
Schema *JsonArrowSchema `json:"schema,omitempty"`
StorageOptions *map[string]string `json:"storage_options,omitempty"`
Stats *TableBasicStats `json:"stats,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
ManagedVersioning *bool `json:"managed_versioning,omitempty"`
IsOnlyDeclared *bool `json:"is_only_declared,omitempty"`
}
DescribeTableResponse mirrors the Lance Namespace `DescribeTableResponse` schema.
type DescribeTableVersionRequest ¶
type DescribeTableVersionRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
Branch *string `json:"branch,omitempty"`
}
DescribeTableVersionRequest mirrors the Lance Namespace `DescribeTableVersionRequest` schema.
type DescribeTableVersionResponse ¶
type DescribeTableVersionResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version TableVersion `json:"version"`
}
DescribeTableVersionResponse mirrors the Lance Namespace `DescribeTableVersionResponse` schema.
type DescribeTransactionRequest ¶
type DescribeTransactionRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
}
DescribeTransactionRequest mirrors the Lance Namespace `DescribeTransactionRequest` schema.
type DescribeTransactionResponse ¶
type DescribeTransactionResponse struct {
Context *map[string]string `json:"context,omitempty"`
Status string `json:"status"`
Properties *map[string]string `json:"properties,omitempty"`
}
DescribeTransactionResponse mirrors the Lance Namespace `DescribeTransactionResponse` schema.
type DropNamespaceRequest ¶
type DropNamespaceRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Mode *string `json:"mode,omitempty"`
Behavior *string `json:"behavior,omitempty"`
}
DropNamespaceRequest mirrors the Lance Namespace `DropNamespaceRequest` schema.
type DropNamespaceResponse ¶
type DropNamespaceResponse struct {
Context *map[string]string `json:"context,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
TransactionID *[]string `json:"transaction_id,omitempty"`
}
DropNamespaceResponse mirrors the Lance Namespace `DropNamespaceResponse` schema.
type DropTableIndexRequest ¶
type DropTableIndexRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
IndexName *string `json:"index_name,omitempty"`
}
DropTableIndexRequest mirrors the Lance Namespace `DropTableIndexRequest` schema.
type DropTableIndexResponse ¶
type DropTableIndexResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
DropTableIndexResponse mirrors the Lance Namespace `DropTableIndexResponse` schema.
type DropTableRequest ¶
type DropTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
}
DropTableRequest mirrors the Lance Namespace `DropTableRequest` schema.
type DropTableResponse ¶
type DropTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
ID *[]string `json:"id,omitempty"`
Location *string `json:"location,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
DropTableResponse mirrors the Lance Namespace `DropTableResponse` schema.
type DynamicContextProvider ¶
type DynamicContextProvider interface {
ProvideContext(operation, objectID string) (map[string]string, error)
}
DynamicContextProvider supplies request context for a native namespace operation. The native implementation calls it synchronously before routing the operation, possibly from multiple namespace operations concurrently. A provider error is logged by native code and the request continues with an empty context. A provider must not synchronously close the namespace whose operation invoked it, or call Shutdown or Close on the REST adapter serving that request: those operations wait for the current request to finish.
type Error ¶ added in v0.3.0
Error reports an operation error produced by the native namespace.
Unwrap exposes the matching category sentinel, so errors.Is works without unpacking the value. The namespace code space is distinct from the lance-c code space reported by NativeError.
type ErrorCode ¶ added in v0.3.0
type ErrorCode uint32
ErrorCode is the error code reported by the native namespace.
const ( ErrorCodeUnsupported ErrorCode = 0 ErrorCodeNamespaceNotFound ErrorCode = 1 ErrorCodeNamespaceAlreadyExists ErrorCode = 2 ErrorCodeNamespaceNotEmpty ErrorCode = 3 ErrorCodeTableNotFound ErrorCode = 4 ErrorCodeTableAlreadyExists ErrorCode = 5 ErrorCodeTableIndexNotFound ErrorCode = 6 ErrorCodeTableIndexAlreadyExists ErrorCode = 7 ErrorCodeTableTagNotFound ErrorCode = 8 ErrorCodeTableTagAlreadyExists ErrorCode = 9 ErrorCodeTransactionNotFound ErrorCode = 10 ErrorCodeTableVersionNotFound ErrorCode = 11 ErrorCodeTableColumnNotFound ErrorCode = 12 ErrorCodeInvalidInput ErrorCode = 13 ErrorCodeConcurrentModification ErrorCode = 14 ErrorCodePermissionDenied ErrorCode = 15 ErrorCodeUnauthenticated ErrorCode = 16 ErrorCodeInternal ErrorCode = 18 ErrorCodeInvalidTableState ErrorCode = 19 ErrorCodeTableSchemaValidationError ErrorCode = 20 ErrorCodeThrottling ErrorCode = 21 ErrorCodeTableBranchNotFound ErrorCode = 22 ErrorCodeTableBranchAlreadyExists ErrorCode = 23 )
Native namespace error codes. Unsupported is zero and is still an error.
type ErrorResponse ¶
type ErrorResponse struct {
Context *map[string]string `json:"context,omitempty"`
Error *string `json:"error,omitempty"`
Code int32 `json:"code"`
Detail *string `json:"detail,omitempty"`
Instance *string `json:"instance,omitempty"`
}
ErrorResponse mirrors the Lance Namespace `ErrorResponse` schema.
type ExplainTableQueryPlanRequest ¶
type ExplainTableQueryPlanRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Query QueryTableRequest `json:"query"`
Verbose *bool `json:"verbose,omitempty"`
}
ExplainTableQueryPlanRequest mirrors the Lance Namespace `ExplainTableQueryPlanRequest` schema.
type ExplainTableQueryPlanResponse ¶
type ExplainTableQueryPlanResponse struct {
Context *map[string]string `json:"context,omitempty"`
Plan string `json:"plan"`
}
ExplainTableQueryPlanResponse mirrors the Lance Namespace `ExplainTableQueryPlanResponse` schema.
type FragmentStats ¶
type FragmentStats struct {
NumFragments int64 `json:"num_fragments"`
NumSmallFragments int64 `json:"num_small_fragments"`
Lengths FragmentSummary `json:"lengths"`
}
FragmentStats mirrors the Lance Namespace `FragmentStats` schema.
type FragmentSummary ¶
type FragmentSummary struct {
Min int64 `json:"min"`
Max int64 `json:"max"`
Mean int64 `json:"mean"`
P25 int64 `json:"p25"`
P50 int64 `json:"p50"`
P75 int64 `json:"p75"`
P99 int64 `json:"p99"`
}
FragmentSummary mirrors the Lance Namespace `FragmentSummary` schema.
type FtsQuery ¶
type FtsQuery struct {
Match *MatchQuery `json:"match,omitempty"`
Phrase *PhraseQuery `json:"phrase,omitempty"`
Boost *BoostQuery `json:"boost,omitempty"`
MultiMatch *MultiMatchQuery `json:"multi_match,omitempty"`
Boolean *BooleanQuery `json:"boolean,omitempty"`
}
FtsQuery mirrors the Lance Namespace `FtsQuery` schema.
type GetTableStatsRequest ¶
type GetTableStatsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
}
GetTableStatsRequest mirrors the Lance Namespace `GetTableStatsRequest` schema.
type GetTableStatsResponse ¶
type GetTableStatsResponse struct {
Context *map[string]string `json:"context,omitempty"`
TotalBytes int64 `json:"total_bytes"`
NumRows int64 `json:"num_rows"`
NumIndices int64 `json:"num_indices"`
FragmentStats FragmentStats `json:"fragment_stats"`
}
GetTableStatsResponse mirrors the Lance Namespace `GetTableStatsResponse` schema.
type GetTableTagVersionRequest ¶
type GetTableTagVersionRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Tag string `json:"tag"`
}
GetTableTagVersionRequest mirrors the Lance Namespace `GetTableTagVersionRequest` schema.
type GetTableTagVersionResponse ¶
type GetTableTagVersionResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
}
GetTableTagVersionResponse mirrors the Lance Namespace `GetTableTagVersionResponse` schema.
type Identity ¶
type Identity struct {
APIKey *string `json:"api_key,omitempty"`
AuthToken *string `json:"auth_token,omitempty"`
}
Identity mirrors the Lance Namespace `Identity` schema.
type IndexContent ¶
type IndexContent struct {
IndexName string `json:"index_name"`
IndexUUID string `json:"index_uuid"`
Columns []string `json:"columns"`
Status string `json:"status"`
IndexType *string `json:"index_type,omitempty"`
TypeURL *string `json:"type_url,omitempty"`
NumIndexedRows *int64 `json:"num_indexed_rows,omitempty"`
NumUnindexedRows *int64 `json:"num_unindexed_rows,omitempty"`
SizeBytes *int64 `json:"size_bytes,omitempty"`
NumSegments *int32 `json:"num_segments,omitempty"`
CreatedAt *string `json:"created_at,omitempty"`
IndexVersion *int32 `json:"index_version,omitempty"`
IndexDetails *string `json:"index_details,omitempty"`
}
IndexContent mirrors the Lance Namespace `IndexContent` schema.
type InsertIntoTableRequest ¶
type InsertIntoTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Mode *string `json:"mode,omitempty"`
}
InsertIntoTableRequest mirrors the Lance Namespace `InsertIntoTableRequest` schema.
type InsertIntoTableResponse ¶
type InsertIntoTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
NumInsertedRows *int64 `json:"num_inserted_rows,omitempty"`
Version *int64 `json:"version,omitempty"`
}
InsertIntoTableResponse mirrors the Lance Namespace `InsertIntoTableResponse` schema.
type JsonArrowDataType ¶
type JsonArrowDataType struct {
Fields *[]JsonArrowField `json:"fields,omitempty"`
Length *int64 `json:"length,omitempty"`
Type string `json:"type"`
}
JsonArrowDataType mirrors the Lance Namespace `JsonArrowDataType` schema.
type JsonArrowField ¶
type JsonArrowField struct {
Metadata *map[string]string `json:"metadata,omitempty"`
Name string `json:"name"`
Nullable bool `json:"nullable"`
Type JsonArrowDataType `json:"type"`
}
JsonArrowField mirrors the Lance Namespace `JsonArrowField` schema.
type JsonArrowSchema ¶
type JsonArrowSchema struct {
Fields []JsonArrowField `json:"fields"`
Metadata *map[string]string `json:"metadata,omitempty"`
}
JsonArrowSchema mirrors the Lance Namespace `JsonArrowSchema` schema.
type ListNamespacesRequest ¶
type ListNamespacesRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
}
ListNamespacesRequest mirrors the Lance Namespace `ListNamespacesRequest` schema.
type ListNamespacesResponse ¶
type ListNamespacesResponse struct {
Context *map[string]string `json:"context,omitempty"`
Namespaces []string `json:"namespaces"`
PageToken *string `json:"page_token,omitempty"`
}
ListNamespacesResponse mirrors the Lance Namespace `ListNamespacesResponse` schema.
type ListTableBranchesRequest ¶
type ListTableBranchesRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
}
ListTableBranchesRequest mirrors the Lance Namespace `ListTableBranchesRequest` schema.
type ListTableBranchesResponse ¶
type ListTableBranchesResponse struct {
Context *map[string]string `json:"context,omitempty"`
Branches map[string]BranchContents `json:"branches"`
PageToken *string `json:"page_token,omitempty"`
}
ListTableBranchesResponse mirrors the Lance Namespace `ListTableBranchesResponse` schema.
type ListTableIndicesRequest ¶
type ListTableIndicesRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
Branch *string `json:"branch,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
}
ListTableIndicesRequest mirrors the Lance Namespace `ListTableIndicesRequest` schema.
type ListTableIndicesResponse ¶
type ListTableIndicesResponse struct {
Context *map[string]string `json:"context,omitempty"`
Indexes []IndexContent `json:"indexes"`
PageToken *string `json:"page_token,omitempty"`
}
ListTableIndicesResponse mirrors the Lance Namespace `ListTableIndicesResponse` schema.
type ListTableTagsRequest ¶
type ListTableTagsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
}
ListTableTagsRequest mirrors the Lance Namespace `ListTableTagsRequest` schema.
type ListTableTagsResponse ¶
type ListTableTagsResponse struct {
Context *map[string]string `json:"context,omitempty"`
Tags map[string]TagContents `json:"tags"`
PageToken *string `json:"page_token,omitempty"`
}
ListTableTagsResponse mirrors the Lance Namespace `ListTableTagsResponse` schema.
type ListTableVersionsRequest ¶
type ListTableVersionsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
Descending *bool `json:"descending,omitempty"`
}
ListTableVersionsRequest mirrors the Lance Namespace `ListTableVersionsRequest` schema.
type ListTableVersionsResponse ¶
type ListTableVersionsResponse struct {
Context *map[string]string `json:"context,omitempty"`
Versions []TableVersion `json:"versions"`
PageToken *string `json:"page_token,omitempty"`
}
ListTableVersionsResponse mirrors the Lance Namespace `ListTableVersionsResponse` schema.
type ListTablesRequest ¶
type ListTablesRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
PageToken *string `json:"page_token,omitempty"`
Limit *int32 `json:"limit,omitempty"`
IncludeDeclared *bool `json:"include_declared,omitempty"`
}
ListTablesRequest mirrors the Lance Namespace `ListTablesRequest` schema.
type ListTablesResponse ¶
type ListTablesResponse struct {
Context *map[string]string `json:"context,omitempty"`
Tables []string `json:"tables"`
PageToken *string `json:"page_token,omitempty"`
}
ListTablesResponse mirrors the Lance Namespace `ListTablesResponse` schema.
type MatchQuery ¶
type MatchQuery struct {
Boost *float32 `json:"boost,omitempty"`
Column *string `json:"column,omitempty"`
Fuzziness *int32 `json:"fuzziness,omitempty"`
MaxExpansions *int32 `json:"max_expansions,omitempty"`
Operator *string `json:"operator,omitempty"`
PrefixLength *int32 `json:"prefix_length,omitempty"`
Terms string `json:"terms"`
}
MatchQuery mirrors the Lance Namespace `MatchQuery` schema.
type MaterializedViewUdtfEntry ¶
type MaterializedViewUdtfEntry struct {
Kind MaterializedViewUdtfKind `json:"kind"`
UDTF string `json:"udtf"`
UDTFSHA string `json:"udtf_sha"`
UDTFName string `json:"udtf_name"`
UDTFVersion string `json:"udtf_version"`
InputColumns Nullable[[]string] `json:"input_columns,omitzero"`
PartitionBy Nullable[string] `json:"partition_by,omitzero"`
PartitionByIndexedColumn Nullable[string] `json:"partition_by_indexed_column,omitzero"`
NumCpus Nullable[float64] `json:"num_cpus,omitzero"`
NumGpus Nullable[float64] `json:"num_gpus,omitzero"`
Memory Nullable[int32] `json:"memory,omitzero"`
ErrorHandling Nullable[any] `json:"error_handling,omitzero"`
Batch Nullable[bool] `json:"batch,omitzero"`
Manifest Nullable[string] `json:"manifest,omitzero"`
ManifestChecksum Nullable[string] `json:"manifest_checksum,omitzero"`
}
MaterializedViewUdtfEntry mirrors the Lance Namespace `MaterializedViewUdtfEntry` schema.
func (*MaterializedViewUdtfEntry) UnmarshalJSON ¶
func (v *MaterializedViewUdtfEntry) UnmarshalJSON(data []byte) error
type MaterializedViewUdtfKind ¶
type MaterializedViewUdtfKind string
MaterializedViewUdtfKind identifies the native UDTF kind for a materialized view UDTF entry.
const ( MaterializedViewUdtfKindUDTF MaterializedViewUdtfKind = "udtf" MaterializedViewUdtfKindChunker MaterializedViewUdtfKind = "chunker" )
type MergeInsertIntoTableRequest ¶
type MergeInsertIntoTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
On *[]string `json:"on,omitempty"`
WhenMatchedUpdateAll *bool `json:"when_matched_update_all,omitempty"`
WhenMatchedUpdateAllFilt *string `json:"when_matched_update_all_filt,omitempty"`
WhenNotMatchedInsertAll *bool `json:"when_not_matched_insert_all,omitempty"`
WhenNotMatchedBySourceDelete *bool `json:"when_not_matched_by_source_delete,omitempty"`
WhenNotMatchedBySourceDeleteFilt *string `json:"when_not_matched_by_source_delete_filt,omitempty"`
Timeout *string `json:"timeout,omitempty"`
UseIndex *bool `json:"use_index,omitempty"`
}
MergeInsertIntoTableRequest mirrors the Lance Namespace `MergeInsertIntoTableRequest` schema.
type MergeInsertIntoTableResponse ¶
type MergeInsertIntoTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
NumUpdatedRows *int64 `json:"num_updated_rows,omitempty"`
NumInsertedRows *int64 `json:"num_inserted_rows,omitempty"`
NumDeletedRows *int64 `json:"num_deleted_rows,omitempty"`
Version *int64 `json:"version,omitempty"`
}
MergeInsertIntoTableResponse mirrors the Lance Namespace `MergeInsertIntoTableResponse` schema.
type MultiMatchQuery ¶
type MultiMatchQuery struct {
MatchQueries []MatchQuery `json:"match_queries"`
}
MultiMatchQuery mirrors the Lance Namespace `MultiMatchQuery` schema.
type Namespace ¶
type Namespace interface {
// ID returns the native namespace identifier.
ID() (string, error)
// OpsMetrics returns native operation metrics. Directory and REST
// namespaces support metrics; other implementations may return a native
// unsupported error.
OpsMetrics() (map[string]uint64, error)
// ResetOpsMetrics resets native operation metrics.
ResetOpsMetrics() error
// Close releases the native namespace. It waits for in-flight calls and is
// idempotent.
Close() error
// StartRESTAdapter starts a native REST adapter over this namespace. The
// adapter owns an independent native lifetime.
StartRESTAdapter(host string, port uint16) (*RESTAdapter, error)
ListNamespaces(ctx context.Context, request *ListNamespacesRequest) (*ListNamespacesResponse, error)
DescribeNamespace(ctx context.Context, request *DescribeNamespaceRequest) (*DescribeNamespaceResponse, error)
CreateNamespace(ctx context.Context, request *CreateNamespaceRequest) (*CreateNamespaceResponse, error)
DropNamespace(ctx context.Context, request *DropNamespaceRequest) (*DropNamespaceResponse, error)
NamespaceExists(ctx context.Context, request *NamespaceExistsRequest) error
ListTables(ctx context.Context, request *ListTablesRequest) (*ListTablesResponse, error)
DescribeTable(ctx context.Context, request *DescribeTableRequest) (*DescribeTableResponse, error)
RegisterTable(ctx context.Context, request *RegisterTableRequest) (*RegisterTableResponse, error)
TableExists(ctx context.Context, request *TableExistsRequest) error
DropTable(ctx context.Context, request *DropTableRequest) (*DropTableResponse, error)
DeregisterTable(ctx context.Context, request *DeregisterTableRequest) (*DeregisterTableResponse, error)
CountTableRows(ctx context.Context, request *CountTableRowsRequest) (int64, error)
CreateTable(ctx context.Context, request *CreateTableRequest, payload []byte) (*CreateTableResponse, error)
DeclareTable(ctx context.Context, request *DeclareTableRequest) (*DeclareTableResponse, error)
InsertIntoTable(ctx context.Context, request *InsertIntoTableRequest, payload []byte) (*InsertIntoTableResponse, error)
MergeInsertIntoTable(ctx context.Context, request *MergeInsertIntoTableRequest, payload []byte) (*MergeInsertIntoTableResponse, error)
UpdateTable(ctx context.Context, request *UpdateTableRequest) (*UpdateTableResponse, error)
DeleteFromTable(ctx context.Context, request *DeleteFromTableRequest) (*DeleteFromTableResponse, error)
QueryTable(ctx context.Context, request *QueryTableRequest) (*QueryTableResponse, error)
CreateTableIndex(ctx context.Context, request *CreateTableIndexRequest) (*CreateTableIndexResponse, error)
ListTableIndices(ctx context.Context, request *ListTableIndicesRequest) (*ListTableIndicesResponse, error)
DescribeTableIndexStats(ctx context.Context, request *DescribeTableIndexStatsRequest) (*DescribeTableIndexStatsResponse, error)
DescribeTransaction(ctx context.Context, request *DescribeTransactionRequest) (*DescribeTransactionResponse, error)
AlterTransaction(ctx context.Context, request *AlterTransactionRequest) (*AlterTransactionResponse, error)
CreateTableScalarIndex(ctx context.Context, request *CreateTableIndexRequest) (*CreateTableScalarIndexResponse, error)
DropTableIndex(ctx context.Context, request *DropTableIndexRequest) (*DropTableIndexResponse, error)
ListAllTables(ctx context.Context, request *ListTablesRequest) (*ListTablesResponse, error)
RestoreTable(ctx context.Context, request *RestoreTableRequest) (*RestoreTableResponse, error)
RenameTable(ctx context.Context, request *RenameTableRequest) (*RenameTableResponse, error)
ListTableVersions(ctx context.Context, request *ListTableVersionsRequest) (*ListTableVersionsResponse, error)
CreateTableVersion(ctx context.Context, request *CreateTableVersionRequest) (*CreateTableVersionResponse, error)
DescribeTableVersion(ctx context.Context, request *DescribeTableVersionRequest) (*DescribeTableVersionResponse, error)
BatchDeleteTableVersions(ctx context.Context, request *BatchDeleteTableVersionsRequest) (*BatchDeleteTableVersionsResponse, error)
BatchCreateTableVersions(ctx context.Context, request *BatchCreateTableVersionsRequest) (*BatchCreateTableVersionsResponse, error)
BatchCommitTables(ctx context.Context, request *BatchCommitTablesRequest) (*BatchCommitTablesResponse, error)
UpdateTableSchemaMetadata(ctx context.Context, request *UpdateTableSchemaMetadataRequest) (*UpdateTableSchemaMetadataResponse, error)
UpdateFieldMetadata(ctx context.Context, request *UpdateFieldMetadataRequest) (*UpdateFieldMetadataResponse, error)
GetTableStats(ctx context.Context, request *GetTableStatsRequest) (*GetTableStatsResponse, error)
ExplainTableQueryPlan(ctx context.Context, request *ExplainTableQueryPlanRequest) (string, error)
AnalyzeTableQueryPlan(ctx context.Context, request *AnalyzeTableQueryPlanRequest) (string, error)
AlterTableAddColumns(ctx context.Context, request *AlterTableAddColumnsRequest) (*AlterTableAddColumnsResponse, error)
AlterTableAlterColumns(ctx context.Context, request *AlterTableAlterColumnsRequest) (*AlterTableAlterColumnsResponse, error)
AlterTableDropColumns(ctx context.Context, request *AlterTableDropColumnsRequest) (*AlterTableDropColumnsResponse, error)
AlterTableBackfillColumns(ctx context.Context, request *AlterTableBackfillColumnsRequest) (*AlterTableBackfillColumnsResponse, error)
RefreshMaterializedView(ctx context.Context, request *RefreshMaterializedViewRequest) (*RefreshMaterializedViewResponse, error)
CreateMaterializedView(ctx context.Context, request *CreateMaterializedViewRequest) (*CreateMaterializedViewResponse, error)
ListTableTags(ctx context.Context, request *ListTableTagsRequest) (*ListTableTagsResponse, error)
GetTableTagVersion(ctx context.Context, request *GetTableTagVersionRequest) (*GetTableTagVersionResponse, error)
CreateTableTag(ctx context.Context, request *CreateTableTagRequest) (*CreateTableTagResponse, error)
DeleteTableTag(ctx context.Context, request *DeleteTableTagRequest) (*DeleteTableTagResponse, error)
UpdateTableTag(ctx context.Context, request *UpdateTableTagRequest) (*UpdateTableTagResponse, error)
CreateTableBranch(ctx context.Context, request *CreateTableBranchRequest) (*CreateTableBranchResponse, error)
ListTableBranches(ctx context.Context, request *ListTableBranchesRequest) (*ListTableBranchesResponse, error)
DeleteTableBranch(ctx context.Context, request *DeleteTableBranchRequest) (*DeleteTableBranchResponse, error)
// contains filtered or unexported methods
}
Namespace is a sealed native Lance namespace. Use NewDirectory, NewRest, NewConnect, or NewCustom to construct one.
func NewConnect ¶
NewConnect creates a namespace implemented by a native Lance Connect plugin.
func NewCustom ¶
func NewCustom(client CustomClient, namespaceID string) (Namespace, error)
NewCustom creates a namespace backed by a Go CustomClient.
Native code dispatches only DescribeTable, ListTableVersions, CreateTableVersion, and DescribeTableVersion to the client. Every other namespace operation returns the native unsupported error. The namespace retains the client until native code drops the final owner; NewCustom does not close the client, so the caller remains responsible for its resources.
The client is called synchronously from the native caller's goroutine. context.Context values are not propagated because the dispatch callback has no context field. Use independent namespace or dataset handles for calls made from a callback; a mutating dataset handle is not reentrant. A callback must not close the namespace or REST adapter serving its current request, because their shutdown waits for in-flight callbacks.
func NewDirectory ¶
NewDirectory creates a directory-backed namespace.
Example ¶
This example manages namespaces through a local Directory namespace. Directory rejects a nil ID, so pass an explicit empty slice to address the root namespace.
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/lance-format/lance-go/namespace"
)
func main() {
ctx := context.Background()
root, err := os.MkdirTemp("", "lance-go-catalog-")
if err != nil {
log.Fatal(err)
}
defer os.RemoveAll(root)
ns, err := namespace.NewDirectory(map[string]string{"root": root})
if err != nil {
log.Fatal(err)
}
defer ns.Close()
rootID := []string{}
before, err := ns.ListNamespaces(ctx, &namespace.ListNamespacesRequest{ID: &rootID})
if err != nil {
log.Fatal(err)
}
fmt.Println("before:", before.Namespaces)
eventsID := []string{"events"}
mode := "create"
if _, err := ns.CreateNamespace(ctx, &namespace.CreateNamespaceRequest{
ID: &eventsID,
Mode: &mode,
}); err != nil {
log.Fatal(err)
}
if err := ns.NamespaceExists(ctx, &namespace.NamespaceExistsRequest{ID: &eventsID}); err != nil {
log.Fatal(err)
}
fmt.Println("events exists")
after, err := ns.ListNamespaces(ctx, &namespace.ListNamespacesRequest{ID: &rootID})
if err != nil {
log.Fatal(err)
}
fmt.Println("after:", after.Namespaces)
if _, err := ns.DropNamespace(ctx, &namespace.DropNamespaceRequest{ID: &eventsID}); err != nil {
log.Fatal(err)
}
}
Output: before: [] events exists after: [events]
type NamespaceError
deprecated
type NamespaceError = Error
NamespaceError is the pre-v0.3.0 name of Error.
Deprecated: use Error. The alias names the same type, so existing errors.As targets and composite literals keep working.
type NamespaceErrorCode
deprecated
type NamespaceErrorCode = ErrorCode
NamespaceErrorCode is the pre-v0.3.0 name of ErrorCode.
Deprecated: use ErrorCode. The alias names the same type, so existing errors.As targets and composite literals keep working.
type NamespaceExistsRequest ¶
type NamespaceExistsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
}
NamespaceExistsRequest mirrors the Lance Namespace `NamespaceExistsRequest` schema.
type NamespaceExistsResponse ¶
NamespaceExistsResponse mirrors the Lance Namespace `NamespaceExistsResponse` schema.
type NativeError ¶
NativeError reports a non-namespace native error, such as an invalid argument or a panic caught by the C API. Its Code is a lance-c LanceErrorCode, not a namespace code.
func (*NativeError) Error ¶
func (e *NativeError) Error() string
type Nullable ¶
Nullable represents a field that distinguishes an absent value, an explicit JSON null, and a concrete value. It mirrors Rust's Option<Option<T>> with serde double_option.
The zero value is absent and is omitted when encoding. Present marks the remaining two states: a nil Value encodes as JSON null and a non-nil Value encodes as the value, including a zero value or an empty slice or map. Build fields with Some, Null and Absent so Present and Value stay consistent.
func Some ¶ added in v0.3.0
Some returns a present Nullable that encodes value, including a zero value or an empty slice or map.
func (Nullable[T]) IsZero ¶ added in v0.3.0
IsZero reports whether the field is absent. encoding/json consults it through the omitzero tag option, so an absent field stays absent on the wire.
func (Nullable[T]) MarshalJSON ¶
MarshalJSON preserves an explicit null instead of omitting the field.
func (*Nullable[T]) UnmarshalJSON ¶
UnmarshalJSON records both JSON null and a concrete value as present. The receiver keeps its previous state when decoding fails.
type Option ¶
type Option func(*config) error
Option configures a namespace constructor.
func WithDynamicContextProvider ¶
func WithDynamicContextProvider(provider DynamicContextProvider) Option
WithDynamicContextProvider installs a provider for dynamic request context. A nil provider is rejected.
type PartitionField ¶
type PartitionField struct {
FieldID string `json:"field_id"`
SourceIds []int32 `json:"source_ids"`
Transform *PartitionTransform `json:"transform,omitempty"`
Expression *string `json:"expression,omitempty"`
ResultType JsonArrowDataType `json:"result_type"`
}
PartitionField mirrors the Lance Namespace `PartitionField` schema.
type PartitionSpec ¶
type PartitionSpec struct {
ID int32 `json:"id"`
Fields []PartitionField `json:"fields"`
}
PartitionSpec mirrors the Lance Namespace `PartitionSpec` schema.
type PartitionTransform ¶
type PartitionTransform struct {
Type string `json:"type"`
NumBuckets *int32 `json:"num_buckets,omitempty"`
Width *int32 `json:"width,omitempty"`
}
PartitionTransform mirrors the Lance Namespace `PartitionTransform` schema.
type PhraseQuery ¶
type PhraseQuery struct {
Column *string `json:"column,omitempty"`
Slop *int32 `json:"slop,omitempty"`
Terms string `json:"terms"`
}
PhraseQuery mirrors the Lance Namespace `PhraseQuery` schema.
type ProtocolError ¶
ProtocolError reports a malformed native response or an unencodable request.
func (*ProtocolError) Error ¶
func (e *ProtocolError) Error() string
func (*ProtocolError) Unwrap ¶
func (e *ProtocolError) Unwrap() error
type QueryTableRequest ¶
type QueryTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
BypassVectorIndex *bool `json:"bypass_vector_index,omitempty"`
Columns *QueryTableRequestColumns `json:"columns,omitempty"`
DistanceType *string `json:"distance_type,omitempty"`
Ef *int32 `json:"ef,omitempty"`
FastSearch *bool `json:"fast_search,omitempty"`
Filter *string `json:"filter,omitempty"`
FullTextQuery *QueryTableRequestFullTextQuery `json:"full_text_query,omitempty"`
K int32 `json:"k"`
LowerBound *float32 `json:"lower_bound,omitempty"`
MaximumNprobes *int32 `json:"maximum_nprobes,omitempty"`
MinimumNprobes *int32 `json:"minimum_nprobes,omitempty"`
Nprobes *int32 `json:"nprobes,omitempty"`
Offset *int32 `json:"offset,omitempty"`
Prefilter *bool `json:"prefilter,omitempty"`
RefineFactor *int32 `json:"refine_factor,omitempty"`
UpperBound *float32 `json:"upper_bound,omitempty"`
Vector QueryTableRequestVector `json:"vector"`
VectorColumn *string `json:"vector_column,omitempty"`
Version *int64 `json:"version,omitempty"`
WithRowID *bool `json:"with_row_id,omitempty"`
}
QueryTableRequest mirrors the Lance Namespace `QueryTableRequest` schema.
type QueryTableRequestColumns ¶
type QueryTableRequestColumns struct {
ColumnNames *[]string `json:"column_names,omitempty"`
ColumnAliases *map[string]string `json:"column_aliases,omitempty"`
}
QueryTableRequestColumns mirrors the Lance Namespace `QueryTableRequestColumns` schema.
type QueryTableRequestFullTextQuery ¶
type QueryTableRequestFullTextQuery struct {
StringQuery *StringFtsQuery `json:"string_query,omitempty"`
StructuredQuery *StructuredFtsQuery `json:"structured_query,omitempty"`
}
QueryTableRequestFullTextQuery mirrors the Lance Namespace `QueryTableRequestFullTextQuery` schema.
type QueryTableRequestVector ¶
type QueryTableRequestVector struct {
SingleVector *[]float32 `json:"single_vector,omitempty"`
MultiVector *[][]float32 `json:"multi_vector,omitempty"`
}
QueryTableRequestVector mirrors the Lance Namespace `QueryTableRequestVector` schema.
type QueryTableResponse ¶
type QueryTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
Data *[]byte `json:"data,omitempty"`
}
QueryTableResponse mirrors the Lance Namespace `QueryTableResponse` schema.
type RESTAdapter ¶
type RESTAdapter struct {
// contains filtered or unexported fields
}
RESTAdapter serves a namespace over the native REST adapter. It owns an independent native handle, so closing the namespace does not close it.
func (*RESTAdapter) Close ¶
func (a *RESTAdapter) Close() error
Close waits for in-flight calls and releases the native adapter. It must not be called from a dynamic provider handling a request on this adapter.
func (*RESTAdapter) Port ¶
func (a *RESTAdapter) Port() (uint16, error)
Port returns the bound adapter port.
func (*RESTAdapter) Shutdown ¶
func (a *RESTAdapter) Shutdown()
Shutdown stops serving and is idempotent. It waits for active requests and must not be called from a dynamic provider handling one of those requests.
type RefreshMaterializedViewRequest ¶
type RefreshMaterializedViewRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
SrcVersion Nullable[int32] `json:"src_version,omitzero"`
MaxRowsPerFragment Nullable[int32] `json:"max_rows_per_fragment,omitzero"`
Concurrency Nullable[int32] `json:"concurrency,omitzero"`
IntraApplierConcurrency Nullable[int32] `json:"intra_applier_concurrency,omitzero"`
SourceTaskSize Nullable[int32] `json:"source_task_size,omitzero"`
Cluster Nullable[string] `json:"cluster,omitzero"`
OutputLimit Nullable[int32] `json:"output_limit,omitzero"`
Manifest Nullable[string] `json:"manifest,omitzero"`
}
RefreshMaterializedViewRequest mirrors the Lance Namespace `RefreshMaterializedViewRequest` schema.
func (*RefreshMaterializedViewRequest) UnmarshalJSON ¶
func (v *RefreshMaterializedViewRequest) UnmarshalJSON(data []byte) error
type RefreshMaterializedViewResponse ¶
type RefreshMaterializedViewResponse struct {
Context *map[string]string `json:"context,omitempty"`
JobID string `json:"job_id"`
}
RefreshMaterializedViewResponse mirrors the Lance Namespace `RefreshMaterializedViewResponse` schema.
type RegisterTableRequest ¶
type RegisterTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Location string `json:"location"`
Mode *string `json:"mode,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
RegisterTableRequest mirrors the Lance Namespace `RegisterTableRequest` schema.
type RegisterTableResponse ¶
type RegisterTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
Location *string `json:"location,omitempty"`
Properties *map[string]string `json:"properties,omitempty"`
}
RegisterTableResponse mirrors the Lance Namespace `RegisterTableResponse` schema.
type RenameTableRequest ¶
type RenameTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
NewTableName string `json:"new_table_name"`
NewNamespaceID *[]string `json:"new_namespace_id,omitempty"`
}
RenameTableRequest mirrors the Lance Namespace `RenameTableRequest` schema.
type RenameTableResponse ¶
type RenameTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
RenameTableResponse mirrors the Lance Namespace `RenameTableResponse` schema.
type RestoreTableRequest ¶
type RestoreTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
}
RestoreTableRequest mirrors the Lance Namespace `RestoreTableRequest` schema.
type RestoreTableResponse ¶
type RestoreTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
RestoreTableResponse mirrors the Lance Namespace `RestoreTableResponse` schema.
type StringFtsQuery ¶
type StringFtsQuery struct {
Columns *[]string `json:"columns,omitempty"`
Query string `json:"query"`
}
StringFtsQuery mirrors the Lance Namespace `StringFtsQuery` schema.
type StructuredFtsQuery ¶
type StructuredFtsQuery struct {
Query FtsQuery `json:"query"`
}
StructuredFtsQuery mirrors the Lance Namespace `StructuredFtsQuery` schema.
type TableBasicStats ¶
type TableBasicStats struct {
NumDeletedRows int32 `json:"num_deleted_rows"`
NumFragments int32 `json:"num_fragments"`
}
TableBasicStats mirrors the Lance Namespace `TableBasicStats` schema.
type TableExistsRequest ¶
type TableExistsRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Version *int64 `json:"version,omitempty"`
}
TableExistsRequest mirrors the Lance Namespace `TableExistsRequest` schema.
type TableExistsResponse ¶
TableExistsResponse mirrors the Lance Namespace `TableExistsResponse` schema.
type TableVersion ¶
type TableVersion struct {
Version int64 `json:"version"`
ManifestPath string `json:"manifest_path"`
ManifestSize *int64 `json:"manifest_size,omitempty"`
ETag *string `json:"e_tag,omitempty"`
TimestampMillis *int64 `json:"timestamp_millis,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
}
TableVersion mirrors the Lance Namespace `TableVersion` schema.
type TagContents ¶
type TagContents struct {
Branch *string `json:"branch,omitempty"`
Version int64 `json:"version"`
ManifestSize int64 `json:"manifestSize"`
}
TagContents mirrors the Lance Namespace `TagContents` schema.
type UpdateFieldMetadataEntry ¶
type UpdateFieldMetadataEntry struct {
Path string `json:"path"`
Metadata map[string]string `json:"metadata"`
Replace Nullable[bool] `json:"replace,omitzero"`
}
UpdateFieldMetadataEntry mirrors the Lance Namespace `UpdateFieldMetadataEntry` schema.
func (*UpdateFieldMetadataEntry) UnmarshalJSON ¶
func (v *UpdateFieldMetadataEntry) UnmarshalJSON(data []byte) error
type UpdateFieldMetadataRequest ¶
type UpdateFieldMetadataRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Updates []UpdateFieldMetadataEntry `json:"updates"`
}
UpdateFieldMetadataRequest mirrors the Lance Namespace `UpdateFieldMetadataRequest` schema.
type UpdateFieldMetadataResponse ¶
type UpdateFieldMetadataResponse struct {
Context *map[string]string `json:"context,omitempty"`
Version int64 `json:"version"`
Fields *map[string]map[string]string `json:"fields,omitempty"`
}
UpdateFieldMetadataResponse mirrors the Lance Namespace `UpdateFieldMetadataResponse` schema.
type UpdateTableRequest ¶
type UpdateTableRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Predicate *string `json:"predicate,omitempty"`
Updates [][]string `json:"updates"`
Properties *map[string]string `json:"properties,omitempty"`
}
UpdateTableRequest mirrors the Lance Namespace `UpdateTableRequest` schema.
type UpdateTableResponse ¶
type UpdateTableResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
UpdatedRows int64 `json:"updated_rows"`
Version int64 `json:"version"`
Properties *map[string]string `json:"properties,omitempty"`
}
UpdateTableResponse mirrors the Lance Namespace `UpdateTableResponse` schema.
type UpdateTableSchemaMetadataRequest ¶
type UpdateTableSchemaMetadataRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Branch *string `json:"branch,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
}
UpdateTableSchemaMetadataRequest mirrors the Lance Namespace `UpdateTableSchemaMetadataRequest` schema.
type UpdateTableSchemaMetadataResponse ¶
type UpdateTableSchemaMetadataResponse struct {
Context *map[string]string `json:"context,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
UpdateTableSchemaMetadataResponse mirrors the Lance Namespace `UpdateTableSchemaMetadataResponse` schema.
type UpdateTableTagRequest ¶
type UpdateTableTagRequest struct {
Identity *Identity `json:"identity,omitempty"`
Context *map[string]string `json:"context,omitempty"`
ID *[]string `json:"id,omitempty"`
Tag string `json:"tag"`
Version int64 `json:"version"`
Branch *string `json:"branch,omitempty"`
}
UpdateTableTagRequest mirrors the Lance Namespace `UpdateTableTagRequest` schema.
type UpdateTableTagResponse ¶
type UpdateTableTagResponse struct {
Context *map[string]string `json:"context,omitempty"`
TransactionID *string `json:"transaction_id,omitempty"`
}
UpdateTableTagResponse mirrors the Lance Namespace `UpdateTableTagResponse` schema.
type VersionRange ¶
type VersionRange struct {
StartVersion int64 `json:"start_version"`
EndVersion int64 `json:"end_version"`
}
VersionRange mirrors the Lance Namespace `VersionRange` schema.