Lance C/C++ Bindings
C ABI and header-only C++ RAII wrappers for the Lance columnar data format
Loading...
Searching...
No Matches
lance Namespace Reference

Namespaces

namespace  callback_detail
 
namespace  commit_lock_detail
 
namespace  detail
 
namespace  file_detail
 
namespace  fragment_mutation_detail
 
namespace  namespace_detail
 
namespace  native_write_options_detail
 
namespace  storage_options_detail
 

Classes

struct  AddBasesOptions
 
class  ArrowSchemaOwner
 Move-only owner of an Arrow C Data Interface schema. More...
 
class  ArrowStream
 
struct  AutoCleanupParams
 
struct  BasePath
 
class  Batch
 
struct  BatchCommitResult
 
struct  BatchUDF
 
struct  BatchUDFInfo
 
struct  BatchUDFV2
 Schema-aware native BatchUDF declaration. More...
 
class  BlobDescriptorArrayBuilder
 
struct  BlobFieldOptions
 
class  BlobFile
 
struct  BlobRange
 One blob-relative byte range for BlobFile::read_ranges(). More...
 
struct  BlobRangeRequest
 One row-specific blob-range request for Dataset::read_blob_ranges(). More...
 
struct  BlobReadOptions
 
struct  BloomFilterValues
 Bloom-filter parameters of a key-existence filter. More...
 
class  ByteBuffer
 
struct  CleanupCandidateFile
 One copied cleanup candidate. More...
 
struct  CleanupExplanation
 Fully copied native CleanupExplanation. More...
 
struct  CleanupOldVersionsOptions
 Relative-duration inputs for Dataset::cleanup_old_versions. More...
 
struct  CleanupOperationOptions
 
struct  CleanupPolicy
 
struct  CleanupReferencedBranch
 One copied referenced child branch. More...
 
struct  CleanupTimestamp
 Whole seconds plus nanoseconds since the Unix epoch. More...
 
struct  ColumnAlteration
 
struct  ColumnOrdering
 One native scanner ordering key. Entries are applied in vector order. More...
 
struct  CommitDuration
 
class  CommitLease
 
class  CommitLock
 
struct  CommitOptions
 
struct  CompactedSsTable
 A compacted SSTable marker advanced atomically with a merge-insert commit. More...
 
class  CompactionOptions
 Presence-preserving owner of native CompactionOptions. More...
 
class  CompactionPlan
 Owned native compaction plan. More...
 
class  CompactionTask
 Owned snapshot of one native compaction task. More...
 
class  DataFile
 Owned native DataFile metadata snapshot. Move-only. More...
 
class  DataOverlayFile
 
class  DataOverlayGroup
 Owned native DataOverlayGroup snapshot. Move-only. More...
 
class  DataReplacementGroup
 Owned native DataReplacementGroup snapshot. Move-only. More...
 
class  Dataset
 
struct  DatasetBaseStoreParams
 
class  DatasetDelta
 
class  DatasetDeltaBuilder
 
struct  DatasetFileWriterOptions
 
struct  DatasetOpenOptions
 
class  DedicatedBlobWriter
 
class  DelimitedList
 
class  DynamicContextProvider
 
class  Error
 
class  ExecutionPlan
 Owned native execution plan. More...
 
struct  FieldMetadataUpdate
 
class  FieldReference
 
struct  FieldStatistics
 
struct  FileBufferDescriptor
 
struct  FileColumnMetadata
 
struct  FileColumnStatistics
 
struct  FileEncodingDescriptor
 
class  FileMetadata
 
struct  FileMetadataInfo
 
struct  FilePageMetadata
 
class  FileReader
 
struct  FileReaderOptions
 
struct  FileSchedulerConfig
 
class  FileSession
 
class  FileStatistics
 
struct  FileStoreInfo
 
class  FileWriter
 
struct  FileWriterOptions
 
struct  FileWriteSummary
 
class  Fragment
 
struct  FragmentCreateOptions
 
class  FragmentOverlayWriter
 
class  FragmentUpdateColumnsResult
 Move-only owner of a native FragmentUpdateColumnsResult. More...
 
struct  FragmentWriteProgressInfo
 Native fragment progress payload. More...
 
struct  FtsBoostOptions
 Options for FtsQuery::boost(). More...
 
struct  FtsCombinedFieldsOptions
 
struct  FtsMatchOptions
 
struct  FtsMultiMatchOptions
 
struct  FtsPhraseOptions
 Options for FtsQuery::phrase(). More...
 
class  FtsQuery
 
class  FtsQueryContext
 
struct  FtsToken
 One token produced by the native Lance analyzer chain. More...
 
class  FtsTokenList
 
class  Handle
 
struct  HnswParams
 Per-index HNSW build controls. More...
 
struct  IndexFile
 One index file recorded by a rewritten index. More...
 
class  IndexModel
 Move-only owner of an Arrow C Data Interface model array and schema. More...
 
struct  IndexPrewarmOptions
 
class  IndexSegmentBuilder
 Move-only builder for one uncommitted physical index segment. More...
 
struct  IndexSegmentFile
 One file recorded in an index segment's native metadata. More...
 
class  IndexSegmentMetadata
 Parsed metadata for one physical index segment. More...
 
class  IndexSegmentResult
 Owned native optimized index segment result. More...
 
struct  IndexTimestamp
 Whole seconds plus nanoseconds since the Unix epoch. More...
 
struct  IndexTrainerOptions
 Additive standalone IVF/PQ trainer controls. More...
 
class  IvfModel
 Move-only owner of a cloned native IVF model. More...
 
class  KeyExistenceFilter
 
class  LanceSchema
 
class  LsmPointLookupPlanner
 Owned native point-lookup planner. More...
 
class  LsmScanner
 Owned native LSM scanner. More...
 
class  LsmVectorSearchPlanner
 Owned native vector-search planner. More...
 
class  MemWalIndexDetails
 Owned copy of native MemWAL index details. More...
 
struct  MemWalInitOptions
 Options for Dataset::initialize_mem_wal. More...
 
class  Namespace
 Move-only namespace handle with native concrete-implementation retention. More...
 
class  NamespaceError
 
class  NamespaceResult
 
class  NativeWriteOptions
 
struct  NativeWriteOptionsSpec
 Configuration for an owned NativeWriteOptions handle. More...
 
struct  NativeWriteProgress
 
struct  NativeWriteStats
 Cumulative native write statistics. More...
 
class  Operation
 
class  OptimizeIndexMerge
 Owned snapshot of one native distributed index merge. More...
 
class  OptimizeIndexTask
 Owned snapshot of one native distributed index build task. More...
 
class  OptimizeIndicesOptions
 Presence-preserving owner of native OptimizeOptions. More...
 
class  OptimizeIndicesPlan
 Owned native distributed index optimization plan. More...
 
class  PackedBlobWriter
 
class  PathList
 
struct  ProcessIoCounters
 One read of both native process counters. More...
 
struct  ProjectionColumn
 One ordered scanner projection entry. output_name may be an alias. More...
 
class  Ref
 Owned native lance::dataset::refs::Ref. More...
 
struct  RemovalStats
 Copied native RemovalStats. More...
 
class  RestAdapter
 Move-only owner of a running native REST adapter. More...
 
class  RewriteGroup
 
class  RewriteResult
 Owned native compaction rewrite result. More...
 
class  RewrittenIndex
 Owned native RewrittenIndex. Move-only. More...
 
struct  ScalarIndexOptions
 Additive scalar-index build controls. More...
 
class  Scanner
 
class  Session
 
struct  SessionCacheSpec
 
class  ShardingField
 Owned native sharding field. More...
 
class  ShardingSpec
 Owned native sharding spec. More...
 
struct  ShardMemTableStats
 Snapshot of live MemTable and memory statistics. More...
 
class  ShardSnapshot
 Owned native shard snapshot. More...
 
class  ShardWriter
 Owned native shard writer. More...
 
class  ShardWriterConfig
 
struct  ShardWriteResult
 Native put/delete batch-position range. More...
 
struct  ShardWriterStats
 Snapshot of native shard-writer counters. More...
 
struct  SqlColumn
 
class  SqlQuery
 
class  SqlQueryBuilder
 
struct  SsTable
 One SSTable referenced by a shard snapshot. More...
 
class  StorageOptionsAccessor
 
class  StorageOptionsProvider
 
struct  Table
 One Arrow schema plus a materialized batch list. More...
 
struct  TagInfo
 
class  Transaction
 
struct  TransactionOptions
 
struct  UDFCheckpointStore
 
struct  UDFCheckpointStoreV2
 
struct  UncommittedWriteOptions
 
struct  UpdateConfigOptions
 
class  UpdatedFragmentOffsets
 
class  UpdateMap
 
struct  UpdateOperationSpec
 
struct  VectorIndexOptions
 
struct  VersionDetails
 A copied version snapshot with native-precision timestamp and metadata. More...
 
struct  VersionInfo
 
struct  WriteOptions
 
struct  WriteParams
 

Typedefs

using ConfigUpdate = std::pair<std::string, std::optional<std::string>>
 
using TrackedFilesProgressCallback
 
using BatchUDFMapper
 
using BatchUDFGetBatchV2
 
using StorageOptions = std::map<std::string, std::string>
 

Enumerations

enum class  CleanupFileKind : int32_t {
  Manifest = LANCE_CLEANUP_FILE_MANIFEST , Data = LANCE_CLEANUP_FILE_DATA , Transaction = LANCE_CLEANUP_FILE_TRANSACTION , Index = LANCE_CLEANUP_FILE_INDEX ,
  Deletion = LANCE_CLEANUP_FILE_DELETION , TemporaryManifest = LANCE_CLEANUP_FILE_TEMPORARY_MANIFEST
}
 Native cleanup file kinds. More...
 
enum class  WriteMode : int32_t { Create = LANCE_WRITE_CREATE , Append = LANCE_WRITE_APPEND , Overwrite = LANCE_WRITE_OVERWRITE }
 
enum class  MetadataUpdateMode : int32_t { Merge = LANCE_METADATA_UPDATE_MERGE , Replace = LANCE_METADATA_UPDATE_REPLACE }
 
enum class  FieldReferenceKind : int32_t { Id = LANCE_FIELD_REFERENCE_ID , Path = LANCE_FIELD_REFERENCE_PATH }
 
enum class  FtsCoverageMode : int32_t { Strict = LANCE_FTS_COVERAGE_STRICT , IndexOnly = LANCE_FTS_COVERAGE_INDEX_ONLY }
 
enum class  FtsMatchOperator : int32_t { Or = LANCE_FTS_MATCH_OPERATOR_OR , And = LANCE_FTS_MATCH_OPERATOR_AND }
 
enum class  FtsDocumentGranularity : int32_t { Unspecified = LANCE_FTS_DOCUMENT_GRANULARITY_UNSPECIFIED , Row = LANCE_FTS_DOCUMENT_GRANULARITY_ROW , ListElement = LANCE_FTS_DOCUMENT_GRANULARITY_LIST_ELEMENT }
 
enum class  FtsOccur : int32_t { Should = LANCE_FTS_OCCUR_SHOULD , Must = LANCE_FTS_OCCUR_MUST , MustNot = LANCE_FTS_OCCUR_MUST_NOT }
 
enum class  CommitTimeoutMode : int32_t { Default = LANCE_COMMIT_TIMEOUT_DEFAULT , Disabled = LANCE_COMMIT_TIMEOUT_DISABLED , Explicit = LANCE_COMMIT_TIMEOUT_EXPLICIT }
 
enum class  ExternalBlobMode : int32_t { Reference = LANCE_EXTERNAL_BLOB_REFERENCE , Ingest = LANCE_EXTERNAL_BLOB_INGEST }
 
enum class  OverlayCoverageKind : int32_t { Shared = LANCE_DATA_OVERLAY_COVERAGE_SHARED , PerField = LANCE_DATA_OVERLAY_COVERAGE_PER_FIELD }
 Coverage layout of a native data overlay value. More...
 
enum class  OperationKind : int32_t {
  Unknown = LANCE_OPERATION_UNKNOWN , Append = LANCE_OPERATION_APPEND , Delete = LANCE_OPERATION_DELETE , Overwrite = LANCE_OPERATION_OVERWRITE ,
  CreateIndex = LANCE_OPERATION_CREATE_INDEX , Rewrite = LANCE_OPERATION_REWRITE , DataReplacement = LANCE_OPERATION_DATA_REPLACEMENT , DataOverlay = LANCE_OPERATION_DATA_OVERLAY ,
  Merge = LANCE_OPERATION_MERGE , Restore = LANCE_OPERATION_RESTORE , ReserveFragments = LANCE_OPERATION_RESERVE_FRAGMENTS , Update = LANCE_OPERATION_UPDATE ,
  Project = LANCE_OPERATION_PROJECT , UpdateConfig = LANCE_OPERATION_UPDATE_CONFIG , UpdateMemWalState = LANCE_OPERATION_UPDATE_MEM_WAL_STATE , Clone = LANCE_OPERATION_CLONE ,
  UpdateBases = LANCE_OPERATION_UPDATE_BASES
}
 
enum class  UpdateMode : int32_t { RewriteRows = LANCE_UPDATE_MODE_REWRITE_ROWS , RewriteColumns = LANCE_UPDATE_MODE_REWRITE_COLUMNS }
 Native update mode of an Update operation. More...
 
enum class  SessionCacheSpecKind : int32_t { Default = LANCE_SESSION_CACHE_SPEC_DEFAULT , Size = LANCE_SESSION_CACHE_SPEC_SIZE , Uri = LANCE_SESSION_CACHE_SPEC_URI , Config = LANCE_SESSION_CACHE_SPEC_CONFIG }
 
enum class  BlobRowSelector : int32_t { None = LANCE_BLOB_ROWS_NONE , Ids = LANCE_BLOB_ROWS_IDS , Addresses = LANCE_BLOB_ROWS_ADDRESSES , Indices = LANCE_BLOB_ROWS_INDICES }
 Row selector for planned whole-blob and range reads. More...
 
enum class  MemWalDistanceType : int32_t { L2 = LANCE_MEM_WAL_DISTANCE_L2 , Cosine = LANCE_MEM_WAL_DISTANCE_COSINE , Dot = LANCE_MEM_WAL_DISTANCE_DOT , Hamming = LANCE_MEM_WAL_DISTANCE_HAMMING }
 Native distance metric for MemWAL vector search. More...
 
enum class  FileCacheMode : int32_t { None = LANCE_FILE_CACHE_NONE , Session = LANCE_FILE_CACHE_SESSION }
 
enum class  FileFormatVersion : int32_t {
  V1 = LANCE_FILE_FORMAT_V1 , V2_0 = LANCE_FILE_FORMAT_V2_0 , V2_1 = LANCE_FILE_FORMAT_V2_1 , V2_2 = LANCE_FILE_FORMAT_V2_2 ,
  V2_3 = LANCE_FILE_FORMAT_V2_3
}
 
enum class  FileEncodingKind : int32_t { Absent = LANCE_FILE_ENCODING_ABSENT , None = LANCE_FILE_ENCODING_NONE , Direct = LANCE_FILE_ENCODING_DIRECT , Indirect = LANCE_FILE_ENCODING_INDIRECT }
 

Functions

std::string_view version () noexcept
 
void check_error ()
 
void init_logging (std::string_view filter="info")
 
std::string build_rq_model (uint32_t dimension, uint32_t num_bits=5)
 
void scanner_async_stream_free (ArrowArrayStream *stream) noexcept
 
LanceWriteOptions to_c_write_options (const WriteOptions &options, LanceAutoCleanupParams &cleanup)
 
uint64_t process_iops_counter ()
 Native process-wide object-store IOPS counter, with no reset semantics.
 
uint64_t process_bytes_read_counter ()
 
ProcessIoCounters process_io_counters ()
 
std::string simd_info_json ()
 
void blob_field (const std::string &name, bool nullable, ArrowSchema *out)
 
void blob_field_with_options (const std::string &name, bool nullable, const BlobFieldOptions &options, ArrowSchema *out)
 
void write_fragments (const std::string &uri, const ArrowSchema *schema, ArrowArrayStream *stream, const std::vector< std::pair< std::string, std::string > > &storage_opts={})
 

Typedef Documentation

◆ BatchUDFGetBatchV2

Initial value:
std::function<bool(
const BatchUDFInfo&,

Schema-aware checkpoint lookup. A hit must return both an owned array and the exact schema received by insert_batch, because native binds a cached batch to a context marker stored in that schema's metadata. Returns true on a hit, false on a miss, and throws on error.

Definition at line 1618 of file declarations.hpp.

◆ BatchUDFMapper

Initial value:
std::function<void(
const ArrowArray& input,
const ArrowSchema& input_schema,
ArrowArray& output)>

Mapper callback. The input Arrow values are borrowed; output is an uninitialized ArrowArray that the callback must initialize with owned data under the declared BatchUDF output schema. Throw to fail.

Definition at line 1577 of file declarations.hpp.

◆ ConfigUpdate

using lance::ConfigUpdate = std::pair<std::string, std::optional<std::string>>

One native Dataset::update_config entry. value == std::nullopt removes the key; otherwise the value is upserted.

Definition at line 1521 of file declarations.hpp.

◆ StorageOptions

using lance::StorageOptions = std::map<std::string, std::string>

Definition at line 1911 of file declarations.hpp.

◆ TrackedFilesProgressCallback

Initial value:
std::function<void(
uint64_t manifests_processed,
std::optional<uint64_t> manifests_total)>

Owned progress callback for tracked-file enumeration. manifests_total is unset until native progress has a known total; the native listing races the walk, so it may stay unset for some or all updates. The callback must not throw; it runs on a native background task.

Definition at line 1536 of file declarations.hpp.

Enumeration Type Documentation

◆ BlobRowSelector

enum class lance::BlobRowSelector : int32_t
strong

Row selector for planned whole-blob and range reads.

Enumerator
None 
Ids 
Addresses 
Indices 

Definition at line 2468 of file declarations.hpp.

◆ CleanupFileKind

enum class lance::CleanupFileKind : int32_t
strong

Native cleanup file kinds.

Enumerator
Manifest 
Data 
Transaction 
Index 
Deletion 
TemporaryManifest 

Definition at line 327 of file declarations.hpp.

◆ CommitTimeoutMode

enum class lance::CommitTimeoutMode : int32_t
strong
Enumerator
Default 
Disabled 
Explicit 

Definition at line 574 of file declarations.hpp.

◆ ExternalBlobMode

enum class lance::ExternalBlobMode : int32_t
strong
Enumerator
Reference 
Ingest 

Definition at line 607 of file declarations.hpp.

◆ FieldReferenceKind

enum class lance::FieldReferenceKind : int32_t
strong
Enumerator
Id 
Path 

Definition at line 419 of file declarations.hpp.

◆ FileCacheMode

enum class lance::FileCacheMode : int32_t
strong
Enumerator
None 
Session 

Definition at line 6128 of file declarations.hpp.

◆ FileEncodingKind

enum class lance::FileEncodingKind : int32_t
strong
Enumerator
Absent 
None 
Direct 
Indirect 

Definition at line 6141 of file declarations.hpp.

◆ FileFormatVersion

enum class lance::FileFormatVersion : int32_t
strong
Enumerator
V1 
V2_0 
V2_1 
V2_2 
V2_3 

Definition at line 6133 of file declarations.hpp.

◆ FtsCoverageMode

enum class lance::FtsCoverageMode : int32_t
strong
Enumerator
Strict 
IndexOnly 

Definition at line 450 of file declarations.hpp.

◆ FtsDocumentGranularity

enum class lance::FtsDocumentGranularity : int32_t
strong
Enumerator
Unspecified 
Row 
ListElement 

Definition at line 460 of file declarations.hpp.

◆ FtsMatchOperator

enum class lance::FtsMatchOperator : int32_t
strong
Enumerator
Or 
And 

Definition at line 455 of file declarations.hpp.

◆ FtsOccur

enum class lance::FtsOccur : int32_t
strong
Enumerator
Should 
Must 
MustNot 

Definition at line 466 of file declarations.hpp.

◆ MemWalDistanceType

enum class lance::MemWalDistanceType : int32_t
strong

Native distance metric for MemWAL vector search.

Enumerator
L2 
Cosine 
Dot 
Hamming 

Definition at line 3367 of file declarations.hpp.

◆ MetadataUpdateMode

enum class lance::MetadataUpdateMode : int32_t
strong
Enumerator
Merge 
Replace 

Definition at line 414 of file declarations.hpp.

◆ OperationKind

enum class lance::OperationKind : int32_t
strong
Enumerator
Unknown 
Append 
Delete 
Overwrite 
CreateIndex 
Rewrite 
DataReplacement 
DataOverlay 
Merge 
Restore 
ReserveFragments 
Update 
Project 
UpdateConfig 
UpdateMemWalState 
Clone 
UpdateBases 

Definition at line 910 of file declarations.hpp.

◆ OverlayCoverageKind

enum class lance::OverlayCoverageKind : int32_t
strong

Coverage layout of a native data overlay value.

Enumerator
Shared 
PerField 

Definition at line 835 of file declarations.hpp.

◆ SessionCacheSpecKind

enum class lance::SessionCacheSpecKind : int32_t
strong
Enumerator
Default 
Size 
Uri 
Config 

Definition at line 2019 of file declarations.hpp.

◆ UpdateMode

enum class lance::UpdateMode : int32_t
strong

Native update mode of an Update operation.

Enumerator
RewriteRows 
RewriteColumns 

Definition at line 933 of file declarations.hpp.

◆ WriteMode

enum class lance::WriteMode : int32_t
strong
Enumerator
Create 
Append 
Overwrite 

Definition at line 408 of file declarations.hpp.

Function Documentation

◆ blob_field()

void lance::blob_field ( const std::string & name,
bool nullable,
ArrowSchema * out )

Export the native blob v2 field with default storage thresholds.

out is caller-owned and must be released exactly once. It is written only on success.

◆ blob_field_with_options()

void lance::blob_field_with_options ( const std::string & name,
bool nullable,
const BlobFieldOptions & options,
ArrowSchema * out )

Export the native blob v2 field with explicit storage thresholds.

out is caller-owned and must be released exactly once. It is written only on success.

◆ build_rq_model()

std::string lance::build_rq_model ( uint32_t dimension,
uint32_t num_bits = 5 )

Build a portable IVF_RQ fast-rotation model as native JSON. num_bits == 0 selects the native RQ default of 5.

◆ check_error()

void lance::check_error ( )

Check the thread-local error state and throw if it is not LANCE_OK.

Returns normally when the last call succeeded, so it is valid to call after a successful operation. Wrapper failure branches use a non-returning helper instead, so they cannot fall through into an invalid result.

◆ init_logging()

void lance::init_logging ( std::string_view filter = "info")

Opt in to native diagnostic logging on stderr. filter uses the same RUST_LOG-style directive syntax as lance_init_logging; the default "info" matches a NULL filter in C. Throws lance::Error on an invalid filter.

◆ process_bytes_read_counter()

uint64_t lance::process_bytes_read_counter ( )

Native process-wide object-store bytes-read counter, with no reset semantics.

◆ process_io_counters()

ProcessIoCounters lance::process_io_counters ( )

◆ process_iops_counter()

uint64_t lance::process_iops_counter ( )

Native process-wide object-store IOPS counter, with no reset semantics.

◆ scanner_async_stream_free()

void lance::scanner_async_stream_free ( ArrowArrayStream * stream)
noexcept

Release and free a library-allocated ArrowArrayStream returned by Scanner::scan_async. NULL-safe; do not use for caller-allocated streams.

◆ simd_info_json()

std::string lance::simd_info_json ( )

Native SIMD report as the exact JSON object produced by lance_simd_info_json(): tier, target_arch, and host_features.

◆ to_c_write_options()

LanceWriteOptions lance::to_c_write_options ( const WriteOptions & options,
LanceAutoCleanupParams & cleanup )

Convert the shared C++ write-option value into the C representation.

cleanup must outlive the returned value. Both the legacy write entry points and the owned native options handle use this mapping so their defaults cannot drift.

◆ version()

std::string_view lance::version ( )
noexcept

Version of the loaded lance-c library, including any pre-release suffix. The returned view refers to process-lifetime storage owned by the library.

◆ write_fragments()

void lance::write_fragments ( const std::string & uri,
const ArrowSchema * schema,
ArrowArrayStream * stream,
const std::vector< std::pair< std::string, std::string > > & storage_opts = {} )

Write an Arrow record batch stream to fragment files at uri.

Data files are written under <uri>/data/. A Rust finalizer reconstructs Fragment metadata from the file footers and commits via CommitBuilder. No dynamic memory is returned to the caller.

Parameters
uriDirectory URI (file://, s3://, etc.)
schemaRequired Arrow schema — stream schema must match.
streamArrowArrayStream to consume. Must not be used after this call.
storage_optsKey-value storage options, or empty for defaults.
Exceptions
lance::Erroron failure.