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

C API for the Lance columnar data format. More...

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "lance/version.h"
#include "lance/arrow_abi.h"
#include "lance/error.h"
#include "lance/fwd.h"
#include "lance/dataset.h"
#include "lance/scanner.h"
#include "lance/batch.h"

Go to the source code of this file.

Classes

struct  LanceVectorIndexParams
 
struct  LanceOptionalU64
 
struct  LanceOptionalTimestamp
 
struct  LanceStringMap
 
struct  LancePrecomputedShuffleBuffers
 
struct  LanceVectorIndexOptions
 
struct  LanceIndexTrainerOptions
 
struct  LanceScalarIndexOptions
 
struct  LanceSessionCacheStats
 
struct  LanceSessionCacheSpec
 
struct  LanceRemovalStats
 
struct  LanceCleanupPolicy
 
struct  LanceCleanupOperationOptions
 
struct  LanceCleanupOldVersionsOptions
 
struct  LanceFieldReference
 
struct  LanceFieldMetadataUpdate
 
struct  LanceBasePath
 
struct  LanceBasePathView
 
struct  LanceBasePathList
 
struct  LanceTransactionProperties
 
struct  LanceTrackedFilesProgress
 
struct  LanceTrackedFilesOptions
 
struct  LanceMergeInsertParams
 
struct  LanceMergeInsertResult
 
struct  LanceOwnedString
 
struct  LanceCallbackError
 
struct  LanceUDFBatchInfo
 
struct  LanceUDFCheckpointStore
 
struct  LanceBatchUDF
 
struct  LanceUDFCheckpointStoreV2
 
struct  LanceBatchUDFV2
 
struct  LanceCommitLockCallbacks
 
struct  LanceCompactionOptions
 
struct  LanceCompactionMetrics
 
struct  LanceColumnAlteration
 
struct  LanceSqlColumn
 
struct  LanceBlobRange
 
struct  LanceBlobFieldOptions
 
struct  LanceBlobReadOptions
 
struct  LanceBlobRangeRequest
 
struct  LanceIndexSegmentBuildOptions
 
struct  LanceVectorIndexSegmentParams
 
struct  LanceVectorIndexSegmentScope
 
struct  LanceIndexPrewarmOptions
 
struct  LanceFtsMatchOptions
 
struct  LanceFtsPhraseOptions
 
struct  LanceFtsMultiMatchOptions
 
struct  LanceFtsCombinedFieldsOptions
 
struct  LanceFtsBoostOptions
 
struct  LanceWriteParams
 
struct  LanceAutoCleanupParams
 
struct  LanceWriteOptions
 
struct  LanceUInt32List
 
struct  LanceStringList
 
struct  LanceBaseStoreParams
 
struct  LanceBaseStoreParamsList
 
struct  LanceWriteStats
 
struct  LanceWriteFragmentProgressInfo
 
struct  LanceNativeWriteProgress
 
struct  LanceNativeWriteOptionsSpec
 
struct  LanceFragmentCreateOptions
 
struct  LanceFieldMetadataUpdateMap
 
struct  LanceUpdateConfigOperationOptions
 
struct  LanceUncommittedWriteOptions
 
struct  LanceCommitOptions
 
struct  LanceTransactionOptions
 
struct  LanceFragmentOffsetsView
 
struct  LanceIndexFile
 
struct  LanceUpdateOperationOptions
 
struct  LanceStorageOptionsInput
 
struct  LanceStorageOptionsFetchResult
 
struct  LanceStorageOptionsProviderSpec
 
struct  LanceNamespaceResult
 
struct  LanceNamespaceContextProviderSpec
 
struct  LanceNamespaceCustomClientSpec
 
struct  LanceNamespaceCustomClientDispatchSpec
 
struct  LanceFileReaderOptions
 
struct  LanceFileWriterOptions
 
struct  LanceFileWriteSummary
 
struct  LanceSchedulerConfig
 
struct  LanceScanStats
 
struct  LanceObjectStoreRegistryStats
 
struct  LanceObjectStoreIoStats
 
struct  LanceObjectStoreInfo
 
struct  LanceFileMetadataInfo
 
struct  LanceBufferDescriptor
 
struct  LanceEncodingDescriptor
 
struct  LancePageMetadata
 
struct  LanceColumnMetadata
 
struct  LanceColumnStatistics
 
struct  LanceFtsTokenView
 
struct  LanceDeltaTimestamp
 
struct  LanceCompactedSsTable
 
struct  LanceMemWalHnswParams
 
struct  LanceShardWriterConfig
 
struct  LanceShardWriterStats
 
struct  LanceShardMemTableStats
 
struct  LanceShardWriteResult
 

Typedefs

typedef struct LanceVectorIndexOptions LanceVectorIndexOptions
 
typedef struct LanceIndexTrainerOptions LanceIndexTrainerOptions
 
typedef struct LanceScalarIndexOptions LanceScalarIndexOptions
 
typedef struct LanceSessionCacheStats LanceSessionCacheStats
 
typedef struct LanceSessionCacheSpec LanceSessionCacheSpec
 
typedef struct LanceRemovalStats LanceRemovalStats
 
typedef struct LanceCleanupPolicy LanceCleanupPolicy
 
typedef struct LanceCleanupOperationOptions LanceCleanupOperationOptions
 
typedef struct LanceCleanupOldVersionsOptions LanceCleanupOldVersionsOptions
 
typedef struct LanceFieldReference LanceFieldReference
 
typedef struct LanceFieldMetadataUpdate LanceFieldMetadataUpdate
 
typedef struct LanceBasePath LanceBasePath
 
typedef struct LanceBasePathView LanceBasePathView
 
typedef struct LanceBasePathList LanceBasePathList
 
typedef struct LanceTransactionProperties LanceTransactionProperties
 
typedef void(* LanceTrackedFilesProgressCallback) (void *callback_ctx, uint64_t manifests_processed, const uint64_t *manifests_total)
 
typedef void(* LanceTrackedFilesProgressRelease) (void *callback_ctx)
 
typedef struct LanceTrackedFilesProgress LanceTrackedFilesProgress
 
typedef struct LanceTrackedFilesOptions LanceTrackedFilesOptions
 
typedef struct LanceMergeInsertParams LanceMergeInsertParams
 
typedef struct LanceMergeInsertResult LanceMergeInsertResult
 
typedef struct LanceOwnedString LanceOwnedString
 
typedef struct LanceCallbackError LanceCallbackError
 
typedef struct LanceUDFBatchInfo LanceUDFBatchInfo
 
typedef int32_t(* LanceBatchUDFMapper) (void *callback_ctx, const struct ArrowArray *input, const struct ArrowSchema *input_schema, struct ArrowArray *output, LanceCallbackError *error)
 
typedef int32_t(* LanceUDFCheckpointGetBatch) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *output, LanceCallbackError *error)
 
typedef int32_t(* LanceUDFCheckpointGetBatchV2) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *output, struct ArrowSchema *output_schema, LanceCallbackError *error)
 
typedef int32_t(* LanceUDFCheckpointInsertBatch) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *batch, struct ArrowSchema *batch_schema, LanceCallbackError *error)
 
typedef int32_t(* LanceUDFCheckpointGetFragment) (void *callback_ctx, uint32_t fragment_id, LanceOwnedString *out_json, LanceCallbackError *error)
 
typedef int32_t(* LanceUDFCheckpointInsertFragment) (void *callback_ctx, uint64_t fragment_id, const char *fragment_json, LanceCallbackError *error)
 
typedef struct LanceUDFCheckpointStore LanceUDFCheckpointStore
 
typedef struct LanceBatchUDF LanceBatchUDF
 
typedef struct LanceUDFCheckpointStoreV2 LanceUDFCheckpointStoreV2
 
typedef struct LanceBatchUDFV2 LanceBatchUDFV2
 
typedef int32_t(* LanceCommitLockAcquire) (void *callback_ctx, uint64_t version, void **out_lease, LanceCallbackError *error)
 
typedef int32_t(* LanceCommitLockRelease) (void *callback_ctx, void *lease, bool success, LanceCallbackError *error)
 
typedef void(* LanceCommitLeaseDestroy) (void *callback_ctx, void *lease)
 
typedef void(* LanceCommitLockContextRelease) (void *callback_ctx)
 
typedef struct LanceCommitLockCallbacks LanceCommitLockCallbacks
 
typedef struct LanceCompactionOptions LanceCompactionOptions
 
typedef struct LanceCompactionMetrics LanceCompactionMetrics
 
typedef enum LanceCompactionMode LanceCompactionMode
 
typedef enum LanceIndexRemapMode LanceIndexRemapMode
 
typedef struct LanceColumnAlteration LanceColumnAlteration
 
typedef struct LanceSqlColumn LanceSqlColumn
 
typedef struct LanceBlobRange LanceBlobRange
 
typedef struct LanceBlobFieldOptions LanceBlobFieldOptions
 
typedef struct LanceBlobReadOptions LanceBlobReadOptions
 
typedef struct LanceBlobRangeRequest LanceBlobRangeRequest
 
typedef void(* LanceIndexBuildProgressCallback) (void *callback_ctx, int32_t event, const char *stage, uint64_t total, const char *unit, uint64_t completed)
 
typedef enum LanceIndexSegmentBuildMode LanceIndexSegmentBuildMode
 
typedef struct LanceIndexSegmentBuildOptions LanceIndexSegmentBuildOptions
 
typedef struct LanceVectorIndexSegmentParams LanceVectorIndexSegmentParams
 
typedef struct LanceVectorIndexSegmentScope LanceVectorIndexSegmentScope
 
typedef struct LanceIndexPrewarmOptions LanceIndexPrewarmOptions
 
typedef struct LanceFtsMatchOptions LanceFtsMatchOptions
 
typedef struct LanceFtsPhraseOptions LanceFtsPhraseOptions
 
typedef struct LanceFtsMultiMatchOptions LanceFtsMultiMatchOptions
 
typedef struct LanceFtsCombinedFieldsOptions LanceFtsCombinedFieldsOptions
 
typedef struct LanceFtsBoostOptions LanceFtsBoostOptions
 
typedef struct LanceWriteParams LanceWriteParams
 
typedef struct LanceAutoCleanupParams LanceAutoCleanupParams
 
typedef struct LanceWriteOptions LanceWriteOptions
 
typedef struct LanceNativeWriteOptions LanceNativeWriteOptions
 
typedef struct LanceUInt32List LanceUInt32List
 
typedef struct LanceStringList LanceStringList
 
typedef struct LanceBaseStoreParams LanceBaseStoreParams
 
typedef struct LanceWriteStats LanceWriteStats
 
typedef struct LanceWriteFragmentProgressInfo LanceWriteFragmentProgressInfo
 
typedef int32_t(* LanceWriteFragmentProgressCallback) (void *callback_ctx, const LanceWriteFragmentProgressInfo *info, LanceCallbackError *error)
 
typedef void(* LanceWriteStatsCallback) (void *callback_ctx, const LanceWriteStats *stats)
 
typedef void(* LanceNativeWriteProgressRelease) (void *callback_ctx)
 
typedef struct LanceNativeWriteProgress LanceNativeWriteProgress
 
typedef struct LanceNativeWriteOptionsSpec LanceNativeWriteOptionsSpec
 
typedef struct LanceFragmentCreateOptions LanceFragmentCreateOptions
 
typedef struct LanceUpdateMap LanceUpdateMap
 
typedef struct LanceFieldMetadataUpdateMap LanceFieldMetadataUpdateMap
 
typedef struct LanceUpdateConfigOperationOptions LanceUpdateConfigOperationOptions
 
typedef struct LanceUncommittedWriteOptions LanceUncommittedWriteOptions
 
typedef struct LanceCommitOptions LanceCommitOptions
 
typedef struct LanceTransactionOptions LanceTransactionOptions
 
typedef enum LanceDataOverlayCoverageKind LanceDataOverlayCoverageKind
 
typedef enum LanceUpdateMode LanceUpdateMode
 
typedef struct LanceFragmentOffsetsView LanceFragmentOffsetsView
 
typedef struct LanceIndexFile LanceIndexFile
 
typedef enum LanceKeyExistenceFilterKind LanceKeyExistenceFilterKind
 
typedef struct LanceUpdateOperationOptions LanceUpdateOperationOptions
 
typedef struct LanceStorageOptionsProvider LanceStorageOptionsProvider
 
typedef struct LanceStorageOptionsSnapshot LanceStorageOptionsSnapshot
 
typedef struct LanceStorageOptionsInput LanceStorageOptionsInput
 
typedef struct LanceStorageOptionsFetchResult LanceStorageOptionsFetchResult
 
typedef int32_t(* LanceStorageOptionsFetchFn) (void *provider_ctx, LanceStorageOptionsFetchResult *out, LanceCallbackError *error)
 
typedef void(* LanceStorageOptionsProviderReleaseFn) (void *provider_ctx)
 
typedef struct LanceStorageOptionsProviderSpec LanceStorageOptionsProviderSpec
 
typedef struct LanceNamespaceResult LanceNamespaceResult
 
typedef int32_t(* LanceNamespaceContextProviderFn) (void *provider_ctx, const char *operation, const char *object_id, LanceOwnedString *out_result_json, LanceCallbackError *out_error)
 
typedef struct LanceNamespaceContextProviderSpec LanceNamespaceContextProviderSpec
 
typedef int32_t(* LanceNamespaceOperationFn) (void *client_ctx, const char *request_json, LanceOwnedString *out_response_json, LanceCallbackError *out_error)
 
typedef struct LanceNamespaceCustomClientSpec LanceNamespaceCustomClientSpec
 
typedef int32_t(* LanceNamespaceCustomDispatchFn) (void *client_ctx, const char *operation, const char *request_json, LanceOwnedString *out_response_json, LanceCallbackError *out_error)
 
typedef struct LanceNamespaceCustomClientDispatchSpec LanceNamespaceCustomClientDispatchSpec
 
typedef struct LanceFileSession LanceFileSession
 
typedef struct LanceFileReader LanceFileReader
 
typedef struct LanceFileWriter LanceFileWriter
 
typedef struct LancePackedBlobWriter LancePackedBlobWriter
 
typedef struct LanceDedicatedBlobWriter LanceDedicatedBlobWriter
 
typedef struct LanceFileMetadata LanceFileMetadata
 
typedef struct LanceFileStatistics LanceFileStatistics
 
typedef struct LancePathList LancePathList
 
typedef struct LanceDelimitedList LanceDelimitedList
 
typedef struct LanceByteBuffer LanceByteBuffer
 
typedef struct LanceFileReaderOptions LanceFileReaderOptions
 
typedef struct LanceFileWriterOptions LanceFileWriterOptions
 
typedef struct LanceFileWriteSummary LanceFileWriteSummary
 
typedef struct LanceSchedulerConfig LanceSchedulerConfig
 
typedef struct LanceScanStats LanceScanStats
 
typedef struct LanceObjectStoreRegistryStats LanceObjectStoreRegistryStats
 
typedef struct LanceObjectStoreIoStats LanceObjectStoreIoStats
 
typedef struct LanceObjectStoreInfo LanceObjectStoreInfo
 
typedef struct LanceFileMetadataInfo LanceFileMetadataInfo
 
typedef struct LanceBufferDescriptor LanceBufferDescriptor
 
typedef struct LanceEncodingDescriptor LanceEncodingDescriptor
 
typedef struct LancePageMetadata LancePageMetadata
 
typedef struct LanceColumnMetadata LanceColumnMetadata
 
typedef struct LanceColumnStatistics LanceColumnStatistics
 
typedef struct LanceFtsTokenView LanceFtsTokenView
 
typedef struct LanceDeltaTimestamp LanceDeltaTimestamp
 
typedef struct LanceMemWalIndexDetails LanceMemWalIndexDetails
 
typedef struct LanceMemWalShardingSpec LanceMemWalShardingSpec
 
typedef struct LanceMemWalShardingField LanceMemWalShardingField
 
typedef struct LanceMemWalShardSnapshot LanceMemWalShardSnapshot
 
typedef struct LanceShardWriter LanceShardWriter
 
typedef struct LanceLsmScanner LanceLsmScanner
 
typedef struct LanceLsmPointLookupPlanner LanceLsmPointLookupPlanner
 
typedef struct LanceLsmVectorSearchPlanner LanceLsmVectorSearchPlanner
 
typedef struct LanceMemWalPlan LanceMemWalPlan
 

Enumerations

enum  LanceVectorIndexType {
  LANCE_INDEX_IVF_FLAT = 101 , LANCE_INDEX_IVF_SQ = 102 , LANCE_INDEX_IVF_PQ = 103 , LANCE_INDEX_IVF_HNSW_SQ = 104 ,
  LANCE_INDEX_IVF_HNSW_PQ = 105 , LANCE_INDEX_IVF_HNSW_FLAT = 106 , LANCE_INDEX_IVF_RQ = 107
}
 
enum  LanceScalarIndexType {
  LANCE_SCALAR_BTREE = 1 , LANCE_SCALAR_BITMAP = 2 , LANCE_SCALAR_LABEL_LIST = 3 , LANCE_SCALAR_INVERTED = 4 ,
  LANCE_SCALAR_NGRAM = 5 , LANCE_SCALAR_ZONE_MAP = 6 , LANCE_SCALAR_BLOOM_FILTER = 7 , LANCE_SCALAR_MINHASH_LSH = 8 ,
  LANCE_SCALAR_RTREE = 9
}
 
enum  LanceMetricType { LANCE_METRIC_L2 = 0 , LANCE_METRIC_COSINE = 1 , LANCE_METRIC_DOT = 2 , LANCE_METRIC_HAMMING = 3 }
 
enum  LanceApproxMode { LANCE_APPROX_MODE_FAST = 0 , LANCE_APPROX_MODE_NORMAL = 1 , LANCE_APPROX_MODE_ACCURATE = 2 }
 
enum  LanceDataType {
  LANCE_DTYPE_FLOAT32 = 0 , LANCE_DTYPE_FLOAT16 = 1 , LANCE_DTYPE_FLOAT64 = 2 , LANCE_DTYPE_UINT8 = 3 ,
  LANCE_DTYPE_INT8 = 4
}
 
enum  LanceIndexFileVersion { LANCE_INDEX_FILE_VERSION_V3 = 0 , LANCE_INDEX_FILE_VERSION_LEGACY = 1 }
 
enum  LanceSessionCacheSpecKind { LANCE_SESSION_CACHE_SPEC_DEFAULT = 0 , LANCE_SESSION_CACHE_SPEC_SIZE = 1 , LANCE_SESSION_CACHE_SPEC_URI = 2 , LANCE_SESSION_CACHE_SPEC_CONFIG = 3 }
 
enum  LanceCleanupFileKind {
  LANCE_CLEANUP_FILE_MANIFEST = 0 , LANCE_CLEANUP_FILE_DATA = 1 , LANCE_CLEANUP_FILE_TRANSACTION = 2 , LANCE_CLEANUP_FILE_INDEX = 3 ,
  LANCE_CLEANUP_FILE_DELETION = 4 , LANCE_CLEANUP_FILE_TEMPORARY_MANIFEST = 5
}
 
enum  LanceMetadataUpdateMode { LANCE_METADATA_UPDATE_MERGE = 0 , LANCE_METADATA_UPDATE_REPLACE = 1 }
 
enum  LanceFieldReferenceKind { LANCE_FIELD_REFERENCE_ID = 0 , LANCE_FIELD_REFERENCE_PATH = 1 }
 
enum  LanceMergeWhenMatched {
  LANCE_MERGE_WHEN_MATCHED_DO_NOTHING = 0 , LANCE_MERGE_WHEN_MATCHED_UPDATE_ALL = 1 , LANCE_MERGE_WHEN_MATCHED_UPDATE_IF = 2 , LANCE_MERGE_WHEN_MATCHED_FAIL = 3 ,
  LANCE_MERGE_WHEN_MATCHED_DELETE = 4
}
 
enum  LanceMergeWhenNotMatched { LANCE_MERGE_WHEN_NOT_MATCHED_INSERT_ALL = 0 , LANCE_MERGE_WHEN_NOT_MATCHED_DO_NOTHING = 1 }
 
enum  LanceMergeWhenNotMatchedBySource { LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_KEEP = 0 , LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_DELETE = 1 , LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_IF = 2 }
 
enum  LanceCompactionMode { LANCE_COMPACTION_REENCODE = 0 , LANCE_COMPACTION_TRY_BINARY_COPY = 1 , LANCE_COMPACTION_FORCE_BINARY_COPY = 2 }
 
enum  LanceIndexRemapMode { LANCE_INDEX_REMAP_COMPACT = 0 , LANCE_INDEX_REMAP_DIRECT = 1 }
 
enum  LanceColumnNullableMode { LANCE_COLUMN_NULLABLE_UNCHANGED = 0 , LANCE_COLUMN_NULLABLE_TRUE = 1 , LANCE_COLUMN_NULLABLE_FALSE = 2 }
 
enum  LanceBlobRowSelector { LANCE_BLOB_ROWS_NONE = 0 , LANCE_BLOB_ROWS_IDS = 1 , LANCE_BLOB_ROWS_ADDRESSES = 2 , LANCE_BLOB_ROWS_INDICES = 3 }
 
enum  LanceBlobReadOrder { LANCE_BLOB_READ_PRESERVE_ORDER = 0 , LANCE_BLOB_READ_UNORDERED = 1 }
 
enum  LanceIndexBuildProgressEvent { LANCE_INDEX_BUILD_PROGRESS_STAGE_START = 0 , LANCE_INDEX_BUILD_PROGRESS_STAGE_PROGRESS = 1 , LANCE_INDEX_BUILD_PROGRESS_STAGE_COMPLETE = 2 }
 
enum  LanceIndexSegmentBuildMode { LANCE_INDEX_SEGMENT_BUILD_AUTO = 0 , LANCE_INDEX_SEGMENT_BUILD_LOCAL_TRAIN = 1 , LANCE_INDEX_SEGMENT_BUILD_PRECOMPUTED = 2 }
 
enum  LanceFtsCoverageMode { LANCE_FTS_COVERAGE_STRICT = 0 , LANCE_FTS_COVERAGE_INDEX_ONLY = 1 }
 
enum  LanceFtsMatchOperator { LANCE_FTS_MATCH_OPERATOR_OR = 0 , LANCE_FTS_MATCH_OPERATOR_AND = 1 }
 
enum  LanceFtsDocumentGranularity { LANCE_FTS_DOCUMENT_GRANULARITY_UNSPECIFIED = 0 , LANCE_FTS_DOCUMENT_GRANULARITY_ROW = 1 , LANCE_FTS_DOCUMENT_GRANULARITY_LIST_ELEMENT = 2 }
 
enum  LanceFtsOccur { LANCE_FTS_OCCUR_SHOULD = 0 , LANCE_FTS_OCCUR_MUST = 1 , LANCE_FTS_OCCUR_MUST_NOT = 2 }
 
enum  LanceWriteMode { LANCE_WRITE_CREATE = 0 , LANCE_WRITE_APPEND = 1 , LANCE_WRITE_OVERWRITE = 2 }
 
enum  LanceExternalBlobMode { LANCE_EXTERNAL_BLOB_REFERENCE = 0 , LANCE_EXTERNAL_BLOB_INGEST = 1 }
 
enum  LanceOperationKind {
  LANCE_OPERATION_UNKNOWN = 0 , LANCE_OPERATION_APPEND = 1 , LANCE_OPERATION_DELETE = 2 , LANCE_OPERATION_OVERWRITE = 3 ,
  LANCE_OPERATION_CREATE_INDEX = 4 , LANCE_OPERATION_REWRITE = 5 , LANCE_OPERATION_DATA_REPLACEMENT = 6 , LANCE_OPERATION_DATA_OVERLAY = 7 ,
  LANCE_OPERATION_MERGE = 8 , LANCE_OPERATION_RESTORE = 9 , LANCE_OPERATION_RESERVE_FRAGMENTS = 10 , LANCE_OPERATION_UPDATE = 11 ,
  LANCE_OPERATION_PROJECT = 12 , LANCE_OPERATION_UPDATE_CONFIG = 13 , LANCE_OPERATION_UPDATE_MEM_WAL_STATE = 14 , LANCE_OPERATION_CLONE = 15 ,
  LANCE_OPERATION_UPDATE_BASES = 16
}
 
enum  LanceCommitTimeoutMode { LANCE_COMMIT_TIMEOUT_DEFAULT = 0 , LANCE_COMMIT_TIMEOUT_DISABLED = 1 , LANCE_COMMIT_TIMEOUT_EXPLICIT = 2 }
 
enum  LanceDataOverlayCoverageKind { LANCE_DATA_OVERLAY_COVERAGE_SHARED = 0 , LANCE_DATA_OVERLAY_COVERAGE_PER_FIELD = 1 }
 
enum  LanceUpdateMode { LANCE_UPDATE_MODE_REWRITE_ROWS = 0 , LANCE_UPDATE_MODE_REWRITE_COLUMNS = 1 }
 
enum  LanceKeyExistenceFilterKind { LANCE_KEY_EXISTENCE_FILTER_EXACT = 0 , LANCE_KEY_EXISTENCE_FILTER_BLOOM = 1 }
 
enum  LanceFileCacheMode { LANCE_FILE_CACHE_NONE = 0 , LANCE_FILE_CACHE_SESSION = 1 }
 
enum  LanceSchedulerLiteMode { LANCE_SCHEDULER_LITE_AUTO = 0 , LANCE_SCHEDULER_LITE_STANDARD = 1 , LANCE_SCHEDULER_LITE_LITE = 2 }
 
enum  LanceFileFormatVersion {
  LANCE_FILE_FORMAT_V1 = 0 , LANCE_FILE_FORMAT_V2_0 = 1 , LANCE_FILE_FORMAT_V2_1 = 2 , LANCE_FILE_FORMAT_V2_2 = 3 ,
  LANCE_FILE_FORMAT_V2_3 = 4
}
 
enum  LanceFileEncodingKind { LANCE_FILE_ENCODING_ABSENT = 0 , LANCE_FILE_ENCODING_NONE = 1 , LANCE_FILE_ENCODING_DIRECT = 2 , LANCE_FILE_ENCODING_INDIRECT = 3 }
 
enum  LanceMemWalShardingMode { LANCE_MEM_WAL_SHARDING_MANUAL = 0 , LANCE_MEM_WAL_SHARDING_UNSHARDED = 1 , LANCE_MEM_WAL_SHARDING_BUCKET = 2 , LANCE_MEM_WAL_SHARDING_IDENTITY = 3 }
 
enum  LanceMemWalDistanceType { LANCE_MEM_WAL_DISTANCE_L2 = 0 , LANCE_MEM_WAL_DISTANCE_COSINE = 1 , LANCE_MEM_WAL_DISTANCE_DOT = 2 , LANCE_MEM_WAL_DISTANCE_HAMMING = 3 }
 

Functions

LANCE_API int32_t lance_init_logging (const char *filter)
 
LANCE_NODISCARD LANCE_API LanceSession * lance_session_new (uint64_t index_cache_size_bytes, uint64_t metadata_cache_size_bytes)
 
LANCE_NODISCARD LANCE_API LanceSession * lance_session_new_with_cache_specs (const LanceSessionCacheSpec *index_cache, const LanceSessionCacheSpec *metadata_cache)
 
LANCE_API void lance_session_close (LanceSession *session)
 
LANCE_API int32_t lance_session_get_cache_stats (const LanceSession *session, LanceSessionCacheStats *out_stats)
 
LANCE_API int32_t lance_session_get_size_bytes (const LanceSession *session, uint64_t *out_size_bytes)
 
LANCE_API int32_t lance_session_get_approx_num_items (const LanceSession *session, uint64_t *out_num_items)
 
LANCE_API int32_t lance_dataset_cleanup_old_versions (const LanceDataset *dataset, const LanceCleanupOldVersionsOptions *options, LanceRemovalStats *out_stats)
 
LANCE_API int32_t lance_dataset_cleanup (const LanceDataset *dataset, const LanceCleanupPolicy *policy, const LanceCleanupOperationOptions *operation_options, LanceRemovalStats *out_stats)
 
LANCE_NODISCARD LANCE_API LanceCleanupExplanation * lance_dataset_cleanup_explain (const LanceDataset *dataset, const LanceCleanupPolicy *policy, const LanceCleanupOperationOptions *operation_options)
 
LANCE_API uint64_t lance_cleanup_explanation_read_version (const LanceCleanupExplanation *explanation)
 
LANCE_API int32_t lance_cleanup_explanation_stats (const LanceCleanupExplanation *explanation, LanceRemovalStats *out_stats)
 
LANCE_API uint64_t lance_cleanup_explanation_candidate_count (const LanceCleanupExplanation *explanation)
 
LANCE_API int32_t lance_cleanup_explanation_candidate_files_truncated (const LanceCleanupExplanation *explanation)
 
LANCE_API uint64_t lance_cleanup_explanation_candidate_file_limit (const LanceCleanupExplanation *explanation)
 
LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_candidate_path_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API int32_t lance_cleanup_explanation_candidate_kind_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API int32_t lance_cleanup_explanation_candidate_unverified_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API uint64_t lance_cleanup_explanation_candidate_size_bytes_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API uint64_t lance_cleanup_explanation_referenced_branch_count (const LanceCleanupExplanation *explanation)
 
LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_referenced_branch_name_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API uint64_t lance_cleanup_explanation_referenced_branch_version_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API int32_t lance_cleanup_explanation_referenced_branch_cleanup_candidate_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API uint64_t lance_cleanup_explanation_warning_count (const LanceCleanupExplanation *explanation)
 
LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_warning_at (const LanceCleanupExplanation *explanation, size_t index)
 
LANCE_API void lance_cleanup_explanation_close (LanceCleanupExplanation *explanation)
 
LANCE_API int32_t lance_dataset_validate (const LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_count_deleted_rows (const LanceDataset *dataset, uint64_t *out_rows)
 
LANCE_API int32_t lance_dataset_num_small_files (const LanceDataset *dataset, size_t max_rows_per_group, uint64_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_metadata_json (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_update_metadata_json (LanceDataset *dataset, const char *const *keys, const char *const *values, size_t count, LanceMetadataUpdateMode mode)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_update_schema_metadata_json (LanceDataset *dataset, const char *const *keys, const char *const *values, size_t count, LanceMetadataUpdateMode mode)
 
LANCE_API int32_t lance_dataset_update_field_metadata (LanceDataset *dataset, const LanceFieldMetadataUpdate *updates, size_t update_count)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_data_storage_version (const LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_has_stable_row_ids (const LanceDataset *dataset, bool *out_has_stable_row_ids)
 
LANCE_API int32_t lance_dataset_field_id_count (const LanceDataset *dataset, size_t *out_count)
 
LANCE_API int32_t lance_dataset_field_id_at (const LanceDataset *dataset, size_t index, int32_t *out_field_id)
 
LANCE_API int32_t lance_dataset_resolve_field_id (const LanceDataset *dataset, const LanceFieldReference *field, int32_t *out_field_id)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_field_path (const LanceDataset *dataset, int32_t field_id)
 
LANCE_NODISCARD LANCE_API LanceRef * lance_ref_version_number (uint64_t version)
 
LANCE_NODISCARD LANCE_API LanceRef * lance_ref_version (const char *branch, bool has_version, uint64_t version)
 
LANCE_NODISCARD LANCE_API LanceRef * lance_ref_tag (const char *tag_name)
 
LANCE_API void lance_ref_close (LanceRef *reference)
 
LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_checkout_ref (const LanceDataset *dataset, const LanceRef *reference)
 
LANCE_API int32_t lance_dataset_deep_clone (const LanceDataset *dataset, const char *target_path, const LanceRef *reference, const LanceStorageOptionsAccessor *target_storage_options, LanceDataset **out)
 
LANCE_API int32_t lance_dataset_shallow_clone (const LanceDataset *dataset, const char *target_path, const LanceRef *reference, const LanceStorageOptionsAccessor *target_storage_options, LanceDataset **out)
 
LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_branch_create (const LanceDataset *dataset, const char *branch_name, const LanceRef *reference, const char *const *storage_opts)
 
LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_checkout_branch (const LanceDataset *dataset, const char *branch_name)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_branches_json (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_branch_get_json (const LanceDataset *dataset, const char *branch_name)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_branch_identifier_json (const LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_branch_delete (const LanceDataset *dataset, const char *branch_name)
 
LANCE_API int32_t lance_dataset_branch_force_delete (const LanceDataset *dataset, const char *branch_name)
 
LANCE_API int32_t lance_dataset_branch_replace_metadata (const LanceDataset *dataset, const char *branch_name, const char *const *metadata)
 
LANCE_NODISCARD LANCE_API LanceTags * lance_dataset_tags (const LanceDataset *dataset)
 
LANCE_API uint64_t lance_tags_count (const LanceTags *tags)
 
LANCE_NODISCARD LANCE_API const LanceTag * lance_tags_at (const LanceTags *tags, size_t index)
 
LANCE_API void lance_tags_close (LanceTags *tags)
 
LANCE_NODISCARD LANCE_API LanceTag * lance_dataset_tag_get (const LanceDataset *dataset, const char *tag_name)
 
LANCE_API int32_t lance_dataset_tag_create (const LanceDataset *dataset, const char *tag_name, const LanceRef *reference)
 
LANCE_API int32_t lance_dataset_tag_update (const LanceDataset *dataset, const char *tag_name, const LanceRef *reference)
 
LANCE_API int32_t lance_dataset_tag_delete (const LanceDataset *dataset, const char *tag_name)
 
LANCE_API int32_t lance_dataset_tag_replace_metadata (const LanceDataset *dataset, const char *tag_name, const char *const *metadata)
 
LANCE_NODISCARD LANCE_API const char * lance_tag_name (const LanceTag *tag)
 
LANCE_API uint64_t lance_tag_version (const LanceTag *tag)
 
LANCE_API int32_t lance_tag_branch (const LanceTag *tag, const char **out_branch)
 
LANCE_API int32_t lance_tag_created_at_ns (const LanceTag *tag, int64_t *out_timestamp_ns)
 
LANCE_API int32_t lance_tag_updated_at_ns (const LanceTag *tag, int64_t *out_timestamp_ns)
 
LANCE_API uint64_t lance_tag_manifest_size (const LanceTag *tag)
 
LANCE_API uint64_t lance_tag_metadata_count (const LanceTag *tag)
 
LANCE_NODISCARD LANCE_API const char * lance_tag_metadata_key_at (const LanceTag *tag, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_tag_metadata_value_at (const LanceTag *tag, size_t index)
 
LANCE_API void lance_tag_close (LanceTag *tag)
 
LANCE_NODISCARD LANCE_API LanceDataStatistics * lance_dataset_calculate_data_stats (const LanceDataset *dataset)
 
LANCE_API uint64_t lance_data_statistics_count (const LanceDataStatistics *stats)
 
LANCE_API uint32_t lance_data_statistics_field_id_at (const LanceDataStatistics *stats, size_t index)
 
LANCE_API uint64_t lance_data_statistics_bytes_on_disk_at (const LanceDataStatistics *stats, size_t index)
 
LANCE_API void lance_data_statistics_close (LanceDataStatistics *stats)
 
LANCE_NODISCARD LANCE_API LanceDatasetConfig * lance_dataset_config (const LanceDataset *dataset)
 
LANCE_API uint64_t lance_dataset_config_count (const LanceDatasetConfig *config)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_config_key_at (const LanceDatasetConfig *config, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_config_value_at (const LanceDatasetConfig *config, size_t index)
 
LANCE_API void lance_dataset_config_close (LanceDatasetConfig *config)
 
LANCE_API int32_t lance_dataset_update_config (LanceDataset *dataset, const char *const *keys, const char *const *values, size_t num_entries)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_update_config_json (LanceDataset *dataset, const char *const *keys, const char *const *values, size_t count, LanceMetadataUpdateMode mode)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_base_paths_json (const LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_add_bases (LanceDataset *dataset, const LanceBasePath *bases, size_t base_count, const LanceTransactionProperties *transaction_properties)
 
LANCE_API int32_t lance_dataset_tracked_files_stream (const LanceDataset *dataset, const LanceTrackedFilesOptions *options, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_dataset_all_files_stream (const LanceDataset *dataset, struct ArrowArrayStream *out)
 
LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_restore (const LanceDataset *dataset, uint64_t version)
 
LANCE_API int32_t lance_dataset_delete (LanceDataset *dataset, const char *predicate, uint64_t *out_num_deleted)
 
LANCE_API int32_t lance_dataset_update (LanceDataset *dataset, const char *predicate, const char *const *columns, const char *const *values, size_t num_updates, uint64_t *out_num_updated)
 
LANCE_API int32_t lance_dataset_merge_insert (LanceDataset *dataset, const char *const *on_columns, size_t num_on_columns, struct ArrowArrayStream *source, const LanceMergeInsertParams *params, LanceMergeInsertResult *out_result)
 
LANCE_API int32_t lance_dataset_merge (LanceDataset *dataset, const char *left_on, const char *right_on, struct ArrowArrayStream *source)
 
LANCE_API int32_t lance_dataset_add_columns_batch_udf (LanceDataset *dataset, const LanceBatchUDF *udf, const char *const *read_columns, const uint32_t *batch_size)
 
LANCE_API int32_t lance_dataset_add_columns_batch_udf_v2 (LanceDataset *dataset, const LanceBatchUDFV2 *udf, const char *const *read_columns, const uint32_t *batch_size)
 
LANCE_NODISCARD LANCE_API LanceCommitLock * lance_commit_lock_new (const LanceCommitLockCallbacks *callbacks)
 
LANCE_API void lance_commit_lock_close (LanceCommitLock *lock)
 
LANCE_API int32_t lance_dataset_compact_files (LanceDataset *dataset, const LanceCompactionOptions *options, LanceCompactionMetrics *out_metrics)
 
LANCE_API int32_t lance_dataset_migrate_manifest_paths_v2 (LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_truncate_table (LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_new (void)
 
LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_from_dataset (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_clone (const LanceCompactionOptionsV2 *options)
 
LANCE_API void lance_compaction_options_v2_free (LanceCompactionOptionsV2 *options)
 
LANCE_API int32_t lance_compaction_options_v2_set_target_rows_per_fragment (LanceCompactionOptionsV2 *options, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_rows_per_group (LanceCompactionOptionsV2 *options, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_bytes_per_file (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_materialize_deletions (LanceCompactionOptionsV2 *options, bool value)
 
LANCE_API int32_t lance_compaction_options_v2_set_materialize_deletions_threshold (LanceCompactionOptionsV2 *options, float value)
 
LANCE_API int32_t lance_compaction_options_v2_set_num_threads (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_batch_size (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_io_buffer_size (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_defer_index_remap (LanceCompactionOptionsV2 *options, bool value)
 
LANCE_API int32_t lance_compaction_options_v2_set_index_remap_mode (LanceCompactionOptionsV2 *options, int32_t mode)
 
LANCE_API int32_t lance_compaction_options_v2_set_compaction_mode (LanceCompactionOptionsV2 *options, bool has_value, int32_t mode)
 
LANCE_API int32_t lance_compaction_options_v2_set_binary_copy_read_batch_bytes (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_source_fragments (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_source_rows (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_source_bytes (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_excluded_fragment_ids (LanceCompactionOptionsV2 *options, const uint32_t *fragment_ids, size_t count)
 
LANCE_API int32_t lance_compaction_options_v2_set_max_overlays_per_fragment (LanceCompactionOptionsV2 *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_compaction_options_v2_set_data_storage_version (LanceCompactionOptionsV2 *options, const char *selector)
 
LANCE_API int32_t lance_compaction_options_v2_set_transaction_properties (LanceCompactionOptionsV2 *options, const LanceTransactionProperties *properties)
 
LANCE_API int32_t lance_dataset_compact_files_v2 (LanceDataset *dataset, const LanceCompactionOptionsV2 *options, LanceCompactionMetrics *out_metrics)
 
LANCE_NODISCARD LANCE_API LanceCompactionPlan * lance_dataset_plan_compaction (const LanceDataset *dataset, const LanceCompactionOptionsV2 *options)
 
LANCE_API uint64_t lance_compaction_plan_read_version (const LanceCompactionPlan *plan)
 
LANCE_API size_t lance_compaction_plan_task_count (const LanceCompactionPlan *plan)
 
LANCE_NODISCARD LANCE_API LanceCompactionTask * lance_compaction_plan_task_at (const LanceCompactionPlan *plan, size_t index)
 
LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_plan_options_clone (const LanceCompactionPlan *plan)
 
LANCE_NODISCARD LANCE_API const char * lance_compaction_plan_json (const LanceCompactionPlan *plan)
 
LANCE_NODISCARD LANCE_API LanceCompactionPlan * lance_compaction_plan_from_json (const char *json)
 
LANCE_API void lance_compaction_plan_close (LanceCompactionPlan *plan)
 
LANCE_API uint64_t lance_compaction_task_read_version (const LanceCompactionTask *task)
 
LANCE_API size_t lance_compaction_task_fragment_count (const LanceCompactionTask *task)
 
LANCE_NODISCARD LANCE_API const char * lance_compaction_task_fragment_metadata_json_at (const LanceCompactionTask *task, size_t index)
 
LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_task_options_clone (const LanceCompactionTask *task)
 
LANCE_NODISCARD LANCE_API LanceRewriteResult * lance_compaction_task_execute (const LanceDataset *dataset, const LanceCompactionTask *task)
 
LANCE_NODISCARD LANCE_API const char * lance_compaction_task_json (const LanceCompactionTask *task)
 
LANCE_NODISCARD LANCE_API LanceCompactionTask * lance_compaction_task_from_json (const char *json)
 
LANCE_API void lance_compaction_task_close (LanceCompactionTask *task)
 
LANCE_API uint64_t lance_rewrite_result_read_version (const LanceRewriteResult *result)
 
LANCE_API int32_t lance_rewrite_result_metrics (const LanceRewriteResult *result, LanceCompactionMetrics *out_metrics)
 
LANCE_API size_t lance_rewrite_result_original_fragment_count (const LanceRewriteResult *result)
 
LANCE_API size_t lance_rewrite_result_new_fragment_count (const LanceRewriteResult *result)
 
LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_original_fragment_metadata_json_at (const LanceRewriteResult *result, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_new_fragment_metadata_json_at (const LanceRewriteResult *result, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_json (const LanceRewriteResult *result)
 
LANCE_NODISCARD LANCE_API LanceRewriteResult * lance_rewrite_result_from_json (const char *json)
 
LANCE_API void lance_rewrite_result_close (LanceRewriteResult *result)
 
LANCE_API int32_t lance_dataset_commit_compaction (LanceDataset *dataset, const LanceRewriteResult *const *results, size_t result_count, const LanceCompactionOptionsV2 *options, LanceCompactionMetrics *out_metrics)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndicesOptions * lance_optimize_indices_options_new (void)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndicesOptions * lance_optimize_indices_options_clone (const LanceOptimizeIndicesOptions *options)
 
LANCE_API void lance_optimize_indices_options_free (LanceOptimizeIndicesOptions *options)
 
LANCE_API int32_t lance_optimize_indices_options_set_num_indices_to_merge (LanceOptimizeIndicesOptions *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_optimize_indices_options_set_enable_partition_rebalancing (LanceOptimizeIndicesOptions *options, bool value)
 
LANCE_API int32_t lance_optimize_indices_options_set_index_names (LanceOptimizeIndicesOptions *options, bool has_value, const char *const *names, size_t count)
 
LANCE_API int32_t lance_optimize_indices_options_set_retrain (LanceOptimizeIndicesOptions *options, bool value)
 
LANCE_API int32_t lance_optimize_indices_options_set_transaction_properties (LanceOptimizeIndicesOptions *options, const LanceTransactionProperties *properties)
 
LANCE_API int32_t lance_optimize_indices_options_set_max_rows_per_task (LanceOptimizeIndicesOptions *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_optimize_indices_options_set_max_rows_per_segment (LanceOptimizeIndicesOptions *options, bool has_value, uint64_t value)
 
LANCE_API int32_t lance_dataset_optimize_indices (LanceDataset *dataset, const LanceOptimizeIndicesOptions *options)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndicesPlan * lance_dataset_plan_optimize_indices (const LanceDataset *dataset, const LanceOptimizeIndicesOptions *options)
 
LANCE_API int32_t lance_optimize_indices_plan_id (const LanceOptimizeIndicesPlan *plan, uint8_t out_uuid[16])
 
LANCE_API uint64_t lance_optimize_indices_plan_read_version (const LanceOptimizeIndicesPlan *plan)
 
LANCE_API size_t lance_optimize_indices_plan_task_count (const LanceOptimizeIndicesPlan *plan)
 
LANCE_API size_t lance_optimize_indices_plan_merge_count (const LanceOptimizeIndicesPlan *plan)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndexTask * lance_optimize_indices_plan_task_at (const LanceOptimizeIndicesPlan *plan, size_t index)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndexMerge * lance_optimize_indices_plan_merge_at (const LanceOptimizeIndicesPlan *plan, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_optimize_indices_plan_json (const LanceOptimizeIndicesPlan *plan)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndicesPlan * lance_optimize_indices_plan_from_json (const char *json)
 
LANCE_API void lance_optimize_indices_plan_close (LanceOptimizeIndicesPlan *plan)
 
LANCE_API int32_t lance_optimize_index_task_plan_id (const LanceOptimizeIndexTask *task, uint8_t out_uuid[16])
 
LANCE_API uint64_t lance_optimize_index_task_read_version (const LanceOptimizeIndexTask *task)
 
LANCE_API uint32_t lance_optimize_index_task_group (const LanceOptimizeIndexTask *task)
 
LANCE_API size_t lance_optimize_index_task_fragment_count (const LanceOptimizeIndexTask *task)
 
LANCE_API int32_t lance_optimize_index_task_fragment_id_at (const LanceOptimizeIndexTask *task, size_t index, uint32_t *out_id)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_task_reference (const LanceOptimizeIndexTask *task)
 
LANCE_API size_t lance_optimize_index_task_old_segment_count (const LanceOptimizeIndexTask *task)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_task_old_segment_at (const LanceOptimizeIndexTask *task, size_t index)
 
LANCE_API int32_t lance_optimize_index_task_num_indices_to_merge (const LanceOptimizeIndexTask *task, bool *out_has_value, uint64_t *out_value)
 
LANCE_API int32_t lance_optimize_index_task_enable_partition_rebalancing (const LanceOptimizeIndexTask *task, bool *out_value)
 
LANCE_API int32_t lance_optimize_index_task_retrain (const LanceOptimizeIndexTask *task, bool *out_value)
 
LANCE_API int32_t lance_optimize_index_task_execute (const LanceDataset *dataset, const LanceOptimizeIndexTask *task, LanceIndexSegmentResult **out_result)
 
LANCE_NODISCARD LANCE_API const char * lance_optimize_index_task_json (const LanceOptimizeIndexTask *task)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndexTask * lance_optimize_index_task_from_json (const char *json)
 
LANCE_API void lance_optimize_index_task_close (LanceOptimizeIndexTask *task)
 
LANCE_API int32_t lance_optimize_index_merge_plan_id (const LanceOptimizeIndexMerge *merge, uint8_t out_uuid[16])
 
LANCE_API uint64_t lance_optimize_index_merge_read_version (const LanceOptimizeIndexMerge *merge)
 
LANCE_API uint32_t lance_optimize_index_merge_group (const LanceOptimizeIndexMerge *merge)
 
LANCE_API size_t lance_optimize_index_merge_old_segment_count (const LanceOptimizeIndexMerge *merge)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_merge_old_segment_at (const LanceOptimizeIndexMerge *merge, size_t index)
 
LANCE_API size_t lance_optimize_index_merge_replace_count (const LanceOptimizeIndexMerge *merge)
 
LANCE_API int32_t lance_optimize_index_merge_replace_uuid_at (const LanceOptimizeIndexMerge *merge, size_t index, uint8_t out_uuid[16])
 
LANCE_API int32_t lance_optimize_index_merge_execute (const LanceDataset *dataset, const LanceOptimizeIndexMerge *merge, const LanceIndexSegmentResult *const *task_results, size_t task_result_count, LanceIndexSegmentResult **out_result)
 
LANCE_NODISCARD LANCE_API const char * lance_optimize_index_merge_json (const LanceOptimizeIndexMerge *merge)
 
LANCE_NODISCARD LANCE_API LanceOptimizeIndexMerge * lance_optimize_index_merge_from_json (const char *json)
 
LANCE_API void lance_optimize_index_merge_close (LanceOptimizeIndexMerge *merge)
 
LANCE_API int32_t lance_index_segment_result_plan_id (const LanceIndexSegmentResult *result, uint8_t out_uuid[16])
 
LANCE_API uint64_t lance_index_segment_result_read_version (const LanceIndexSegmentResult *result)
 
LANCE_API uint32_t lance_index_segment_result_group (const LanceIndexSegmentResult *result)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_result_segment (const LanceIndexSegmentResult *result)
 
LANCE_API size_t lance_index_segment_result_replace_count (const LanceIndexSegmentResult *result)
 
LANCE_API int32_t lance_index_segment_result_replace_uuid_at (const LanceIndexSegmentResult *result, size_t index, uint8_t out_uuid[16])
 
LANCE_NODISCARD LANCE_API const char * lance_index_segment_result_json (const LanceIndexSegmentResult *result)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentResult * lance_index_segment_result_from_json (const char *json)
 
LANCE_API void lance_index_segment_result_close (LanceIndexSegmentResult *result)
 
LANCE_API int32_t lance_dataset_commit_optimize_indices (LanceDataset *dataset, const LanceIndexSegmentResult *const *results, size_t result_count, const LanceOptimizeIndicesOptions *options)
 
LANCE_API int32_t lance_dataset_drop_columns (LanceDataset *dataset, const char *const *columns, size_t num_columns)
 
LANCE_API int32_t lance_dataset_alter_columns (LanceDataset *dataset, const LanceColumnAlteration *alterations, size_t num_alterations)
 
LANCE_API int32_t lance_dataset_add_columns_sql (LanceDataset *dataset, const LanceSqlColumn *columns, size_t num_columns, uint64_t batch_size)
 
LANCE_API int32_t lance_dataset_add_columns_nulls (LanceDataset *dataset, const struct ArrowSchema *schema)
 
LANCE_API int32_t lance_dataset_add_columns_stream (LanceDataset *dataset, struct ArrowArrayStream *stream, uint64_t batch_size)
 
LANCE_API int32_t lance_dataset_schema (const LanceDataset *dataset, struct ArrowSchema *out)
 
LANCE_API int32_t lance_dataset_schema_clone (const LanceDataset *dataset, LanceSchema **out_schema)
 
LANCE_API void lance_schema_close (LanceSchema *schema)
 
LANCE_NODISCARD LANCE_API LanceSchema * lance_schema_clone (const LanceSchema *schema)
 
LANCE_API int32_t lance_schema_from_arrow (const struct ArrowSchema *schema, LanceSchema **out_schema)
 
LANCE_API int32_t lance_schema_to_arrow (const LanceSchema *schema, struct ArrowSchema *out)
 
LANCE_API int32_t lance_schema_project (const LanceSchema *schema, const char *const *columns, size_t num_columns, LanceSchema **out_schema)
 
LANCE_API int32_t lance_schema_field_id (const LanceSchema *schema, const char *column, int32_t *out_field_id)
 
LANCE_API uint64_t lance_dataset_fragment_count (const LanceDataset *dataset)
 
LANCE_API int32_t lance_dataset_fragment_ids (const LanceDataset *dataset, uint64_t *out_ids)
 
LANCE_NODISCARD LANCE_API LanceFragment * lance_dataset_open_fragment (const LanceDataset *dataset, uint64_t fragment_id)
 
LANCE_NODISCARD LANCE_API LanceFragment * lance_fragment_new (uint64_t fragment_id, const LanceDataFile *const *data_files, size_t data_file_count, const uint64_t *physical_rows)
 
LANCE_API void lance_fragment_close (LanceFragment *fragment)
 
LANCE_API uint64_t lance_fragment_id (const LanceFragment *fragment)
 
LANCE_API uint64_t lance_fragment_data_file_count (const LanceFragment *fragment)
 
LANCE_API int32_t lance_fragment_is_bound (const LanceFragment *fragment, bool *out_is_bound)
 
LANCE_API int32_t lance_fragment_read_version (const LanceFragment *fragment, uint64_t *out_version)
 
LANCE_API int32_t lance_fragment_data_file_at (const LanceFragment *fragment, size_t index, LanceDataFile **out_file)
 
LANCE_API int32_t lance_fragment_data_file_for_field (const LanceFragment *fragment, int32_t field_id, LanceDataFile **out_file)
 
LANCE_NODISCARD LANCE_API const char * lance_fragment_metadata_json (const LanceFragment *fragment)
 
LANCE_API int32_t lance_fragment_schema (const LanceFragment *fragment, struct ArrowSchema *out)
 
LANCE_API int32_t lance_fragment_schema_clone (const LanceFragment *fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_physical_rows (const LanceFragment *fragment, uint64_t *out_rows)
 
LANCE_API int32_t lance_fragment_deleted_rows (const LanceFragment *fragment, uint64_t *out_rows)
 
LANCE_API int32_t lance_fragment_logical_rows (const LanceFragment *fragment, uint64_t *out_rows)
 
LANCE_NODISCARD LANCE_API LanceScanner * lance_fragment_scan (const LanceFragment *fragment)
 
LANCE_API int32_t lance_fragment_take (const LanceFragment *fragment, const uint32_t *indices, size_t num_indices, const char *const *columns, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_fragment_overlay_writer_new (const LanceFragment *fragment, const LanceSchema *schema, LanceFragmentOverlayWriter **out_writer)
 
LANCE_API int32_t lance_fragment_overlay_writer_write_batch (LanceFragmentOverlayWriter *writer, const LanceBatch *batch)
 
LANCE_API int32_t lance_fragment_overlay_writer_finish (LanceFragmentOverlayWriter *writer, LanceDataOverlayGroup **out_group)
 
LANCE_API void lance_fragment_overlay_writer_abort (LanceFragmentOverlayWriter *writer)
 
LANCE_API void lance_fragment_overlay_writer_close (LanceFragmentOverlayWriter *writer)
 
LANCE_API int32_t lance_fragment_count_rows (const LanceFragment *fragment, const char *filter, uint64_t *out_rows)
 
LANCE_API int32_t lance_fragment_delete (const LanceFragment *fragment, const char *predicate, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_fragment_add_columns_sql (const LanceFragment *fragment, const LanceSqlColumn *columns, size_t column_count, const uint32_t *batch_size, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_add_columns_nulls (const LanceFragment *fragment, const struct ArrowSchema *columns, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_add_columns_stream (const LanceFragment *fragment, struct ArrowArrayStream *stream, const uint32_t *batch_size, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_add_columns_batch_udf (const LanceFragment *fragment, const LanceBatchUDF *udf, const char *const *read_columns, const uint32_t *batch_size, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_add_columns_batch_udf_v2 (const LanceFragment *fragment, const LanceBatchUDFV2 *udf, const char *const *read_columns, const uint32_t *batch_size, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_merge_columns (const LanceFragment *fragment, struct ArrowArrayStream *stream, const char *left_on, const char *right_on, LanceFragment **out_fragment, LanceSchema **out_schema)
 
LANCE_API int32_t lance_fragment_update_columns (const LanceFragment *fragment, struct ArrowArrayStream *stream, const char *left_on, const char *right_on, LanceFragmentUpdateColumnsResult **out_result)
 
LANCE_API int32_t lance_fragment_write_columns (const LanceFragment *fragment, const LanceSchema *schema, struct ArrowArrayStream *stream, LanceDataReplacementGroup **out_group)
 
LANCE_API int32_t lance_fragment_write_column_with_version (const LanceFragment *fragment, const LanceSchema *schema, struct ArrowArrayStream *stream, int32_t file_version, LanceDataReplacementGroup **out_group)
 
LANCE_API int32_t lance_fragment_delete_rows (const LanceFragment *fragment, const uint32_t *offsets, size_t offset_count, LanceFragment **out_fragment)
 
LANCE_API void lance_fragment_update_columns_result_close (LanceFragmentUpdateColumnsResult *result)
 
LANCE_API int32_t lance_fragment_update_columns_result_fragment (const LanceFragmentUpdateColumnsResult *result, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_fragment_update_columns_result_fields_modified_count (const LanceFragmentUpdateColumnsResult *result, uint64_t *out_count)
 
LANCE_API int32_t lance_fragment_update_columns_result_fields_modified_at (const LanceFragmentUpdateColumnsResult *result, size_t index, uint32_t *out_field_id)
 
LANCE_API int32_t lance_fragment_update_columns_result_matched_offset_count (const LanceFragmentUpdateColumnsResult *result, uint64_t *out_count)
 
LANCE_API int32_t lance_fragment_update_columns_result_matched_offset_at (const LanceFragmentUpdateColumnsResult *result, size_t index, uint32_t *out_offset)
 
LANCE_API int32_t lance_fragment_update_columns_result_matched_offsets_serialize (const LanceFragmentUpdateColumnsResult *result, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API int32_t lance_fragment_update_columns_result_matched_offsets (const LanceFragmentUpdateColumnsResult *result, uint32_t *out_offsets, size_t count)
 
LANCE_API int32_t lance_dataset_take (const LanceDataset *dataset, const uint64_t *indices, size_t num_indices, const char *const *columns, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_dataset_take_rows (const LanceDataset *dataset, const uint64_t *row_ids, size_t num_row_ids, const char *const *columns, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_dataset_take_blobs (const LanceDataset *dataset, const uint64_t *row_ids, size_t num_row_ids, const char *column, LanceBlobFile **out)
 
LANCE_API int32_t lance_dataset_take_blobs_by_indices (const LanceDataset *dataset, const uint64_t *indices, size_t num_indices, const char *column, LanceBlobFile **out)
 
LANCE_API int32_t lance_dataset_take_blobs_by_addresses (const LanceDataset *dataset, const uint64_t *row_addresses, size_t num_row_addresses, const char *column, LanceBlobFile **out)
 
LANCE_API uint64_t lance_blob_file_size (const LanceBlobFile *blob)
 
LANCE_API int32_t lance_blob_file_read (LanceBlobFile *blob, uint8_t *dst, size_t dst_len)
 
LANCE_API int32_t lance_blob_file_read_up_to (LanceBlobFile *blob, uint8_t *dst, size_t len, size_t *bytes_read)
 
LANCE_API int32_t lance_blob_file_read_range (const LanceBlobFile *blob, uint64_t offset, uint8_t *dst, size_t len)
 
LANCE_API int32_t lance_blob_file_read_ranges (const LanceBlobFile *blob, const LanceBlobRange *ranges, size_t num_ranges, uint8_t *const *destinations, const size_t *destination_lens)
 
LANCE_API int32_t lance_blob_file_seek (LanceBlobFile *blob, uint64_t pos)
 
LANCE_API int32_t lance_blob_file_tell (const LanceBlobFile *blob, uint64_t *pos)
 
LANCE_API int32_t lance_blob_file_set_buffer_size (LanceBlobFile *blob, size_t buffer_size)
 
LANCE_API int32_t lance_blob_file_mark_closed (LanceBlobFile *blob)
 
LANCE_API int32_t lance_blob_file_is_closed (const LanceBlobFile *blob, bool *out_closed)
 
LANCE_API void lance_blob_file_close (LanceBlobFile *blob)
 
LANCE_API int32_t lance_blob_field (const char *name, bool nullable, struct ArrowSchema *out)
 
LANCE_API int32_t lance_blob_field_with_options (const char *name, bool nullable, const LanceBlobFieldOptions *options, struct ArrowSchema *out)
 
LANCE_NODISCARD LANCE_API LanceBlobDescriptorArrayBuilder * lance_blob_descriptor_array_builder_new (const char *column)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_field (const LanceBlobDescriptorArrayBuilder *builder, struct ArrowSchema *out)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_inline (LanceBlobDescriptorArrayBuilder *builder, const uint8_t *data, size_t len)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_null (LanceBlobDescriptorArrayBuilder *builder)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_packed (LanceBlobDescriptorArrayBuilder *builder, uint32_t blob_id, uint64_t offset, uint64_t length)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_extend_packed (LanceBlobDescriptorArrayBuilder *builder, uint32_t blob_id, const LanceBlobRange *ranges, size_t num_ranges)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_dedicated (LanceBlobDescriptorArrayBuilder *builder, uint32_t blob_id, uint64_t length)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_managed (LanceBlobDescriptorArrayBuilder *builder, const char *uri, uint64_t offset, uint64_t length, bool has_base_id, uint32_t base_id)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_append_external (LanceBlobDescriptorArrayBuilder *builder, uint32_t base_id, const char *uri, uint64_t offset, uint64_t length)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_push_external (LanceBlobDescriptorArrayBuilder *builder, const char *uri, bool has_range, uint64_t offset, uint64_t length)
 
LANCE_API int32_t lance_blob_descriptor_array_builder_finish (LanceBlobDescriptorArrayBuilder *builder, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API void lance_blob_descriptor_array_builder_close (LanceBlobDescriptorArrayBuilder *builder)
 
LANCE_API int32_t lance_dataset_read_blobs (const LanceDataset *dataset, const char *column, int32_t selector, const uint64_t *rows, size_t num_rows, const LanceBlobReadOptions *options, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_dataset_read_blob_ranges (const LanceDataset *dataset, const char *column, int32_t selector, const LanceBlobRangeRequest *requests, size_t num_requests, const LanceBlobReadOptions *options, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_write_fragments (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, const char *const *storage_opts)
 
LANCE_API int32_t lance_dataset_create_vector_index (LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexParams *params, bool replace)
 
LANCE_API int32_t lance_dataset_create_vector_index_with_progress (LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexParams *params, LanceIndexBuildProgressCallback callback, void *callback_ctx, bool replace)
 
LANCE_API int32_t lance_dataset_create_vector_index_with_options (LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexOptions *options, bool replace)
 
LANCE_API int32_t lance_dataset_create_vector_index_with_options_and_progress (LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexOptions *options, LanceIndexBuildProgressCallback callback, void *callback_ctx, bool replace)
 
LANCE_API int32_t lance_dataset_create_scalar_index (LanceDataset *dataset, const char *column, const char *index_name, LanceScalarIndexType index_type, const char *params_json, bool replace)
 
LANCE_API int32_t lance_dataset_create_scalar_index_with_progress (LanceDataset *dataset, const char *column, const char *index_name, LanceScalarIndexType index_type, const char *params_json, LanceIndexBuildProgressCallback callback, void *callback_ctx, bool replace)
 
LANCE_API int32_t lance_dataset_create_scalar_index_with_options (LanceDataset *dataset, const char *column, const char *index_name, LanceScalarIndexType index_type, const char *params_json, const LanceScalarIndexOptions *options, bool replace)
 
LANCE_API int32_t lance_dataset_create_scalar_index_with_options_and_progress (LanceDataset *dataset, const char *column, const char *index_name, LanceScalarIndexType index_type, const char *params_json, const LanceScalarIndexOptions *options, LanceIndexBuildProgressCallback callback, void *callback_ctx, bool replace)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_scalar (const LanceDataset *dataset, const char *column, const char *index_name, int32_t index_type, const char *params_json, const LanceIndexSegmentBuildOptions *options)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_scalar_with_options (const LanceDataset *dataset, const char *column, const char *index_name, int32_t index_type, const char *params_json, const LanceScalarIndexOptions *scalar_options, const LanceIndexSegmentBuildOptions *options)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_vector (const LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexSegmentParams *params, const LanceIndexSegmentBuildOptions *options)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_vector_with_options (const LanceDataset *dataset, const char *column, const char *index_name, const LanceVectorIndexOptions *options, const LanceVectorIndexSegmentScope *scope)
 
LANCE_API int32_t lance_index_train_ivf_model (const LanceDataset *dataset, const char *column, uint32_t num_partitions, int32_t metric, const uint32_t *fragment_ids, size_t fragment_count, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API int32_t lance_index_train_ivf_model_with_options (const LanceDataset *dataset, const char *column, uint32_t num_partitions, int32_t metric, const uint32_t *fragment_ids, size_t fragment_count, const LanceIndexTrainerOptions *options, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API int32_t lance_index_train_pq_model (const LanceDataset *dataset, const char *column, uint32_t num_sub_vectors, uint32_t num_bits, int32_t metric, const uint32_t *fragment_ids, size_t fragment_count, struct ArrowArray *ivf_centroids, const struct ArrowSchema *ivf_centroids_schema, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API int32_t lance_index_train_pq_model_with_options (const LanceDataset *dataset, const char *column, uint32_t num_sub_vectors, uint32_t num_bits, int32_t metric, const uint32_t *fragment_ids, size_t fragment_count, struct ArrowArray *ivf_centroids, const struct ArrowSchema *ivf_centroids_schema, const LanceIndexTrainerOptions *options, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_NODISCARD LANCE_API LanceIvfModel * lance_dataset_get_ivf_model (const LanceDataset *dataset, const char *index_name)
 
LANCE_API void lance_ivf_model_free (LanceIvfModel *model)
 
LANCE_API bool lance_ivf_model_has_centroids (const LanceIvfModel *model)
 
LANCE_API int32_t lance_ivf_model_export_centroids (const LanceIvfModel *model, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API uint64_t lance_ivf_model_num_partitions (const LanceIvfModel *model)
 
LANCE_API uint64_t lance_ivf_model_dimension (const LanceIvfModel *model)
 
LANCE_API uint64_t lance_ivf_model_partition_size (const LanceIvfModel *model, uint64_t partition_id)
 
LANCE_API int32_t lance_dataset_read_index_partition (const LanceDataset *dataset, const char *index_name, uint64_t partition_id, bool with_vector, struct ArrowArrayStream *out_stream)
 
LANCE_NODISCARD LANCE_API const char * lance_index_build_rq_model (uint32_t dimension, uint32_t num_bits)
 
LANCE_API int32_t lance_index_segment_builder_execute_uncommitted (LanceIndexSegmentBuilder *builder, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API int32_t lance_index_segment_builder_set_progress_callback (LanceIndexSegmentBuilder *builder, LanceIndexBuildProgressCallback callback, void *callback_ctx)
 
LANCE_API int32_t lance_dataset_merge_index_metadata (const LanceDataset *dataset, const uint8_t index_uuid[16], const char *index_type, bool has_batch_readhead, size_t batch_readhead, LanceIndexBuildProgressCallback callback, void *callback_ctx)
 
LANCE_API void lance_free_bytes (uint8_t *bytes)
 
LANCE_API void lance_index_segment_builder_free (LanceIndexSegmentBuilder *builder)
 
LANCE_API int32_t lance_index_segment_metadata_parse (const uint8_t *bytes, size_t len, LanceIndexSegmentMetadata **out_metadata)
 
LANCE_API int32_t lance_index_segment_metadata_uuid (const LanceIndexSegmentMetadata *metadata, uint8_t *out_uuid)
 
LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_name (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API uint64_t lance_index_segment_metadata_dataset_version (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_index_segment_metadata_index_version (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_index_segment_metadata_index_type (const LanceIndexSegmentMetadata *metadata)
 
LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_index_details_type_url (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API size_t lance_index_segment_metadata_field_count (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_index_segment_metadata_field_ids (const LanceIndexSegmentMetadata *metadata, int32_t *out_field_ids, size_t capacity, size_t *out_count)
 
LANCE_API size_t lance_index_segment_metadata_fragment_count (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_index_segment_metadata_fragment_ids (const LanceIndexSegmentMetadata *metadata, uint32_t *out_fragment_ids, size_t capacity, size_t *out_count)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_metadata_clone (const LanceIndexSegmentMetadata *metadata)
 
LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_metadata_clone_with_fragment_ids (const LanceIndexSegmentMetadata *metadata, bool has_fragment_ids, const uint32_t *fragment_ids, size_t fragment_count)
 
LANCE_API int32_t lance_index_segment_metadata_encode (const LanceIndexSegmentMetadata *metadata, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API size_t lance_index_segment_metadata_covering_field_count (const LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_index_segment_metadata_covering_field_id_at (const LanceIndexSegmentMetadata *metadata, size_t index, int32_t *out_field_id)
 
LANCE_NODISCARD LANCE_API const uint8_t * lance_index_segment_metadata_index_details_value (const LanceIndexSegmentMetadata *metadata, size_t *out_len)
 
LANCE_API size_t lance_index_segment_metadata_file_count (const LanceIndexSegmentMetadata *metadata)
 
LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_file_path_at (const LanceIndexSegmentMetadata *metadata, size_t index)
 
LANCE_API int32_t lance_index_segment_metadata_file_size_at (const LanceIndexSegmentMetadata *metadata, size_t index, uint64_t *out_size)
 
LANCE_API int32_t lance_index_segment_metadata_created_at (const LanceIndexSegmentMetadata *metadata, LanceOptionalTimestamp *out_timestamp)
 
LANCE_API int32_t lance_index_segment_metadata_base_id (const LanceIndexSegmentMetadata *metadata, bool *out_is_set, uint32_t *out_base_id)
 
LANCE_API void lance_index_segment_metadata_free (LanceIndexSegmentMetadata *metadata)
 
LANCE_API int32_t lance_dataset_commit_index_segments (LanceDataset *dataset, const char *index_name, const char *column, const uint8_t *const *segment_metadata_bytes, const size_t *segment_metadata_lens, size_t segment_count)
 
LANCE_API int32_t lance_dataset_merge_index_segments (const LanceDataset *dataset, const uint8_t *const *segment_metadata_bytes, const size_t *segment_metadata_lens, size_t segment_count, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API int32_t lance_dataset_prewarm_index_with_options (const LanceDataset *dataset, const char *index_name, const LanceIndexPrewarmOptions *options)
 
LANCE_API int32_t lance_dataset_prewarm_index (const LanceDataset *dataset, const char *index_name)
 
LANCE_API int32_t lance_dataset_drop_index (LanceDataset *dataset, const char *name)
 
LANCE_API uint64_t lance_dataset_index_count (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_index_list_json (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_describe_indices_json (const LanceDataset *dataset)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_index_statistics_json (LanceDataset *dataset, const char *index_name)
 
LANCE_NODISCARD LANCE_API const char * lance_dataset_index_segments_json (const LanceDataset *dataset)
 
LANCE_API uint64_t lance_dataset_index_segment_count (const LanceDataset *dataset, const char *index_name)
 
LANCE_API int32_t lance_dataset_index_segments (const LanceDataset *dataset, const char *index_name, uint8_t *out_uuids, size_t capacity, uint64_t *out_count)
 
LANCE_API int32_t lance_scanner_nearest (LanceScanner *scanner, const char *column, const void *query_data, size_t query_len, LanceDataType element_type, uint32_t k)
 
LANCE_API int32_t lance_scanner_set_distance_range (LanceScanner *scanner, const float *lower_bound, const float *upper_bound)
 
LANCE_API int32_t lance_scanner_nearest_batch (LanceScanner *scanner, const char *column, const void *query_data, size_t dimension, size_t num_queries, LanceDataType element_type, uint32_t k)
 
LANCE_API int32_t lance_scanner_nearest_multivector (LanceScanner *scanner, const char *column, const void *query_data, size_t dimension, size_t num_vectors, LanceDataType element_type, uint32_t k)
 
LANCE_API int32_t lance_scanner_set_nprobes (LanceScanner *scanner, uint32_t nprobes)
 
LANCE_API int32_t lance_scanner_set_minimum_nprobes (LanceScanner *scanner, uint32_t minimum_nprobes)
 
LANCE_API int32_t lance_scanner_set_maximum_nprobes (LanceScanner *scanner, uint32_t maximum_nprobes)
 
LANCE_API int32_t lance_scanner_set_search_effort (LanceScanner *scanner, double effort)
 
LANCE_API int32_t lance_scanner_set_approx_mode (LanceScanner *scanner, LanceApproxMode approx_mode)
 
LANCE_API int32_t lance_scanner_set_query_parallelism (LanceScanner *scanner, int32_t query_parallelism)
 
LANCE_API int32_t lance_scanner_set_refine_factor (LanceScanner *scanner, uint32_t f)
 
LANCE_API int32_t lance_scanner_set_ef (LanceScanner *scanner, uint32_t e)
 
LANCE_API int32_t lance_scanner_set_metric (LanceScanner *scanner, LanceMetricType metric)
 
LANCE_API int32_t lance_scanner_set_use_index (LanceScanner *scanner, bool enable)
 
LANCE_API int32_t lance_scanner_set_fast_search (LanceScanner *scanner, bool enable)
 
LANCE_API int32_t lance_scanner_set_prefilter (LanceScanner *scanner, bool enable)
 
LANCE_API int32_t lance_scanner_set_index_segments (LanceScanner *scanner, const uint8_t *segment_uuids, size_t len)
 
LANCE_API int32_t lance_scanner_set_scalar_index_segment (LanceScanner *scanner, const uint8_t *segment_uuid)
 
LANCE_API int32_t lance_scanner_set_scalar_index_auto_selection (LanceScanner *scanner, bool enabled)
 
LANCE_API void lance_fts_query_match_options_init (LanceFtsMatchOptions *options)
 
LANCE_API void lance_fts_query_phrase_options_init (LanceFtsPhraseOptions *options)
 
LANCE_API void lance_fts_query_multi_match_options_init (LanceFtsMultiMatchOptions *options)
 
LANCE_API void lance_fts_query_combined_fields_options_init (LanceFtsCombinedFieldsOptions *options)
 
LANCE_API void lance_fts_query_boost_options_init (LanceFtsBoostOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_match_new (const char *terms, const char *column, const LanceFtsMatchOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_phrase_new (const char *terms, const char *column, const LanceFtsPhraseOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_multi_match_new (const char *terms, const char *const *columns, size_t column_count, const LanceFtsMultiMatchOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_combined_fields_new (const char *terms, const char *const *columns, size_t column_count, const LanceFtsCombinedFieldsOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_boolean_new (const int32_t *occurs, const LanceFtsQuery *const *queries, size_t query_count)
 
LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_boost_new (const LanceFtsQuery *positive, const LanceFtsQuery *negative, const LanceFtsBoostOptions *options)
 
LANCE_API void lance_fts_query_close (LanceFtsQuery *query)
 
 LANCE_DEPRECATED ("Use lance_dataset_prepare_fts_match_query() to select the Match operator explicitly") LANCE_NODISCARD LANCE_API LanceFtsQueryContext *lance_dataset_prepare_fts_query(const LanceDataset *dataset
 
LANCE_NODISCARD LANCE_API LanceFtsQueryContext * lance_dataset_prepare_fts_match_query (const LanceDataset *dataset, const char *column, const char *query, int32_t match_operator, uint32_t max_fuzzy_distance, int32_t coverage_mode)
 
LANCE_NODISCARD LANCE_API LanceFtsQueryContext * lance_dataset_prepare_fts_phrase_query (const LanceDataset *dataset, const char *column, const char *query, int32_t slop, int32_t coverage_mode)
 
LANCE_API void lance_fts_query_context_close (LanceFtsQueryContext *context)
 
LANCE_API int32_t lance_scanner_full_text_search (LanceScanner *scanner, const char *query, const char *const *columns, uint32_t max_fuzzy_distance)
 
LANCE_API int32_t lance_scanner_set_fts_query (LanceScanner *scanner, const LanceFtsQuery *query)
 
LANCE_API int32_t lance_scanner_set_fts_query_context (LanceScanner *scanner, const LanceFtsQueryContext *context)
 
LANCE_API int32_t lance_scanner_set_minhash_query (LanceScanner *scanner, const char *column, const char *text)
 
LANCE_API int32_t lance_scanner_set_fts_index_segments (LanceScanner *scanner, const uint8_t *segment_uuids, size_t len)
 
LANCE_API int32_t lance_dataset_write (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const char *const *storage_opts, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_params (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteParams *params, const char *const *storage_opts, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_options (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteOptions *options, const char *const *storage_opts, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_accessor (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceStorageOptionsAccessor *storage_options_accessor, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_params_and_accessor (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteParams *params, const LanceStorageOptionsAccessor *storage_options_accessor, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_options_and_accessor (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteOptions *options, const LanceStorageOptionsAccessor *storage_options_accessor, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_with_options_with_commit_lock (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteOptions *options, const LanceStorageOptionsAccessor *storage_accessor, const LanceSession *session, const LanceCommitLock *commit_lock, LanceDataset **out_dataset)
 
LANCE_NODISCARD LANCE_API LanceNativeWriteOptions * lance_native_write_options_new (const LanceNativeWriteOptionsSpec *spec)
 
LANCE_API void lance_native_write_options_close (LanceNativeWriteOptions *options)
 
LANCE_API int32_t lance_dataset_write_with_native_options (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceNativeWriteOptions *options, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_native_options (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceNativeWriteOptions *options, LanceTransaction **out_transaction)
 
LANCE_API int32_t lance_fragment_create (const char *dataset_uri, uint64_t fragment_id, const LanceFragmentCreateOptions *options, struct ArrowArrayStream *stream, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_fragment_create_many (const char *dataset_uri, const LanceFragmentCreateOptions *options, struct ArrowArrayStream *stream, LanceFragment ***out_fragments, size_t *out_count)
 
LANCE_API void lance_fragment_array_free (LanceFragment **fragments, size_t count)
 
LANCE_API int32_t lance_fragment_create_from_file (const LanceDataset *dataset, const char *filename, uint64_t fragment_id, const uint64_t *physical_rows, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_dataset_create_data_file (const LanceDataset *dataset, const char *path, const uint32_t *base_id, LanceDataFile **out_file)
 
LANCE_API void lance_data_file_close (LanceDataFile *file)
 
LANCE_NODISCARD LANCE_API LanceDataFile * lance_data_file_clone (const LanceDataFile *file)
 
LANCE_NODISCARD LANCE_API const char * lance_data_file_path (const LanceDataFile *file)
 
LANCE_API size_t lance_data_file_field_count (const LanceDataFile *file)
 
LANCE_API int32_t lance_data_file_field_id_at (const LanceDataFile *file, size_t index, int32_t *out_field_id)
 
LANCE_API size_t lance_data_file_column_index_count (const LanceDataFile *file)
 
LANCE_API int32_t lance_data_file_column_index_at (const LanceDataFile *file, size_t index, int32_t *out_column_index)
 
LANCE_API int32_t lance_data_file_file_version (const LanceDataFile *file, uint32_t *out_major, uint32_t *out_minor)
 
LANCE_API int32_t lance_data_file_file_size (const LanceDataFile *file, bool *out_is_set, uint64_t *out_size)
 
LANCE_API int32_t lance_data_file_base_id (const LanceDataFile *file, bool *out_is_set, uint32_t *out_base_id)
 
LANCE_NODISCARD LANCE_API LanceUpdateMap * lance_update_map_new (const char *const *keys, const char *const *values, size_t count, bool replace)
 
LANCE_NODISCARD LANCE_API LanceUpdateMap * lance_update_map_clone (const LanceUpdateMap *map)
 
LANCE_API void lance_update_map_close (LanceUpdateMap *map)
 
LANCE_API size_t lance_update_map_count (const LanceUpdateMap *map)
 
LANCE_NODISCARD LANCE_API const char * lance_update_map_key_at (const LanceUpdateMap *map, size_t index)
 
LANCE_API int32_t lance_update_map_value_at (const LanceUpdateMap *map, size_t index, bool *out_has_value, const char **out_value)
 
LANCE_API bool lance_update_map_replace (const LanceUpdateMap *map)
 
LANCE_API int32_t lance_dataset_write_uncommitted_stream (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceUncommittedWriteOptions *options, const char *const *storage_opts, const LanceSession *session, LanceTransaction **out_transaction)
 
LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_accessor (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceUncommittedWriteOptions *options, const LanceStorageOptionsAccessor *storage_options_accessor, const LanceSession *session, LanceTransaction **out_transaction)
 
LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_commit_lock (const char *uri, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceUncommittedWriteOptions *options, const LanceStorageOptionsAccessor *storage_accessor, const LanceSession *session, const LanceCommitLock *commit_lock, LanceTransaction **out_transaction)
 
LANCE_API void lance_transaction_close (LanceTransaction *transaction)
 
LANCE_API void lance_operation_close (LanceOperation *operation)
 
LANCE_API void lance_data_replacement_group_close (LanceDataReplacementGroup *group)
 
LANCE_NODISCARD LANCE_API LanceDataReplacementGroup * lance_data_replacement_group_new (uint64_t fragment_id, const LanceDataFile *new_file)
 
LANCE_NODISCARD LANCE_API LanceDataReplacementGroup * lance_data_replacement_group_clone (const LanceDataReplacementGroup *group)
 
LANCE_API uint64_t lance_data_replacement_group_fragment_id (const LanceDataReplacementGroup *group)
 
LANCE_API int32_t lance_data_replacement_group_file (const LanceDataReplacementGroup *group, LanceDataFile **out_file)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_data_replacement_new (const LanceDataReplacementGroup *const *replacements, size_t replacement_count)
 
LANCE_NODISCARD LANCE_API LanceDataOverlayFile * lance_data_overlay_file_new (const LanceDataFile *data_file, int32_t coverage_kind, const uint8_t *const *bitmaps, const size_t *bitmap_lens, size_t bitmap_count, uint64_t committed_version)
 
LANCE_API void lance_data_overlay_file_close (LanceDataOverlayFile *file)
 
LANCE_NODISCARD LANCE_API LanceDataOverlayFile * lance_data_overlay_file_clone (const LanceDataOverlayFile *file)
 
LANCE_NODISCARD LANCE_API LanceDataFile * lance_data_overlay_file_data_file (const LanceDataOverlayFile *file)
 
LANCE_API int32_t lance_data_overlay_file_coverage_kind (const LanceDataOverlayFile *file, int32_t *out_kind)
 
LANCE_API int32_t lance_data_overlay_file_bitmap_count (const LanceDataOverlayFile *file, uint64_t *out_count)
 
LANCE_API int32_t lance_data_overlay_file_bitmap_at (const LanceDataOverlayFile *file, size_t index, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API int32_t lance_data_overlay_file_committed_version (const LanceDataOverlayFile *file, uint64_t *out_version)
 
LANCE_NODISCARD LANCE_API LanceDataOverlayGroup * lance_data_overlay_group_new (uint64_t fragment_id, const LanceDataOverlayFile *const *overlays, size_t overlay_count)
 
LANCE_API void lance_data_overlay_group_close (LanceDataOverlayGroup *group)
 
LANCE_NODISCARD LANCE_API LanceDataOverlayGroup * lance_data_overlay_group_clone (const LanceDataOverlayGroup *group)
 
LANCE_API int32_t lance_data_overlay_group_fragment_id (const LanceDataOverlayGroup *group, uint64_t *out_fragment_id)
 
LANCE_API int32_t lance_data_overlay_group_overlay_count (const LanceDataOverlayGroup *group, uint64_t *out_count)
 
LANCE_API int32_t lance_data_overlay_group_overlay_at (const LanceDataOverlayGroup *group, size_t index, LanceDataOverlayFile **out_overlay)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_data_overlay_new (const LanceDataOverlayGroup *const *groups, size_t group_count)
 
LANCE_API int32_t lance_transaction_read_version (const LanceTransaction *transaction, uint64_t *out_read_version)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_delete_new (const LanceFragment *const *updated_fragments, size_t updated_fragment_count, const uint64_t *deleted_fragment_ids, size_t deleted_fragment_count, const char *predicate)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_append_new (const LanceFragment *const *fragments, size_t fragment_count)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_overwrite_new (const LanceSchema *schema, const LanceFragment *const *fragments, size_t fragment_count, const LanceStringMap *config_upsert_values, const LanceBasePathList *initial_bases)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_merge_new (const LanceSchema *schema, const LanceFragment *const *fragments, size_t fragment_count, bool preserves_nullability)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_clone_new (bool is_shallow, const char *ref_name, uint64_t ref_version, const char *ref_path, const char *branch_name)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_config_new (const LanceUpdateConfigOperationOptions *options)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_restore_new (uint64_t version)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_reserve_fragments_new (uint32_t num_fragments)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_bases_new (const LanceBasePath *new_bases, size_t new_base_count)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_create_index_new (const LanceIndexSegmentMetadata *const *new_indices, size_t new_index_count, const LanceIndexSegmentMetadata *const *removed_indices, size_t removed_index_count)
 
LANCE_NODISCARD LANCE_API LanceTransaction * lance_transaction_new (uint64_t read_version, const LanceOperation *operation, const LanceTransactionOptions *options)
 
LANCE_NODISCARD LANCE_API const char * lance_transaction_uuid (const LanceTransaction *transaction)
 
LANCE_API int32_t lance_transaction_tag (const LanceTransaction *transaction, const char **out_tag)
 
LANCE_API int32_t lance_transaction_has_properties (const LanceTransaction *transaction, bool *out_has_properties)
 
LANCE_API int32_t lance_transaction_property_count (const LanceTransaction *transaction, uint64_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_transaction_property_key_at (const LanceTransaction *transaction, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_transaction_property_value_at (const LanceTransaction *transaction, size_t index)
 
LANCE_API int32_t lance_transaction_operation (const LanceTransaction *transaction, LanceOperation **out_operation)
 
LANCE_API int32_t lance_operation_kind (const LanceOperation *operation, LanceOperationKind *out_kind)
 
LANCE_API int32_t lance_operation_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_append_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_append_fragment_at (const LanceOperation *operation, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_operation_restore_version (const LanceOperation *operation, uint64_t *out_version)
 
LANCE_API int32_t lance_operation_reserve_fragments_count (const LanceOperation *operation, uint32_t *out_count)
 
LANCE_API int32_t lance_operation_update_bases_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_bases_at (const LanceOperation *operation, size_t index, LanceBasePathView *out_base)
 
LANCE_API int32_t lance_operation_overwrite_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_overwrite_fragment_at (const LanceOperation *operation, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_operation_overwrite_schema_clone (const LanceOperation *operation, LanceSchema **out_schema)
 
LANCE_API int32_t lance_operation_overwrite_has_config_upsert_values (const LanceOperation *operation, bool *out_has)
 
LANCE_API int32_t lance_operation_overwrite_config_upsert_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_operation_overwrite_config_upsert_key_at (const LanceOperation *operation, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_operation_overwrite_config_upsert_value_at (const LanceOperation *operation, size_t index)
 
LANCE_API int32_t lance_operation_overwrite_has_initial_bases (const LanceOperation *operation, bool *out_has)
 
LANCE_API int32_t lance_operation_overwrite_initial_base_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_overwrite_initial_base_at (const LanceOperation *operation, size_t index, LanceBasePathView *out_base)
 
LANCE_API int32_t lance_operation_merge_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_merge_fragment_at (const LanceOperation *operation, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_operation_merge_schema_clone (const LanceOperation *operation, LanceSchema **out_schema)
 
LANCE_API int32_t lance_operation_merge_preserves_nullability (const LanceOperation *operation, bool *out_value)
 
LANCE_API int32_t lance_operation_project_schema_clone (const LanceOperation *operation, LanceSchema **out_schema)
 
LANCE_API int32_t lance_operation_project_preserves_nullability (const LanceOperation *operation, bool *out_value)
 
LANCE_API int32_t lance_operation_clone_is_shallow (const LanceOperation *operation, bool *out_value)
 
LANCE_API int32_t lance_operation_clone_ref_name (const LanceOperation *operation, bool *out_present, const char **out_value)
 
LANCE_API int32_t lance_operation_clone_ref_version (const LanceOperation *operation, uint64_t *out_version)
 
LANCE_NODISCARD LANCE_API const char * lance_operation_clone_ref_path (const LanceOperation *operation)
 
LANCE_API int32_t lance_operation_clone_branch_name (const LanceOperation *operation, bool *out_present, const char **out_value)
 
LANCE_API int32_t lance_operation_update_config_config_updates (const LanceOperation *operation, LanceUpdateMap **out_map)
 
LANCE_API int32_t lance_operation_update_config_table_metadata_updates (const LanceOperation *operation, LanceUpdateMap **out_map)
 
LANCE_API int32_t lance_operation_update_config_schema_metadata_updates (const LanceOperation *operation, LanceUpdateMap **out_map)
 
LANCE_API int32_t lance_operation_update_config_field_metadata_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_config_field_metadata_at (const LanceOperation *operation, size_t index, int32_t *out_field_id, LanceUpdateMap **out_map)
 
LANCE_API int32_t lance_operation_create_index_new_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_create_index_new_at (const LanceOperation *operation, size_t index, LanceIndexSegmentMetadata **out_metadata)
 
LANCE_API int32_t lance_operation_create_index_removed_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_create_index_removed_at (const LanceOperation *operation, size_t index, LanceIndexSegmentMetadata **out_metadata)
 
LANCE_API int32_t lance_operation_delete_updated_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_operation_delete_updated_fragment_metadata_json_at (const LanceOperation *operation, size_t index)
 
LANCE_API int32_t lance_operation_delete_deleted_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_delete_deleted_fragment_id_at (const LanceOperation *operation, size_t index, uint64_t *out_id)
 
LANCE_NODISCARD LANCE_API const char * lance_operation_delete_predicate (const LanceOperation *operation)
 
LANCE_API int32_t lance_operation_data_replacement_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_data_replacement_at (const LanceOperation *operation, size_t index, LanceDataReplacementGroup **out_group)
 
LANCE_API int32_t lance_operation_data_overlay_group_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_data_overlay_group_at (const LanceOperation *operation, size_t index, LanceDataOverlayGroup **out_group)
 
LANCE_API int32_t lance_operation_schema_clone (const LanceOperation *operation, LanceSchema **out_schema)
 
LANCE_API int32_t lance_operation_project_new (const LanceSchema *schema, bool preserves_nullability, LanceOperation **out_operation)
 
LANCE_API int32_t lance_operation_preserves_nullability (const LanceOperation *operation, bool *out_preserves_nullability)
 
LANCE_API int32_t lance_operation_schema (const LanceOperation *operation, struct ArrowSchema *out)
 
LANCE_API int32_t lance_transaction_to_proto (const LanceTransaction *transaction, uint8_t **out_bytes, size_t *out_len)
 
LANCE_NODISCARD LANCE_API LanceTransaction * lance_transaction_from_proto (const uint8_t *bytes, size_t len)
 
LANCE_API int32_t lance_dataset_read_transaction (const LanceDataset *dataset, LanceTransaction **out_transaction)
 
LANCE_API int32_t lance_dataset_read_transaction_by_version (const LanceDataset *dataset, uint64_t version, LanceTransaction **out_transaction)
 
LANCE_NODISCARD LANCE_API LanceUpdatedFragmentOffsets * lance_updated_fragment_offsets_new (const LanceFragmentOffsetsView *entries, size_t entry_count)
 
LANCE_NODISCARD LANCE_API LanceUpdatedFragmentOffsets * lance_updated_fragment_offsets_clone (const LanceUpdatedFragmentOffsets *offsets)
 
LANCE_API void lance_updated_fragment_offsets_close (LanceUpdatedFragmentOffsets *offsets)
 
LANCE_API int32_t lance_updated_fragment_offsets_count (const LanceUpdatedFragmentOffsets *offsets, uint64_t *out_count)
 
LANCE_API int32_t lance_updated_fragment_offsets_fragment_id_at (const LanceUpdatedFragmentOffsets *offsets, size_t index, uint64_t *out_fragment_id)
 
LANCE_API int32_t lance_updated_fragment_offsets_offset_count_at (const LanceUpdatedFragmentOffsets *offsets, size_t index, uint64_t *out_count)
 
LANCE_API int32_t lance_updated_fragment_offsets_copy_at (const LanceUpdatedFragmentOffsets *offsets, size_t index, uint32_t *out_offsets, size_t count)
 
LANCE_API int32_t lance_updated_fragment_offsets_offset_at (const LanceUpdatedFragmentOffsets *offsets, size_t index, size_t position, uint32_t *out_offset)
 
LANCE_API int32_t lance_key_existence_filter_from_proto (const uint8_t *bytes, size_t len, LanceKeyExistenceFilter **out_filter)
 
LANCE_NODISCARD LANCE_API LanceKeyExistenceFilter * lance_key_existence_filter_clone (const LanceKeyExistenceFilter *filter)
 
LANCE_API void lance_key_existence_filter_close (LanceKeyExistenceFilter *filter)
 
LANCE_API int32_t lance_key_existence_filter_kind (const LanceKeyExistenceFilter *filter, LanceKeyExistenceFilterKind *out_kind)
 
LANCE_API int32_t lance_key_existence_filter_field_id_count (const LanceKeyExistenceFilter *filter, uint64_t *out_count)
 
LANCE_API int32_t lance_key_existence_filter_field_id_at (const LanceKeyExistenceFilter *filter, size_t index, int32_t *out_field_id)
 
LANCE_API int32_t lance_key_existence_filter_exact_count (const LanceKeyExistenceFilter *filter, uint64_t *out_count)
 
LANCE_API int32_t lance_key_existence_filter_exact_key_at (const LanceKeyExistenceFilter *filter, size_t index, uint64_t *out_key)
 
LANCE_API int32_t lance_key_existence_filter_bloom (const LanceKeyExistenceFilter *filter, uint8_t **out_bitmap, size_t *out_bitmap_len, uint32_t *out_num_bits, uint64_t *out_number_of_items, double *out_probability)
 
LANCE_API int32_t lance_key_existence_filter_to_proto (const LanceKeyExistenceFilter *filter, uint8_t **out_bytes, size_t *out_len)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_new (const LanceUpdateOperationOptions *options)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_new_with_mem_wal_dir_id (const LanceUpdateOperationOptions *options, const char *mem_wal_dir_id)
 
LANCE_API int32_t lance_operation_update_removed_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_removed_fragment_id_at (const LanceOperation *operation, size_t index, uint64_t *out_fragment_id)
 
LANCE_API int32_t lance_operation_update_updated_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_updated_fragment_at (const LanceOperation *operation, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_operation_update_new_fragment_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_new_fragment_at (const LanceOperation *operation, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_operation_update_fields_modified_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_fields_modified_at (const LanceOperation *operation, size_t index, uint32_t *out_field_id)
 
LANCE_API int32_t lance_operation_update_compacted_sstable_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_compacted_sstable_at (const LanceOperation *operation, size_t index, LanceCompactedSsTable *out_sstable)
 
LANCE_API int32_t lance_operation_update_fields_for_preserving_frag_bitmap_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_fields_for_preserving_frag_bitmap_at (const LanceOperation *operation, size_t index, uint32_t *out_field_id)
 
LANCE_API int32_t lance_operation_update_mode (const LanceOperation *operation, bool *out_present, int32_t *out_mode)
 
LANCE_API int32_t lance_operation_update_inserted_rows_filter (const LanceOperation *operation, bool *out_present, LanceKeyExistenceFilter **out_filter)
 
LANCE_API int32_t lance_operation_update_updated_fragment_offsets (const LanceOperation *operation, bool *out_present, LanceUpdatedFragmentOffsets **out_offsets)
 
LANCE_API int32_t lance_operation_update_mem_wal_dir_id (const LanceOperation *operation, bool *out_present, const char **out_dir_id)
 
LANCE_NODISCARD LANCE_API LanceRewriteGroup * lance_rewrite_group_new (const LanceFragment *const *old_fragments, size_t old_fragment_count, const LanceFragment *const *new_fragments, size_t new_fragment_count)
 
LANCE_NODISCARD LANCE_API LanceRewriteGroup * lance_rewrite_group_clone (const LanceRewriteGroup *group)
 
LANCE_API void lance_rewrite_group_close (LanceRewriteGroup *group)
 
LANCE_API int32_t lance_rewrite_group_old_fragment_count (const LanceRewriteGroup *group, uint64_t *out_count)
 
LANCE_API int32_t lance_rewrite_group_old_fragment_at (const LanceRewriteGroup *group, size_t index, LanceFragment **out_fragment)
 
LANCE_API int32_t lance_rewrite_group_new_fragment_count (const LanceRewriteGroup *group, uint64_t *out_count)
 
LANCE_API int32_t lance_rewrite_group_new_fragment_at (const LanceRewriteGroup *group, size_t index, LanceFragment **out_fragment)
 
LANCE_NODISCARD LANCE_API LanceRewrittenIndex * lance_rewritten_index_new (const uint8_t *old_id, const uint8_t *new_id, const char *details_type_url, const uint8_t *details_value, size_t details_value_len, uint32_t index_version, bool has_index_files, const LanceIndexFile *index_files, size_t index_file_count)
 
LANCE_NODISCARD LANCE_API LanceRewrittenIndex * lance_rewritten_index_clone (const LanceRewrittenIndex *index)
 
LANCE_API void lance_rewritten_index_close (LanceRewrittenIndex *index)
 
LANCE_API int32_t lance_rewritten_index_old_id (const LanceRewrittenIndex *index, uint8_t *out_uuid)
 
LANCE_API int32_t lance_rewritten_index_new_id (const LanceRewrittenIndex *index, uint8_t *out_uuid)
 
LANCE_NODISCARD LANCE_API const char * lance_rewritten_index_details_type_url (const LanceRewrittenIndex *index)
 
LANCE_API int32_t lance_rewritten_index_details_value (const LanceRewrittenIndex *index, uint8_t **out_bytes, size_t *out_len)
 
LANCE_API int32_t lance_rewritten_index_version (const LanceRewrittenIndex *index, uint32_t *out_version)
 
LANCE_API int32_t lance_rewritten_index_has_files (const LanceRewrittenIndex *index, bool *out_present)
 
LANCE_API int32_t lance_rewritten_index_file_count (const LanceRewrittenIndex *index, uint64_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_rewritten_index_file_path_at (const LanceRewrittenIndex *index, size_t position)
 
LANCE_API int32_t lance_rewritten_index_file_size_at (const LanceRewrittenIndex *index, size_t position, uint64_t *out_size)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_rewrite_new (const LanceRewriteGroup *const *groups, size_t group_count, const LanceRewrittenIndex *const *rewritten_indices, size_t rewritten_index_count, const LanceIndexSegmentMetadata *frag_reuse_index)
 
LANCE_API int32_t lance_operation_rewrite_group_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_rewrite_group_at (const LanceOperation *operation, size_t index, LanceRewriteGroup **out_group)
 
LANCE_API int32_t lance_operation_rewrite_rewritten_index_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_rewrite_rewritten_index_at (const LanceOperation *operation, size_t index, LanceRewrittenIndex **out_index)
 
LANCE_API int32_t lance_operation_rewrite_frag_reuse_index (const LanceOperation *operation, bool *out_present, LanceIndexSegmentMetadata **out_metadata)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_mem_wal_state_new (const LanceCompactedSsTable *compacted_sstables, size_t compacted_sstable_count)
 
LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_mem_wal_state_new_with_dir_id (const LanceCompactedSsTable *compacted_sstables, size_t compacted_sstable_count, const char *dir_id)
 
LANCE_API int32_t lance_operation_update_mem_wal_state_compacted_sstable_count (const LanceOperation *operation, uint64_t *out_count)
 
LANCE_API int32_t lance_operation_update_mem_wal_state_compacted_sstable_at (const LanceOperation *operation, size_t index, LanceCompactedSsTable *out_sstable)
 
LANCE_API int32_t lance_operation_update_mem_wal_state_dir_id (const LanceOperation *operation, const char **out_dir_id)
 
LANCE_NODISCARD LANCE_API LanceFragment * lance_rewrite_result_original_fragment_at (const LanceRewriteResult *result, size_t index)
 
LANCE_NODISCARD LANCE_API LanceFragment * lance_rewrite_result_new_fragment_at (const LanceRewriteResult *result, size_t index)
 
LANCE_API int32_t lance_transaction_commit (const char *uri, const LanceTransaction *transaction, const LanceCommitOptions *options, const char *const *storage_opts, const LanceSession *session, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_transaction_commit_with_accessor (const char *uri, const LanceTransaction *transaction, const LanceCommitOptions *options, const LanceStorageOptionsAccessor *storage_options_accessor, const LanceSession *session, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_transaction_commit_with_commit_lock (const char *uri, const LanceTransaction *transaction, const LanceCommitOptions *options, const LanceStorageOptionsAccessor *storage_accessor, const LanceSession *session, const LanceCommitLock *commit_lock, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_transaction_commit_batch (const char *uri, const LanceTransaction *const *transactions, size_t transaction_count, const LanceCommitOptions *options, const char *const *storage_opts, const LanceSession *session, LanceDataset **out_dataset, LanceTransaction **out_merged_transaction)
 
LANCE_API int32_t lance_transaction_commit_batch_with_accessor (const char *uri, const LanceTransaction *const *transactions, size_t transaction_count, const LanceCommitOptions *options, const LanceStorageOptionsAccessor *storage_options_accessor, const LanceSession *session, LanceDataset **out_dataset, LanceTransaction **out_merged_transaction)
 
LANCE_API int32_t lance_transaction_commit_batch_with_commit_lock (const char *uri, const LanceTransaction *const *transactions, size_t transaction_count, const LanceCommitOptions *options, const LanceStorageOptionsAccessor *storage_accessor, const LanceSession *session, const LanceCommitLock *commit_lock, LanceDataset **out_dataset, LanceTransaction **out_merged_transaction)
 
LANCE_NODISCARD LANCE_API LanceStorageOptionsProvider * lance_storage_options_provider_new (const LanceStorageOptionsProviderSpec *spec)
 
LANCE_API void lance_storage_options_provider_close (LanceStorageOptionsProvider *provider)
 
LANCE_NODISCARD LANCE_API char * lance_storage_options_provider_id (const LanceStorageOptionsProvider *provider)
 
LANCE_NODISCARD LANCE_API LanceStorageOptionsAccessor * lance_storage_options_accessor_new (const LanceStorageOptionsInput *initial, const LanceStorageOptionsProvider *provider)
 
LANCE_API void lance_storage_options_accessor_close (LanceStorageOptionsAccessor *accessor)
 
LANCE_NODISCARD LANCE_API LanceStorageOptionsSnapshot * lance_storage_options_accessor_snapshot (const LanceStorageOptionsAccessor *accessor)
 
LANCE_API int32_t lance_storage_options_snapshot_has_options (const LanceStorageOptionsSnapshot *snapshot)
 
LANCE_API uint64_t lance_storage_options_snapshot_count (const LanceStorageOptionsSnapshot *snapshot)
 
LANCE_NODISCARD LANCE_API const char * lance_storage_options_snapshot_key_at (const LanceStorageOptionsSnapshot *snapshot, size_t index)
 
LANCE_NODISCARD LANCE_API const char * lance_storage_options_snapshot_value_at (const LanceStorageOptionsSnapshot *snapshot, size_t index)
 
LANCE_API void lance_storage_options_snapshot_close (LanceStorageOptionsSnapshot *snapshot)
 
LANCE_API void lance_namespace_result_close (LanceNamespaceResult *result)
 
LANCE_NODISCARD LANCE_API char * lance_namespace_id (const LanceNamespace *ns)
 
LANCE_NODISCARD LANCE_API char * lance_namespace_retrieve_ops_metrics (const LanceNamespace *ns)
 
LANCE_API int32_t lance_namespace_reset_ops_metrics (const LanceNamespace *ns)
 
LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_directory_new (const char *properties_json, const LanceSession *session, const LanceNamespaceContextProviderSpec *context_provider)
 
LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_rest_new (const char *properties_json, const LanceNamespaceContextProviderSpec *context_provider)
 
LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_connect_new (const char *impl_name, const char *properties_json, const LanceSession *session, const LanceNamespaceContextProviderSpec *context_provider)
 
LANCE_API void lance_namespace_close (LanceNamespace *ns)
 
LANCE_API int32_t lance_namespace_call (const LanceNamespace *ns, const char *operation, const char *request_json, const uint8_t *request_bytes, size_t request_bytes_len, LanceNamespaceResult *out_result)
 
LANCE_NODISCARD LANCE_API LanceStorageOptionsProvider * lance_namespace_storage_options_provider_new (const LanceNamespace *ns, const char *table_id_json)
 
LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_open_namespace (const LanceNamespace *ns, const char *table_id_json, const char *storage_options_json, uint64_t version, const LanceSession *session)
 
LANCE_API int32_t lance_dataset_write_namespace (const LanceNamespace *ns, const char *table_id_json, const struct ArrowSchema *schema, struct ArrowArrayStream *stream, int32_t mode, const LanceWriteParams *params, const LanceWriteOptions *options, const char *storage_options_json, const LanceSession *session, const char *branch, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_transaction_commit_namespace_uri (const LanceNamespace *ns, const char *table_id_json, const char *uri, const LanceTransaction *transaction, const LanceCommitOptions *options, const char *const *storage_opts, const LanceSession *session, LanceDataset **out_dataset)
 
LANCE_API int32_t lance_rest_adapter_start (const LanceNamespace *ns, const char *host, uint16_t port, LanceRestAdapter **out_adapter)
 
LANCE_API uint16_t lance_rest_adapter_port (const LanceRestAdapter *adapter)
 
LANCE_API void lance_rest_adapter_shutdown (LanceRestAdapter *adapter)
 
LANCE_API void lance_rest_adapter_close (LanceRestAdapter *adapter)
 
LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_custom_new (const LanceNamespaceCustomClientSpec *spec)
 
LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_custom_dispatch_new (const LanceNamespaceCustomClientDispatchSpec *spec)
 
LANCE_NODISCARD LANCE_API LanceFileSession * lance_file_session_new (const char *base_uri, const LanceStorageOptionsAccessor *storage_options, const LanceSession *session, const LanceSchedulerConfig *scheduler_config)
 
LANCE_API void lance_file_session_close (LanceFileSession *session)
 
LANCE_NODISCARD LANCE_API const char * lance_file_session_base_path (const LanceFileSession *session)
 
LANCE_NODISCARD LANCE_API LanceFileReader * lance_file_session_open_reader (const LanceFileSession *session, const char *relative_path, const LanceFileReaderOptions *options)
 
LANCE_NODISCARD LANCE_API LanceFileWriter * lance_file_session_open_writer (const LanceFileSession *session, const char *relative_path, const struct ArrowSchema *schema, const LanceFileWriterOptions *options)
 
LANCE_NODISCARD LANCE_API LancePackedBlobWriter * lance_file_session_open_packed_blob_writer (const LanceFileSession *session, const char *data_file_path, uint32_t blob_id)
 
LANCE_NODISCARD LANCE_API LanceDedicatedBlobWriter * lance_file_session_open_dedicated_blob_writer (const LanceFileSession *session, const char *data_file_path, uint32_t blob_id)
 
LANCE_API uint32_t lance_packed_blob_writer_blob_id (const LancePackedBlobWriter *writer)
 
LANCE_NODISCARD LANCE_API const char * lance_packed_blob_writer_path (const LancePackedBlobWriter *writer)
 
LANCE_API int32_t lance_packed_blob_writer_write_blob (LancePackedBlobWriter *writer, const uint8_t *data, size_t len)
 
LANCE_API int32_t lance_packed_blob_writer_write_blobs (LancePackedBlobWriter *writer, struct ArrowArray *payloads, const struct ArrowSchema *schema)
 
LANCE_API int32_t lance_packed_blob_writer_finish_array (LancePackedBlobWriter *writer, const char *field_name, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API void lance_packed_blob_writer_close (LancePackedBlobWriter *writer)
 
LANCE_API uint32_t lance_dedicated_blob_writer_blob_id (const LanceDedicatedBlobWriter *writer)
 
LANCE_NODISCARD LANCE_API const char * lance_dedicated_blob_writer_path (const LanceDedicatedBlobWriter *writer)
 
LANCE_API int32_t lance_dedicated_blob_writer_write (LanceDedicatedBlobWriter *writer, const uint8_t *data, size_t len)
 
LANCE_API int32_t lance_dedicated_blob_writer_finish_array (LanceDedicatedBlobWriter *writer, const char *field_name, struct ArrowArray *out_array, struct ArrowSchema *out_schema)
 
LANCE_API void lance_dedicated_blob_writer_close (LanceDedicatedBlobWriter *writer)
 
LANCE_API int32_t lance_file_session_contains (const LanceFileSession *session, const char *relative_path, int32_t *out_exists)
 
LANCE_NODISCARD LANCE_API LancePathList * lance_file_session_list (const LanceFileSession *session, const char *relative_path)
 
LANCE_NODISCARD LANCE_API LanceDelimitedList * lance_file_session_list_with_delimiter (const LanceFileSession *session, const char *relative_path)
 
LANCE_NODISCARD LANCE_API LanceByteBuffer * lance_file_session_read_range (const LanceFileSession *session, const char *relative_path, uint64_t offset, uint64_t length)
 
LANCE_API int32_t lance_file_session_delete_file (const LanceFileSession *session, const char *relative_path)
 
LANCE_API int32_t lance_file_session_upload_file (const LanceFileSession *session, const char *local_path, const char *relative_remote_path)
 
LANCE_API int32_t lance_file_session_download_file (const LanceFileSession *session, const char *relative_remote_path, const char *local_path)
 
LANCE_API int32_t lance_file_session_get_scheduler_stats (const LanceFileSession *session, LanceScanStats *out_stats)
 
LANCE_API int32_t lance_file_session_get_registry_stats (const LanceFileSession *session, LanceObjectStoreRegistryStats *out_stats)
 
LANCE_API int32_t lance_file_session_get_store_info (const LanceFileSession *session, LanceObjectStoreInfo *out_info)
 
LANCE_API int32_t lance_file_session_get_store_io_stats (const LanceFileSession *session, LanceObjectStoreIoStats *out_stats)
 
LANCE_NODISCARD LANCE_API LanceFileReader * lance_file_reader_open (const char *uri_or_path, const LanceStorageOptionsAccessor *storage_options, const LanceFileReaderOptions *options, const LanceSession *session, const LanceSchedulerConfig *scheduler_config)
 
LANCE_API int32_t lance_file_reader_num_rows (const LanceFileReader *reader, uint64_t *out_rows)
 
LANCE_API int32_t lance_file_reader_get_metadata (const LanceFileReader *reader, LanceFileMetadata **out_metadata)
 
LANCE_API int32_t lance_file_reader_get_statistics (const LanceFileReader *reader, LanceFileStatistics **out_statistics)
 
LANCE_API int32_t lance_file_reader_read_global_buffer (const LanceFileReader *reader, uint32_t index, LanceByteBuffer **out_bytes)
 
LANCE_API int32_t lance_file_reader_read_all (const LanceFileReader *reader, uint32_t batch_size, uint32_t batch_readahead, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_file_reader_read_range (const LanceFileReader *reader, uint64_t offset, uint64_t num_rows, uint32_t batch_size, uint32_t batch_readahead, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_file_reader_read_indices (const LanceFileReader *reader, const uint32_t *indices, size_t count, uint32_t batch_size, uint32_t batch_readahead, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_file_reader_get_io_stats (const LanceFileReader *reader, LanceScanStats *out_stats)
 
LANCE_API void lance_file_reader_close (LanceFileReader *reader)
 
LANCE_API int32_t lance_file_metadata_get_info (const LanceFileMetadata *metadata, LanceFileMetadataInfo *out_info)
 
LANCE_API int32_t lance_file_metadata_get_schema (const LanceFileMetadata *metadata, struct ArrowSchema *out_schema)
 
LANCE_API int32_t lance_file_metadata_get_global_buffers (const LanceFileMetadata *metadata, const LanceBufferDescriptor **out_buffers, size_t *out_count)
 
LANCE_API int32_t lance_file_metadata_get_columns (const LanceFileMetadata *metadata, const LanceColumnMetadata **out_columns, size_t *out_count)
 
LANCE_API void lance_file_metadata_close (LanceFileMetadata *metadata)
 
LANCE_API int32_t lance_file_statistics_get_columns (const LanceFileStatistics *statistics, const LanceColumnStatistics **out_columns, size_t *out_count)
 
LANCE_API void lance_file_statistics_close (LanceFileStatistics *statistics)
 
LANCE_NODISCARD LANCE_API LanceFileWriter * lance_file_writer_open (const char *uri_or_path, const struct ArrowSchema *schema, const LanceFileWriterOptions *options, const LanceStorageOptionsAccessor *storage_options, const LanceSession *session)
 
LANCE_API int32_t lance_file_writer_write_batch (LanceFileWriter *writer, const LanceBatch *batch)
 
LANCE_API int32_t lance_file_writer_add_schema_metadata (LanceFileWriter *writer, const char *key, const char *value)
 
LANCE_API int32_t lance_file_writer_add_global_buffer (LanceFileWriter *writer, const uint8_t *data, size_t len, uint32_t *out_index)
 
LANCE_API int32_t lance_file_writer_finish (LanceFileWriter *writer, LanceFileWriteSummary *out_summary)
 
LANCE_API int32_t lance_file_writer_abort (LanceFileWriter *writer)
 
LANCE_API void lance_file_writer_close (LanceFileWriter *writer)
 
LANCE_NODISCARD LANCE_API LanceFtsTokenList * lance_fts_tokenize (const char *text, size_t text_len, const char *params_json)
 
LANCE_API uint64_t lance_fts_token_list_count (const LanceFtsTokenList *tokens)
 
LANCE_API int32_t lance_fts_token_list_get (const LanceFtsTokenList *tokens, size_t index, LanceFtsTokenView *out)
 
LANCE_API void lance_fts_token_list_close (LanceFtsTokenList *tokens)
 
LANCE_NODISCARD LANCE_API const char * lance_simd_info_json (void)
 
LANCE_API uint64_t lance_process_iops_counter (void)
 
LANCE_API uint64_t lance_process_bytes_read_counter (void)
 
LANCE_API int32_t lance_dataset_io_stats_snapshot (const LanceDataset *dataset, LanceObjectStoreIoStats *out_stats)
 
LANCE_API int32_t lance_dataset_io_stats_incremental (const LanceDataset *dataset, LanceObjectStoreIoStats *out_stats)
 
LANCE_API uint64_t lance_path_list_count (const LancePathList *list)
 
LANCE_NODISCARD LANCE_API const char * lance_path_list_at (const LancePathList *list, size_t index)
 
LANCE_API void lance_path_list_close (LancePathList *list)
 
LANCE_API uint64_t lance_delimited_list_common_prefix_count (const LanceDelimitedList *list)
 
LANCE_NODISCARD LANCE_API const char * lance_delimited_list_common_prefix_at (const LanceDelimitedList *list, size_t index)
 
LANCE_API uint64_t lance_delimited_list_object_count (const LanceDelimitedList *list)
 
LANCE_NODISCARD LANCE_API const char * lance_delimited_list_object_at (const LanceDelimitedList *list, size_t index)
 
LANCE_API void lance_delimited_list_close (LanceDelimitedList *list)
 
LANCE_NODISCARD LANCE_API const uint8_t * lance_byte_buffer_data (const LanceByteBuffer *buffer)
 
LANCE_API size_t lance_byte_buffer_len (const LanceByteBuffer *buffer)
 
LANCE_API void lance_byte_buffer_close (LanceByteBuffer *buffer)
 
LANCE_NODISCARD LANCE_API LanceSqlQueryBuilder * lance_dataset_sql_builder_new (const LanceDataset *dataset, const char *sql)
 
LANCE_API void lance_sql_query_builder_close (LanceSqlQueryBuilder *builder)
 
LANCE_API void lance_sql_query_close (LanceSqlQuery *query)
 
LANCE_API int32_t lance_sql_query_builder_set_table_name (LanceSqlQueryBuilder *builder, const char *table_name)
 
LANCE_API int32_t lance_sql_query_builder_set_with_row_id (LanceSqlQueryBuilder *builder, bool enabled)
 
LANCE_API int32_t lance_sql_query_builder_set_with_row_addr (LanceSqlQueryBuilder *builder, bool enabled)
 
LANCE_API int32_t lance_sql_query_builder_set_blob_handling (LanceSqlQueryBuilder *builder, LanceBlobHandling handling)
 
LANCE_API int32_t lance_sql_query_builder_set_batch_size (LanceSqlQueryBuilder *builder, uint64_t batch_size)
 
LANCE_API int32_t lance_sql_query_builder_set_batch_size_bytes (LanceSqlQueryBuilder *builder, uint64_t batch_size_bytes)
 
LANCE_API int32_t lance_sql_query_builder_build (LanceSqlQueryBuilder *builder, LanceSqlQuery **out_query)
 
LANCE_API int32_t lance_sql_query_into_stream (LanceSqlQuery *query, struct ArrowArrayStream *out_stream)
 
LANCE_NODISCARD LANCE_API LanceDatasetDeltaBuilder * lance_dataset_delta_builder_new (const LanceDataset *dataset)
 
LANCE_API void lance_dataset_delta_builder_close (LanceDatasetDeltaBuilder *builder)
 
LANCE_API void lance_dataset_delta_close (LanceDatasetDelta *delta)
 
LANCE_API int32_t lance_dataset_delta_builder_set_compared_against_version (LanceDatasetDeltaBuilder *builder, uint64_t version)
 
LANCE_API int32_t lance_dataset_delta_builder_set_begin_version (LanceDatasetDeltaBuilder *builder, uint64_t version)
 
LANCE_API int32_t lance_dataset_delta_builder_set_end_version (LanceDatasetDeltaBuilder *builder, uint64_t version)
 
LANCE_API int32_t lance_dataset_delta_builder_set_begin_timestamp (LanceDatasetDeltaBuilder *builder, const LanceDeltaTimestamp *timestamp)
 
LANCE_API int32_t lance_dataset_delta_builder_set_end_timestamp (LanceDatasetDeltaBuilder *builder, const LanceDeltaTimestamp *timestamp)
 
LANCE_API int32_t lance_dataset_delta_builder_build (LanceDatasetDeltaBuilder *builder, LanceDatasetDelta **out_delta)
 
LANCE_API int32_t lance_dataset_delta_list_transactions (const LanceDatasetDelta *delta, LanceTransaction ***out_transactions, size_t *out_count)
 
LANCE_API void lance_transaction_array_free (LanceTransaction **transactions, size_t count)
 
LANCE_API int32_t lance_dataset_delta_get_inserted_rows (const LanceDatasetDelta *delta, struct ArrowArrayStream *out_stream)
 
LANCE_API int32_t lance_dataset_delta_get_updated_rows (const LanceDatasetDelta *delta, struct ArrowArrayStream *out_stream)
 
LANCE_API int32_t lance_dataset_delta_get_upserted_rows (const LanceDatasetDelta *delta, struct ArrowArrayStream *out_stream)
 
LANCE_API int32_t lance_dataset_delta_get_deleted_row_ids (const LanceDatasetDelta *delta, struct ArrowArrayStream *out_stream)
 
LANCE_API int32_t lance_mem_wal_initialize (LanceDataset *dataset, LanceMemWalShardingMode mode, const char *column, uint32_t num_buckets, int32_t has_maintained_indexes, const char *const *maintained_indexes, size_t num_maintained_indexes, const LanceShardWriterConfig *config)
 
LANCE_API int32_t lance_mem_wal_index_details (LanceDataset *dataset, LanceMemWalIndexDetails **out)
 
LANCE_API void lance_mem_wal_index_details_free (LanceMemWalIndexDetails *details)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_index_details_dir_id (const LanceMemWalIndexDetails *details)
 
LANCE_API uint32_t lance_mem_wal_index_details_num_shards (const LanceMemWalIndexDetails *details)
 
LANCE_API int32_t lance_mem_wal_index_details_maintain_all_indexes (const LanceMemWalIndexDetails *details)
 
LANCE_API size_t lance_mem_wal_index_details_maintained_index_count (const LanceMemWalIndexDetails *details)
 
LANCE_API int32_t lance_mem_wal_index_details_maintained_index_at (const LanceMemWalIndexDetails *details, size_t index, const char **out_name)
 
LANCE_API size_t lance_mem_wal_index_details_sharding_spec_count (const LanceMemWalIndexDetails *details)
 
LANCE_API int32_t lance_mem_wal_index_details_sharding_spec_at (const LanceMemWalIndexDetails *details, size_t index, LanceMemWalShardingSpec **out_spec)
 
LANCE_API size_t lance_mem_wal_index_details_writer_config_default_count (const LanceMemWalIndexDetails *details)
 
LANCE_API int32_t lance_mem_wal_index_details_writer_config_default_at (const LanceMemWalIndexDetails *details, size_t index, const char **out_key, const char **out_value)
 
LANCE_API int32_t lance_mem_wal_sharding_field_new (const char *field_id, const int32_t *source_ids, size_t num_source_ids, const char *transform, const char *expression, const char *result_type, const char *const *parameter_keys, const char *const *parameter_values, size_t num_parameters, LanceMemWalShardingField **out)
 
LANCE_API int32_t lance_mem_wal_sharding_field_clone (const LanceMemWalShardingField *field, LanceMemWalShardingField **out)
 
LANCE_API void lance_mem_wal_sharding_field_free (LanceMemWalShardingField *field)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_id (const LanceMemWalShardingField *field)
 
LANCE_NODISCARD LANCE_API const int32_t * lance_mem_wal_sharding_field_source_ids (const LanceMemWalShardingField *field, size_t *out_count)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_transform (const LanceMemWalShardingField *field)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_expression (const LanceMemWalShardingField *field)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_result_type (const LanceMemWalShardingField *field)
 
LANCE_API size_t lance_mem_wal_sharding_field_parameter_count (const LanceMemWalShardingField *field)
 
LANCE_API int32_t lance_mem_wal_sharding_field_parameter_at (const LanceMemWalShardingField *field, size_t index, const char **out_key, const char **out_value)
 
LANCE_API int32_t lance_mem_wal_sharding_spec_new (uint32_t spec_id, const LanceMemWalShardingField *const *fields, size_t num_fields, LanceMemWalShardingSpec **out)
 
LANCE_API int32_t lance_mem_wal_sharding_spec_clone (const LanceMemWalShardingSpec *spec, LanceMemWalShardingSpec **out)
 
LANCE_API void lance_mem_wal_sharding_spec_free (LanceMemWalShardingSpec *spec)
 
LANCE_API uint32_t lance_mem_wal_sharding_spec_id (const LanceMemWalShardingSpec *spec)
 
LANCE_API size_t lance_mem_wal_sharding_spec_field_count (const LanceMemWalShardingSpec *spec)
 
LANCE_API int32_t lance_mem_wal_sharding_spec_field_at (const LanceMemWalShardingSpec *spec, size_t index, LanceMemWalShardingField **out_field)
 
LANCE_API int32_t lance_mem_wal_evaluate_sharding_spec (LanceDataset *dataset, const LanceBatch *batch, const LanceMemWalShardingSpec *spec, LanceBatch **out_batch)
 
LANCE_API int32_t lance_mem_wal_evaluate_sharding_spec_with_schema (const LanceBatch *batch, const LanceMemWalShardingSpec *spec, const LanceSchema *schema, LanceBatch **out_batch)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_new (const char *shard_id, LanceMemWalShardSnapshot **out)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_clone (const LanceMemWalShardSnapshot *snapshot, LanceMemWalShardSnapshot **out)
 
LANCE_API void lance_mem_wal_shard_snapshot_free (LanceMemWalShardSnapshot *snapshot)
 
LANCE_NODISCARD LANCE_API const char * lance_mem_wal_shard_snapshot_shard_id (const LanceMemWalShardSnapshot *snapshot)
 
LANCE_API uint32_t lance_mem_wal_shard_snapshot_spec_id (const LanceMemWalShardSnapshot *snapshot)
 
LANCE_API uint64_t lance_mem_wal_shard_snapshot_current_generation (const LanceMemWalShardSnapshot *snapshot)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_with_spec_id (LanceMemWalShardSnapshot *snapshot, uint32_t spec_id)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_with_current_generation (LanceMemWalShardSnapshot *snapshot, uint64_t generation)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_with_sstable (LanceMemWalShardSnapshot *snapshot, uint64_t generation, const char *path)
 
LANCE_API size_t lance_mem_wal_shard_snapshot_sstable_count (const LanceMemWalShardSnapshot *snapshot)
 
LANCE_API int32_t lance_mem_wal_shard_snapshot_sstable_at (const LanceMemWalShardSnapshot *snapshot, size_t index, uint64_t *out_generation, const char **out_path)
 
LANCE_API int32_t lance_mem_wal_compacted_sstable_new (const char *shard_id, uint64_t generation, LanceCompactedSsTable *out)
 
LANCE_API int32_t lance_shard_writer_open (LanceDataset *dataset, const char *shard_id, const LanceShardWriterConfig *config, LanceShardWriter **out)
 
LANCE_NODISCARD LANCE_API const char * lance_shard_writer_shard_id (const LanceShardWriter *writer)
 
LANCE_API int32_t lance_shard_writer_put (LanceShardWriter *writer, struct ArrowArrayStream *stream, LanceShardWriteResult *out_result)
 
LANCE_API int32_t lance_shard_writer_delete (LanceShardWriter *writer, struct ArrowArrayStream *stream, LanceShardWriteResult *out_result)
 
LANCE_API int32_t lance_shard_writer_stats (const LanceShardWriter *writer, LanceShardWriterStats *out)
 
LANCE_API int32_t lance_shard_writer_memtable_stats (const LanceShardWriter *writer, LanceShardMemTableStats *out)
 
LANCE_API int32_t lance_shard_writer_snapshot (const LanceShardWriter *writer, LanceMemWalShardSnapshot **out)
 
LANCE_API int32_t lance_shard_writer_lsm_scanner (LanceShardWriter *writer, const LanceMemWalShardSnapshot *const *snapshots, size_t num_snapshots, LanceLsmScanner **out)
 
LANCE_API int32_t lance_shard_writer_close (LanceShardWriter *writer)
 
LANCE_API void lance_shard_writer_free (LanceShardWriter *writer)
 
LANCE_API int32_t lance_lsm_scanner_from_snapshots (LanceDataset *dataset, const LanceMemWalShardSnapshot *const *snapshots, size_t num_snapshots, LanceLsmScanner **out)
 
LANCE_API int32_t lance_lsm_scanner_project (LanceLsmScanner *scanner, const char *const *columns, size_t num_columns)
 
LANCE_API int32_t lance_lsm_scanner_filter (LanceLsmScanner *scanner, const char *filter)
 
LANCE_API int32_t lance_lsm_scanner_limit (LanceLsmScanner *scanner, int64_t limit, int32_t has_limit, int64_t offset, int32_t has_offset)
 
LANCE_API int32_t lance_lsm_scanner_with_row_address (LanceLsmScanner *scanner)
 
LANCE_API int32_t lance_lsm_scanner_with_memtable_gen (LanceLsmScanner *scanner)
 
LANCE_API int32_t lance_lsm_scanner_schema (const LanceLsmScanner *scanner, struct ArrowSchema *out_schema)
 
LANCE_API int32_t lance_lsm_scanner_to_batch (const LanceLsmScanner *scanner, LanceBatch **out)
 
LANCE_API int32_t lance_lsm_scanner_to_arrow_stream (const LanceLsmScanner *scanner, struct ArrowArrayStream *out)
 
LANCE_API int32_t lance_lsm_scanner_count_rows (const LanceLsmScanner *scanner, uint64_t *out_count)
 
LANCE_API void lance_lsm_scanner_free (LanceLsmScanner *scanner)
 
LANCE_API int32_t lance_lsm_point_lookup_planner_new (LanceDataset *dataset, const LanceMemWalShardSnapshot *const *snapshots, size_t num_snapshots, int32_t has_pk_columns, const char *const *pk_columns, size_t num_pk_columns, LanceLsmPointLookupPlanner **out)
 
LANCE_API int32_t lance_lsm_point_lookup_planner_plan (LanceLsmPointLookupPlanner *planner, const LanceBatch *pk_value, int32_t has_columns, const char *const *columns, size_t num_columns, LanceMemWalPlan **out)
 
LANCE_API void lance_lsm_point_lookup_planner_free (LanceLsmPointLookupPlanner *planner)
 
LANCE_API int32_t lance_lsm_vector_search_planner_new (LanceDataset *dataset, const LanceMemWalShardSnapshot *const *snapshots, size_t num_snapshots, const char *vector_column, int32_t has_pk_columns, const char *const *pk_columns, size_t num_pk_columns, LanceMemWalDistanceType distance_type, const char *filter, LanceLsmVectorSearchPlanner **out)
 
LANCE_API int32_t lance_lsm_vector_search_planner_plan (LanceLsmVectorSearchPlanner *planner, const float *query, size_t query_len, uint64_t k, uint64_t nprobes, int32_t has_columns, const char *const *columns, size_t num_columns, int32_t refine_base_table, double overfetch_factor, LanceMemWalPlan **out)
 
LANCE_API void lance_lsm_vector_search_planner_free (LanceLsmVectorSearchPlanner *planner)
 
LANCE_API int32_t lance_mem_wal_plan_schema (const LanceMemWalPlan *plan, struct ArrowSchema *out)
 
LANCE_API int32_t lance_mem_wal_plan_dataset_schema (const LanceMemWalPlan *plan, struct ArrowSchema *out)
 
LANCE_API int32_t lance_mem_wal_plan_explain (const LanceMemWalPlan *plan, char **out)
 
LANCE_API int32_t lance_mem_wal_plan_to_batch (const LanceMemWalPlan *plan, LanceBatch **out)
 
LANCE_API int32_t lance_mem_wal_plan_to_arrow_stream (const LanceMemWalPlan *plan, struct ArrowArrayStream *out)
 
LANCE_API void lance_mem_wal_plan_free (LanceMemWalPlan *plan)
 
LANCE_API int32_t lance_dataset_merge_insert_with_compaction (LanceDataset *dataset, const char *const *on_columns, size_t num_on_columns, struct ArrowArrayStream *source, const LanceMergeInsertParams *params, const LanceCompactedSsTable *compacted_sstables, size_t num_compacted_sstables, LanceMergeInsertResult *out_result)
 

Variables

const char * column
 
const char const char * query
 
const char const char uint32_t max_fuzzy_distance
 
const char const char uint32_t int32_t coverage_mode
 

Detailed Description

C API for the Lance columnar data format.

This umbrella header keeps the complete 0.2 public C ABI. Callers that use only the dataset read path may include the focused domain headers instead:

Domain headers include <lance/arrow_abi.h> and <lance/fwd.h>. Include <lance/error.h> for the thread-local error accessors and <lance/version.h> for the version macros or lance_c_version().

All data crosses this boundary via the Arrow C Data Interface (ArrowSchema, ArrowArray, ArrowArrayStream). For Arrow structures written to caller-provided output storage, the caller retains ownership of the outer structure and must invoke its non-NULL release callback exactly once to release the contents. APIs that allocate the outer structure as well document a separate matching free function.

Error handling uses thread-local storage: after any function returns its documented error sentinel (for example NULL, -1, or 0 for selected scalar accessors), call lance_last_error_code() and lance_last_error_message() to get details.

Definition in file lance.h.

Typedef Documentation

◆ LanceAutoCleanupParams

typedef struct LanceAutoCleanupParams LanceAutoCleanupParams

Native auto-cleanup parameters for lance_dataset_write_with_options.

interval is the number of committed versions between cleanup runs; 0 is a valid native value that considers cleanup on every commit. It is narrowed to the native usize type; values that do not fit return LANCE_ERR_INVALID_ARGUMENT.

older_than_seconds and older_than_nanos express the native chrono::TimeDelta retention window as older_than_seconds + older_than_nanos / 1000000000. Both fields carry the sign, and older_than_nanos preserves subsecond precision. It must be in [-999999999, 999999999], and the combined value must fit in the native TimeDelta range (about +/-292 million years). Negative durations are forwarded to Lance, which rejects them when it builds the write transaction because the persisted config uses std::time::Duration.

◆ LanceBasePath

typedef struct LanceBasePath LanceBasePath

One native BasePath field set for registration.

name == NULL maps to native None; a non-NULL pointer, including an empty string, maps to Some(name). id == 0 requests native ID assignment.

◆ LanceBasePathList

typedef struct LanceBasePathList LanceBasePathList

Borrowed native base-path list with explicit presence.

items == NULL maps to native None, including for Overwrite. A non-NULL pointer with count == 0 maps to native Some(empty list). Every entry is parsed with the LanceBasePath rules above.

◆ LanceBasePathView

typedef struct LanceBasePathView LanceBasePathView

Borrowed native BasePath fields owned by an operation handle.

path and name point into the operation's storage and remain valid until lance_operation_close() is called on that handle. name == NULL represents native None; a non-NULL pointer, including an empty string, represents Some(name).

◆ LanceBaseStoreParams

typedef struct LanceBaseStoreParams LanceBaseStoreParams

One native ObjectStoreParams value for WriteParams::base_store_params.

base_path is the exact map key. storage_options_accessor is cloned into the native params; a NULL handle or an accessor without an inner owner selects native None. Scalar fields use has_* flags so omitted values keep the native ObjectStoreParams defaults.

Native object-store and wrapper trait hooks (object_store, object_store_wrapper) and feature-gated AWS credential providers have no C representation here. Use a StorageOptionsAccessor for static or provider-backed storage options.

◆ LanceBatchUDF

typedef struct LanceBatchUDF LanceBatchUDF

Foreign BatchUDF declaration.

output_schema is the complete schema of every mapper and get-batch output batch and is borrowed for this call. checkpoint_store may be NULL. Mapper and checkpoint contexts are call-scoped and must remain valid until the enclosing function returns.

◆ LanceBatchUDFMapper

typedef int32_t(* LanceBatchUDFMapper) (void *callback_ctx, const struct ArrowArray *input, const struct ArrowSchema *input_schema, struct ArrowArray *output, LanceCallbackError *error)

Map one input RecordBatch to an owned output ArrowArray.

Input values are borrowed for the callback only. The input ArrowArray is the top-level struct array and input_schema is its complete schema. On success initialize output with an owned ArrowArray whose struct children match the declared LanceBatchUDF.output_schema, then return 0. Native owns the output and its release callback after a successful return. Zero-column batches retain their row count through the top-level array length.

On failure return nonzero, fill error, and leave any initialized output for the library to release. The callback may run on a native runtime thread and must be thread-safe and non-unwinding.

Definition at line 2022 of file lance.h.

◆ LanceBatchUDFV2

typedef struct LanceBatchUDFV2 LanceBatchUDFV2

Schema-aware foreign BatchUDF declaration.

output_schema is the complete schema of every mapper output batch and is borrowed for this call. checkpoint_store may be NULL.

◆ LanceBlobFieldOptions

typedef struct LanceBlobFieldOptions LanceBlobFieldOptions

Native storage thresholds for a blob v2 field.

Each optional threshold is selected by its has_* flag. An enabled inline threshold of zero is valid. An enabled dedicated threshold must be non-zero because native NonZeroUsize cannot represent zero. Values wider than the platform size_t are rejected rather than truncated. A zero-initialized struct selects native defaults (both thresholds absent).

◆ LanceBlobRange

typedef struct LanceBlobRange LanceBlobRange

One blob-relative byte range for lance_blob_file_read_ranges().

offset and length are interpreted against the start of the blob. Empty ranges are valid.

◆ LanceBlobRangeRequest

typedef struct LanceBlobRangeRequest LanceBlobRangeRequest

One row-specific blob-range request.

row has the meaning selected by LanceBlobRowSelector. offset and length are blob-local bytes and map directly to native BlobReadRange.offset/length.

◆ LanceBlobReadOptions

typedef struct LanceBlobReadOptions LanceBlobReadOptions

Optional controls for planned blob reads.

A NULL options pointer means io_buffer_size = None and native preserve_order = true. has_io_buffer_size = true forwards the value verbatim; zero is an explicit native value and is rejected by the native builder rather than replaced with a default. order is a LanceBlobReadOrder value.

◆ LanceBufferDescriptor

typedef struct LanceBufferDescriptor LanceBufferDescriptor

◆ LanceByteBuffer

Definition at line 10031 of file lance.h.

◆ LanceCallbackError

typedef struct LanceCallbackError LanceCallbackError

Error returned by a BatchUDF mapper or checkpoint callback.

The library zero-initializes this structure before every invocation. On success the callback leaves it zeroed. On failure code is nonzero: INVALID_ARGUMENT, IO, NOT_FOUND, NOT_SUPPORTED, and INTERNAL map to their native variants; other values are treated as INTERNAL.

message is copied into a Rust-owned error before message.release is called exactly once. A callback must not report failure through lance_last_error_*: callbacks may run on a different thread.

◆ LanceCleanupOldVersionsOptions

typedef struct LanceCleanupOldVersionsOptions LanceCleanupOldVersionsOptions

Relative-duration cleanup options for lance_dataset_cleanup_old_versions.

older_than_seconds + older_than_nanos / 1000000000 is converted to the native chrono::TimeDelta range without narrowing through signed 64-bit nanoseconds. Both components carry the sign; older_than_nanos must be in [-999999999, 999999999]. This entry point calls Dataset::cleanup_old_versions, so Lance owns the time cutoff. The optional booleans use independent presence flags; leaving them unset preserves native defaults.

◆ LanceCleanupOperationOptions

typedef struct LanceCleanupOperationOptions LanceCleanupOperationOptions

Optional native CleanupOperation overrides. Zero-initialize to use the native operation defaults.

An operation-level delete rate limit overrides the policy-level value. max_candidate_files affects explanations only; zero is valid and means include no candidate files while still returning aggregate stats and a truncation flag.

◆ LanceCleanupPolicy

typedef struct LanceCleanupPolicy LanceCleanupPolicy

Native manual cleanup policy with explicit presence for every optional selector. Zero-initialize this struct to leave every optional field unset and inherit native defaults. In particular, the native default error_if_tagged_old_versions is true; it is not the legacy writer's automatic 20-version / 14-day policy.

before_timestamp, before_version and versions are independent selectors. When more than one is set, a version is eligible only if it satisfies all of them (AND).

  • versions == NULL means no exact-version selector. A non-NULL pointer with num_versions == 0 is an explicit empty selection and Lance rejects it.
  • Set has_retain_versions to use the native asynchronous CleanupPolicyBuilder::retain_n_versions; zero is rejected by Lance. Do not set both has_before_version and has_retain_versions, because both set the same native field.
  • A present boolean may be true or false. The has_* field controls presence independently, so zero-initialized optional values preserve native defaults.
  • Timestamps use seconds plus a nanosecond component. They are not narrowed to the signed 64-bit nanosecond range.

The policy and versions array are copied before asynchronous work.

◆ LanceColumnAlteration

typedef struct LanceColumnAlteration LanceColumnAlteration

A single alteration applied to one column. Every non-path field is optional via a sentinel:

  • rename = NULL keeps the current name.
  • nullable_mode = LANCE_COLUMN_NULLABLE_UNCHANGED keeps current nullability.
  • data_type = NULL keeps the current data type.

At least one of rename, nullable_mode, or data_type must request a change; an alteration that touches nothing is rejected at the FFI boundary.

data_type, when non-NULL, borrows an Arrow C Data Interface ArrowSchema describing the target type. The struct is read by shared reference for the duration of the call; its release callback is never invoked.

◆ LanceColumnMetadata

typedef struct LanceColumnMetadata LanceColumnMetadata

◆ LanceColumnStatistics

typedef struct LanceColumnStatistics LanceColumnStatistics

◆ LanceCommitLeaseDestroy

typedef void(* LanceCommitLeaseDestroy) (void *callback_ctx, void *lease)

Destroy one lease token. Called exactly once per acquired lease, after any final release callback, including for a NULL stateless token. Must not throw and must not call back into Lance.

Definition at line 2246 of file lance.h.

◆ LanceCommitLockAcquire

typedef int32_t(* LanceCommitLockAcquire) (void *callback_ctx, uint64_t version, void **out_lease, LanceCallbackError *error)

Acquire the lock for a manifest base version.

On success return 0 and either store an owned opaque token in *out_lease or leave it NULL for a stateless lock. On failure return nonzero, fill error, and leave *out_lease NULL. A non-NULL partial token left on a failed acquire is destroyed exactly once and never released.

The callback runs synchronously on a native runtime thread, may perform blocking I/O through an independent dataset or scanner handle, and must be thread-safe and non-unwinding. It must not re-enter the dataset handle that is currently committing.

Definition at line 2218 of file lance.h.

◆ LanceCommitLockCallbacks

typedef struct LanceCommitLockCallbacks LanceCommitLockCallbacks

Foreign commit lock.

lock and release are required; destroy_lease and release_context are optional. The table is copied by lance_commit_lock_new. callback_ctx is borrowed by every callback and may be NULL. Context ownership transfers only when construction succeeds: on failure release_context is never called.

Datasets, scanners and in-flight native jobs retain their own native context owner. Closing a LanceCommitLock handle only drops that handle's owner; retained datasets keep working. Keep the lock handle alive when staging a transaction and pass it to the matching commit entry point.

◆ LanceCommitLockContextRelease

typedef void(* LanceCommitLockContextRelease) (void *callback_ctx)

Release the lock context exactly once, when the last native owner drops. Optional; absent means the caller keeps ownership of callback_ctx. Must not throw.

Definition at line 2256 of file lance.h.

◆ LanceCommitLockRelease

typedef int32_t(* LanceCommitLockRelease) (void *callback_ctx, void *lease, bool success, LanceCallbackError *error)

Report whether the commit that acquired a lease succeeded.

success is true after the manifest is published and false when native conflict handling or cancellation abandons the attempt. Release may be called more than once for one token and must be idempotent. It does not destroy the token. On failure return nonzero and fill error; the token stays owned by the library until destroy_lease.

Definition at line 2234 of file lance.h.

◆ LanceCommitOptions

typedef struct LanceCommitOptions LanceCommitOptions

Native CommitBuilder settings for transaction publication.

Zero-initialize this struct to preserve native defaults. Presence flags keep omitted settings distinct from explicit false, zero retries, zero retry budget and zero overall timeout.

The native default retry count is 20. An explicit max_retries = 0 is forwarded and selects native strict-overwrite behavior for an Overwrite transaction. The native retry backoff budget defaults to 30 seconds; an explicit zero is valid. The overall timeout defaults to 30 minutes; an explicit zero duration is rejected by the native execute path.

data_storage_version uses the same parser as LanceWriteParams and maps to CommitBuilder::with_storage_format. NULL keeps the native omitted value.

◆ LanceCompactionMetrics

typedef struct LanceCompactionMetrics LanceCompactionMetrics

Per-call compaction metrics returned via the optional out parameter.

◆ LanceCompactionMode

Controls how data is rewritten during compaction.

◆ LanceCompactionOptions

typedef struct LanceCompactionOptions LanceCompactionOptions

Tunable parameters for lance_dataset_compact_files. Pass NULL to use the upstream defaults. Each numeric field uses 0 as a "keep upstream default" sentinel; non-zero values are forwarded after a usize range check so the API does not silently truncate on 32-bit hosts.

This five-field layout is frozen. New callers should use LanceCompactionOptionsV2, which preserves native None/Some(0)/Some(empty) choices and exposes every native compaction option.

◆ LanceDataOverlayCoverageKind

Coverage layout for a data overlay.

LANCE_DATA_OVERLAY_COVERAGE_SHARED stores one bitmap covering every field in the overlay data file. LANCE_DATA_OVERLAY_COVERAGE_PER_FIELD stores one bitmap per field in data_file.fields order. The FFI takes the integer value so unknown kinds are rejected with a descriptive error.

◆ LanceDedicatedBlobWriter

Definition at line 10026 of file lance.h.

◆ LanceDelimitedList

Definition at line 10030 of file lance.h.

◆ LanceDeltaTimestamp

typedef struct LanceDeltaTimestamp LanceDeltaTimestamp

Timestamp for delta date-mode ranges.

unix_seconds is a signed Unix timestamp in whole seconds and nanos the nanosecond component. Native chrono timestamp construction defines representability, including leap seconds. An unrepresentable value is rejected by the timestamp setter.

◆ LanceEncodingDescriptor

typedef struct LanceEncodingDescriptor LanceEncodingDescriptor

◆ LanceFieldMetadataUpdate

typedef struct LanceFieldMetadataUpdate LanceFieldMetadataUpdate

One field's metadata update in a batch.

keys and values are parallel arrays of length count. A NULL value removes its key; an empty string remains a real empty value. mode is applied independently to this field. keys and values may be NULL only when count == 0.

◆ LanceFieldMetadataUpdateMap

typedef struct LanceFieldMetadataUpdateMap LanceFieldMetadataUpdateMap

One native per-field metadata update for lance_operation_update_config_new().

updates is borrowed and cloned. Duplicate field IDs follow native HashMap last-write-wins semantics where the last complete map wins.

◆ LanceFieldReference

typedef struct LanceFieldReference LanceFieldReference

A field reference for lance_dataset_update_field_metadata and lance_dataset_resolve_field_id.

For LANCE_FIELD_REFERENCE_ID, field_id is used and path is ignored. For LANCE_FIELD_REFERENCE_PATH, path must be a non-NULL, NUL-terminated UTF-8 Lance field path (for example profile.name) and field_id is ignored.

◆ LanceFileMetadata

Definition at line 10027 of file lance.h.

◆ LanceFileMetadataInfo

typedef struct LanceFileMetadataInfo LanceFileMetadataInfo

◆ LanceFileReader

Definition at line 10023 of file lance.h.

◆ LanceFileReaderOptions

typedef struct LanceFileReaderOptions LanceFileReaderOptions

Reader options.

has_columns nonzero forwards exactly column_count names; count zero is an explicit empty projection and is rejected by native validation. A NULL options pointer uses native defaults and no projection.

SESSION cache requires a shared LanceSession and shares its capacity through a reader-local namespace. Entries can be reused within that reader. Native file cache keys lack backing-store identity and content versions. Files must remain immutable while their reader or streams are active. NONE uses native LanceCache::no_cache and is the default.

has_* fields distinguish None from explicit zero/false. Boolean payloads must be 0 or 1 when set.

◆ LanceFileSession

Definition at line 10022 of file lance.h.

◆ LanceFileStatistics

Definition at line 10028 of file lance.h.

◆ LanceFileWriter

Definition at line 10024 of file lance.h.

◆ LanceFileWriterOptions

typedef struct LanceFileWriterOptions LanceFileWriterOptions

Writer options. has_* fields distinguish None from explicit zero/false. version == NULL uses the native default; otherwise native parsing and unsupported-version errors are preserved.

◆ LanceFileWriteSummary

typedef struct LanceFileWriteSummary LanceFileWriteSummary

◆ LanceFragmentCreateOptions

typedef struct LanceFragmentCreateOptions LanceFragmentCreateOptions

Options for the native fragment creation entry points.

schema == NULL leaves native schema inference in place. In APPEND mode native inference may use the existing dataset's schema, including its field IDs. A non-NULL schema is borrowed for the call and cloned before the write starts, so closing the handle during the call is not allowed.

mode is a LanceWriteMode value. write == NULL selects the native WriteParams::default() writer options. storage_opts == NULL and session == NULL keep the native defaults.

◆ LanceFragmentOffsetsView

typedef struct LanceFragmentOffsetsView LanceFragmentOffsetsView

Borrowed row offsets for one fragment in an UpdatedFragmentOffsets value.

offsets is read as a set: repeated values collapse. offsets may be NULL only when offset_count is 0, which is a real empty bitmap entry rather than an absent one.

◆ LanceFtsBoostOptions

typedef struct LanceFtsBoostOptions LanceFtsBoostOptions

Options for lance_fts_query_boost_new(). Call lance_fts_query_boost_options_init() before changing individual fields.

◆ LanceFtsCombinedFieldsOptions

typedef struct LanceFtsCombinedFieldsOptions LanceFtsCombinedFieldsOptions

Options for lance_fts_query_combined_fields_new(). Call lance_fts_query_combined_fields_options_init() before changing individual fields.

◆ LanceFtsMatchOptions

typedef struct LanceFtsMatchOptions LanceFtsMatchOptions

Options for lance_fts_query_match_new(). Call lance_fts_query_match_options_init() before changing individual fields.

◆ LanceFtsMultiMatchOptions

typedef struct LanceFtsMultiMatchOptions LanceFtsMultiMatchOptions

Options for lance_fts_query_multi_match_new(). Call lance_fts_query_multi_match_options_init() before changing individual fields.

◆ LanceFtsPhraseOptions

typedef struct LanceFtsPhraseOptions LanceFtsPhraseOptions

Options for lance_fts_query_phrase_new(). Call lance_fts_query_phrase_options_init() before changing individual fields.

◆ LanceFtsTokenView

typedef struct LanceFtsTokenView LanceFtsTokenView

Borrowed view of one token produced by lance_fts_tokenize.

text is not NUL-terminated and may contain embedded NUL bytes; read exactly text_len bytes. The pointer remains valid until the owning LanceFtsTokenList is closed. position is the native normalized token position after Lance removes leading gaps.

◆ LanceIndexBuildProgressCallback

typedef void(* LanceIndexBuildProgressCallback) (void *callback_ctx, int32_t event, const char *stage, uint64_t total, const char *unit, uint64_t completed)

Receives progress from an ordinary index creation or an uncommitted segment build.

stage is non-NULL, NUL-terminated, and borrowed: it is valid only for the duration of this call. unit is non-NULL and NUL-terminated, but is the empty string ("") for LANCE_INDEX_BUILD_PROGRESS_STAGE_PROGRESS and LANCE_INDEX_BUILD_PROGRESS_STAGE_COMPLETE. The parameter mapping is:

  • LANCE_INDEX_BUILD_PROGRESS_STAGE_START: stage is the stage name, total is the number of work units (0 = unknown), unit describes what is being counted (e.g. "partitions", "batches", "rows"; "" = unknown), and completed is 0.
  • LANCE_INDEX_BUILD_PROGRESS_STAGE_PROGRESS: total is 0, unit is "", and completed is the number of units completed so far.
  • LANCE_INDEX_BUILD_PROGRESS_STAGE_COMPLETE: total is 0, unit is "", and completed is 0.

Stage names are index-type-specific (for example "train_ivf", "shuffle", "merge_partitions" and "load_data") and are diagnostic-only: they are not a stable cross-version contract, so consumers must treat them as opaque strings.

The callback is invoked from lance-c's internal tokio runtime worker threads. Certain stages report progress concurrently from parallel worker tasks, so the callback MUST be thread-safe. It must be non-blocking and must not call runtime-backed lance_* entry points or access the dataset handle being indexed. An ordinary build holds that dataset's mutation lock for the duration of the call, so the callback must not synchronously re-enter the same handle or start or block on a nested runtime. Non-runtime leaf utilities such as lance_free_string are unaffected.

callback_ctx is opaque and may be NULL. The callback and context must remain valid until the blocking call that installed them returns. lance-c disables the callback and drains in-flight invocations through a retirement gate before returning, including on error, so no invocation remains after that boundary. Progress reporting is advisory and cannot affect the build outcome or cancel the build.

The callback is invoked without a panic guard: it must return normally, because unwinding or throwing across this boundary can abort the host process.

Definition at line 4671 of file lance.h.

◆ LanceIndexFile

typedef struct LanceIndexFile LanceIndexFile

Borrowed index-file entry for a LanceRewrittenIndex.

◆ LanceIndexPrewarmOptions

typedef struct LanceIndexPrewarmOptions LanceIndexPrewarmOptions

Native prewarm controls.

When has_segment_selection is false, the UUID pointer and count are ignored and map to native None. When true, count 0 maps to Some(empty) and performs no segment work; a positive count requires segment_uuids to point at segment_count * 16 bytes of concatenated RFC 4122 UUIDs. Unknown segment UUIDs return LANCE_ERR_NOT_FOUND.

◆ LanceIndexRemapMode

Controls how the old-to-new row-address mapping is represented.

◆ LanceIndexSegmentBuildMode

Options for an uncommitted index segment build.

fragment_ids == NULL && fragment_count == 0 preserves native None and selects the whole dataset. A non-NULL pointer with fragment_count == 0 preserves native Some(empty). Any non-empty list is copied when the builder is created. Duplicate and missing-ID handling follows the native CreateIndexBuilder at build time. index_uuid, when non-NULL, points to exactly 16 RFC 4122 bytes and is also copied during builder creation. Lance does not support an assigned UUID for fragment-scoped BTree builds; leave it NULL for that combination.

The Arrow array/schema pairs provide vector model injection. Both pointers in a pair must be NULL or both must be non-NULL. Vector builder creation borrows model pairs synchronously. It may replace each ArrowArray struct but leaves a live caller-owned equivalent in place, so one trained model can be reused by multiple segment builders. Schemas remain caller-owned. Scalar builders reject non-NULL model pairs. Inputs must be valid Arrow C Data Interface trees; malformed arrays may be moved/released while reporting an error. Models produced by the trainer functions carry provenance metadata; vector builders reject mismatched metric/dimension or PQ/IVF model identity.

mode is zero-defaulted: AUTO uses a supplied model set, or trains locally when no model set is supplied. For IVF-PQ and IVF-HNSW-PQ, IVF centroids and the PQ codebook are one model set: callers must supply both or neither; partial model training is not supported. LOCAL_TRAIN rejects supplied models; PRECOMPUTED requires the complete model set needed by the selected vector index. Scalar builders accept AUTO and LOCAL_TRAIN. Passing NULL for the entire options pointer uses AUTO.

Temporary limitation: with the DOT metric, IVF-PQ and IVF-HNSW-PQ reject a supplied model set when the fragment selection is an effective strict subset of the dataset, in both AUTO and PRECOMPUTED modes. Cover every fragment in one segment (or pass NULL fragment_ids) until the upstream Lance distributed builder reconstructs supplied codebooks with an L2 ProductQuantizer. L2 and Cosine model sets are unaffected.

◆ LanceIndexSegmentBuildOptions

typedef struct LanceIndexSegmentBuildOptions LanceIndexSegmentBuildOptions

◆ LanceIndexTrainerOptions

typedef struct LanceIndexTrainerOptions LanceIndexTrainerOptions

Additive standalone IVF/PQ trainer controls. Zero-initialize this structure.

An absent field preserves the native trainer default. A present value is forwarded verbatim, including zero, and native validation and failure behavior apply.

◆ LanceKeyExistenceFilterKind

Kind of a native key-existence filter. Values are pinned for the ABI.

◆ LanceLsmPointLookupPlanner

Definition at line 11218 of file lance.h.

◆ LanceLsmScanner

Definition at line 11217 of file lance.h.

◆ LanceLsmVectorSearchPlanner

Definition at line 11219 of file lance.h.

◆ LanceMemWalIndexDetails

Definition at line 11212 of file lance.h.

◆ LanceMemWalPlan

Definition at line 11220 of file lance.h.

◆ LanceMemWalShardingField

Definition at line 11214 of file lance.h.

◆ LanceMemWalShardingSpec

Definition at line 11213 of file lance.h.

◆ LanceMemWalShardSnapshot

Definition at line 11215 of file lance.h.

◆ LanceMergeInsertParams

typedef struct LanceMergeInsertParams LanceMergeInsertParams

Tunable parameters for lance_dataset_merge_insert. Pass NULL to use the find-or-create defaults (DO_NOTHING / INSERT_ALL / KEEP).

Expression strings are read only when the corresponding mode requires them; spurious non-NULL pointers on other modes are rejected so the contract is unambiguous.

◆ LanceMergeInsertResult

typedef struct LanceMergeInsertResult LanceMergeInsertResult

Per-call merge statistics returned via the optional out parameter.

◆ LanceNamespaceContextProviderFn

typedef int32_t(* LanceNamespaceContextProviderFn) (void *provider_ctx, const char *operation, const char *object_id, LanceOwnedString *out_result_json, LanceCallbackError *out_error)

Synchronous, infallible dynamic context provider. Native may invoke it concurrently from REST worker threads, so the callback and provider_ctx must be thread-safe. It must not close or re-enter the originating namespace handle.

Return a JSON object of string values through out_result_json. The native REST client strips the headers. prefix from keys and applies them after base headers, so they override conflicts. operation and object_id are the native OperationInfo values and must not be retained.

A nonzero status or malformed JSON is logged by the native path and treated as an empty map; the request continues. Initialize the output and error with zeroed LanceOwnedString/LanceCallbackError values.

Definition at line 9749 of file lance.h.

◆ LanceNamespaceContextProviderSpec

typedef struct LanceNamespaceContextProviderSpec LanceNamespaceContextProviderSpec

Dynamic context provider declaration.

Ownership of provider_ctx and release transfers when this spec is passed to a namespace constructor, including when construction fails. It is released exactly once after the final native owner drops.

◆ LanceNamespaceCustomClientDispatchSpec

typedef struct LanceNamespaceCustomClientDispatchSpec LanceNamespaceCustomClientDispatchSpec

Foreign client with one dispatch callback for the four managed table/version operations.

Ownership of client_ctx and release transfers when this spec is passed to lance_namespace_custom_dispatch_new, including on construction failure. The context is released exactly once after the final native namespace Arc drops. namespace_id follows the same copied identity and cache semantics as LanceNamespaceCustomClientSpec. All operations other than the four listed above keep native Unsupported behavior.

◆ LanceNamespaceCustomClientSpec

typedef struct LanceNamespaceCustomClientSpec LanceNamespaceCustomClientSpec

◆ LanceNamespaceCustomDispatchFn

typedef int32_t(* LanceNamespaceCustomDispatchFn) (void *client_ctx, const char *operation, const char *request_json, LanceOwnedString *out_response_json, LanceCallbackError *out_error)

Shared dispatch callback for the same four managed table/version operations.

operation is one of the exact native snake_case names "describe_table", "describe_table_version", "create_table_version", or "list_table_versions". It is borrowed for this callback only and must not be retained. request_json has the same call-scoped lifetime. Response JSON ownership, callback errors, reentrant blocking behavior, and unsupported operations are identical to the per-operation callbacks above.

Definition at line 9989 of file lance.h.

◆ LanceNamespaceOperationFn

typedef int32_t(* LanceNamespaceOperationFn) (void *client_ctx, const char *request_json, LanceOwnedString *out_response_json, LanceCallbackError *out_error)

Foreign client for the four managed table/version callbacks Python exposes.

Each callback receives the native request model as JSON and must return the native response model as JSON. Nonzero status reports failure through LanceCallbackError; partial output is released exactly once. Generic callback codes map to native NamespaceError classes (for example LANCE_ERR_COMMIT_CONFLICT becomes ConcurrentModification). All other operations keep native Unsupported behavior.

Callbacks may run concurrently on native worker threads and must be thread-safe. They may synchronously call independent C handles. They run in the established reentrant blocking region, must not assume the same mutating dataset handle is reentrant, and must not close or re-enter the namespace handle that is invoking them. The final release may run while lance_namespace_close() is retiring that handle and must not access it.

Ownership of client_ctx and release transfers when this function is called, including on construction failure. The context is released exactly once after the final native namespace Arc drops.

Definition at line 9954 of file lance.h.

◆ LanceNamespaceResult

typedef struct LanceNamespaceResult LanceNamespaceResult

Result of one native namespace operation.

Zero-initialize this structure. Release it exactly once with lance_namespace_result_close, including after a failed call.

result_json encodes the native response model, except that unit operations leave it NULL, count_table_rows stores a JSON number, and explain/analyze_table_query_plan store a JSON string. query_table leaves result_json NULL and returns the native Arrow IPC stream in result_bytes.

On failure has_namespace_error is nonzero and the native NamespaceError is preserved separately from the generic C error code. Native Unsupported is code 0; the generic return value is still a failure and is never LANCE_OK.

◆ LanceNativeWriteOptions

Opaque owner of one native WriteParams plus retained native owners.

The handle is immutable after construction. It may be used by concurrent write calls, but lance_native_write_options_close must not run while any call that borrows the handle is still in flight.

Definition at line 6671 of file lance.h.

◆ LanceNativeWriteOptionsSpec

typedef struct LanceNativeWriteOptionsSpec LanceNativeWriteOptionsSpec

Borrowed configuration for lance_native_write_options_new.

Every pointer is read only during that constructor call. Values, strings, native owners and callback contexts are copied or cloned into the returned handle. Presence flags preserve native None versus Some(empty) and explicit false values.

Field mapping to native WriteParams:

  • write_options supplies max rows/bytes, data storage version, enable_stable_row_ids, auto-cleanup and skip_auto_cleanup.
  • transaction_properties maps to native None/Some(map) directly.
  • enable_v2_manifest_paths maps to the create-time native field; omitted keeps the native default. Native ignores it for existing datasets.
  • initial_bases, target_bases, target_base_names_or_paths and target_all_bases map directly, including primary-base ID 0 and dataset-URI references. Empty explicit target lists remain Some(empty) and are rejected by native resolution, not by this binding.
  • base_store_params maps exact base-path keys to native ObjectStoreParams using the representable fields above. The primary base is not a registered BasePath, so its storage comes from the write-level accessor; native target resolution owns that rule.
  • allow_external_blob_outside_bases, external_blob_mode and blob_pack_file_size_threshold map directly. Native validates incompatible combinations such as ingest plus allow-outside-bases.
  • file_writer_options maps to native FileWriterOptions; its raw-file version field must be NULL because dataset file-version selection belongs in write_options.params.data_storage_version.
  • session, storage_options_accessor and commit_lock are cloned into the handle. The caller may close the source handles after construction.
  • progress maps to native WriteParams::progress and write_progress. No wrapper-generated events are emitted.

◆ LanceNativeWriteProgress

typedef struct LanceNativeWriteProgress LanceNativeWriteProgress

Foreign dataset-write progress callbacks and their owned context.

Ownership of callback_ctx transfers only when lance_native_write_options_new succeeds. release is required whenever this descriptor is supplied. Omitted callbacks leave the corresponding native progress hook at its default.

◆ LanceNativeWriteProgressRelease

typedef void(* LanceNativeWriteProgressRelease) (void *callback_ctx)

Release a progress callback context exactly once.

The final native progress owner invokes this callback, which may happen after the write entry point returns or while the options handle is closed. It may run on a native worker thread and must not unwind.

Definition at line 6807 of file lance.h.

◆ LanceObjectStoreInfo

typedef struct LanceObjectStoreInfo LanceObjectStoreInfo

◆ LanceObjectStoreIoStats

typedef struct LanceObjectStoreIoStats LanceObjectStoreIoStats

◆ LanceObjectStoreRegistryStats

typedef struct LanceObjectStoreRegistryStats LanceObjectStoreRegistryStats

◆ LanceOwnedString

typedef struct LanceOwnedString LanceOwnedString

Owned, optional NUL-terminated UTF-8 string returned by a foreign callback.

When data is non-NULL, release must be non-NULL. The library copies the string before invoking release, then calls release exactly once. The release callback must free the storage behind data and return normally.

◆ LancePackedBlobWriter

Definition at line 10025 of file lance.h.

◆ LancePageMetadata

typedef struct LancePageMetadata LancePageMetadata

◆ LancePathList

typedef struct LancePathList LancePathList

Definition at line 10029 of file lance.h.

◆ LanceRemovalStats

typedef struct LanceRemovalStats LanceRemovalStats

Copied native RemovalStats.

failed_deletes counts files that cleanup attempted but could not remove. Those files are not counted as removed and are found again by a later cleanup. Cleanup does not roll back deletes that already succeeded when a later file fails.

◆ LanceScalarIndexOptions

typedef struct LanceScalarIndexOptions LanceScalarIndexOptions

Additive scalar-index build controls.

has_train == false preserves the native default (train=true). When true, train is forwarded exactly to the native CreateIndexBuilder.

◆ LanceScanStats

typedef struct LanceScanStats LanceScanStats

◆ LanceSchedulerConfig

typedef struct LanceSchedulerConfig LanceSchedulerConfig

Native scheduler configuration.

use_lite_scheduler is a LanceSchedulerLiteMode. AUTO delegates to SchedulerConfig::new and its environment policy, STANDARD maps to Some(false), and LITE maps to Some(true).

◆ LanceSessionCacheSpec

typedef struct LanceSessionCacheSpec LanceSessionCacheSpec

Description of one session cache tier.

Only the field selected by kind is read:

  • DEFAULT reads no additional fields.
  • SIZE reads size_bytes. Zero is an explicit zero capacity, not DEFAULT.
  • URI reads backend_uri.
  • CONFIG reads backend_kind, then option_count entries from the parallel option_keys and option_values arrays.

All strings must be NUL-terminated UTF-8. option_count is an exact count, not a NULL-terminated sentinel: when it is non-zero, both option arrays must be non-NULL and each selected key/value must be non-NULL. Duplicate option keys are rejected. Unused fields are ignored.

Every buffer is borrowed only for the duration of lance_session_new_with_cache_specs(). Backend construction happens before it returns, and the caller retains ownership of all buffers.

◆ LanceSessionCacheStats

typedef struct LanceSessionCacheStats LanceSessionCacheStats

Thread-safety contract for opaque handles and exported streams.

A handle pointer is a lifetime token, not a lock. A const parameter or a native Send/Sync bound does not by itself allow arbitrary concurrent calls through one C pointer; only the operations described here and at the handle's own declaration may overlap. Handles not listed here are not implicitly shareable.

  • LanceDataset: snapshot reads and in-place mutations may run concurrently. Mutations serialize on the handle's internal write lock, which is held for the complete native call, including synchronous callbacks. Readers that already hold a snapshot keep their old view.
  • LanceSession: inspection calls may run concurrently, and one session may back concurrent opens. Statistics are current values, not one atomic snapshot across cache tiers.
  • LanceFileReader: read-only calls may run concurrently. Each read creates an independent stream.
  • LanceNamespace: ordinary calls may run concurrently. Custom operation and context-provider callbacks must be thread-safe.
  • LanceScanner and LanceFileWriter: serialize all calls on one handle.
  • ArrowArrayStream: serialize get_schema, get_next, get_last_error and release on one stream. Different streams are independent. get_last_error returns a borrowed pointer owned by the stream; it is valid only until the next operation on that stream or release.

lance_*_close and lance_*_free take exclusive ownership of their pointer: they must not overlap any other use of that pointer. Closing a handle releases only that handle. Successfully returned children and snapshots keep the native ownership described at their declarations and may outlive the producer. Borrowed pointers keep only their documented lifetime; concurrent use of the producer does not extend it, and a mutable call or close may invalidate it.

Synchronous callbacks run inside the native call that invoked them. A callback must not close or re-enter the handle whose call is still on the stack; use an independent handle or a snapshot acquired before the call. Callbacks that native code may run on another thread or concurrently must be thread-safe as stated at their declaration. Snapshot of a shared session's cache statistics.

Cache sizes are the bytes currently retained, not their configured limits.

◆ LanceShardWriter

Definition at line 11216 of file lance.h.

◆ LanceSqlColumn

typedef struct LanceSqlColumn LanceSqlColumn

A single new column defined by a SQL expression over the dataset's existing columns, e.g. { .name = "doubled", .expression = "x * 2" }. Both fields are required, non-empty UTF-8, and are read by shared reference for the duration of the call.

◆ LanceStorageOptionsFetchFn

typedef int32_t(* LanceStorageOptionsFetchFn) (void *provider_ctx, LanceStorageOptionsFetchResult *out, LanceCallbackError *error)

Fetch storage options.

Return 0 on success. Return nonzero on failure and initialize error with a typed LanceCallbackError. A callback must not report failure through lance_last_error_* because it may run on a native worker thread.

Definition at line 9600 of file lance.h.

◆ LanceStorageOptionsFetchResult

typedef struct LanceStorageOptionsFetchResult LanceStorageOptionsFetchResult

Result of one provider fetch.

has_options == 0 means native None. Any nonzero value means native Some; count == 0 then means Some(empty). Key and value arrays must contain exactly count entries.

The library copies the complete map and the callback error message before calling release_snapshot. release_snapshot, when non-NULL, is called exactly once on every path after the result struct was initialized, including malformed partial results and callback errors. Without a release callback the map storage is borrowed for the callback only.

◆ LanceStorageOptionsInput

typedef struct LanceStorageOptionsInput LanceStorageOptionsInput

Borrowed static storage options.

A NULL LanceStorageOptionsInput* passed to accessor construction means native None. A non-NULL input, including one with count == 0, means native Some, so an empty map is distinct from no options. Duplicate keys follow the native map's last-write-wins behavior.

◆ LanceStorageOptionsProvider

Definition at line 9554 of file lance.h.

◆ LanceStorageOptionsProviderReleaseFn

typedef void(* LanceStorageOptionsProviderReleaseFn) (void *provider_ctx)

Release the provider context exactly once.

Definition at line 9607 of file lance.h.

◆ LanceStorageOptionsProviderSpec

typedef struct LanceStorageOptionsProviderSpec LanceStorageOptionsProviderSpec

Foreign storage-options provider declaration.

fetch is required. force_fetch is optional; omission follows the native trait default and calls fetch. provider_id is copied and must be non-empty. It preserves native equality and object-store registry cache identity, so equal IDs may share a native store.

Ownership of provider_ctx and release transfers only when lance_storage_options_provider_new succeeds. The library retains the context through every native owner that still needs its credentials, including accessors and datasets, and calls release(provider_ctx) exactly once when the final owner drops. Object-store registry cache entries do not keep the context alive.

◆ LanceStorageOptionsSnapshot

Definition at line 9555 of file lance.h.

◆ LanceStringList

typedef struct LanceStringList LanceStringList

Borrowed list of NUL-terminated UTF-8 strings.

A NULL pointer maps to native None. A non-NULL pointer with count == 0 maps to native Some(empty). Values are copied by lance_native_write_options_new.

◆ LanceTrackedFilesOptions

typedef struct LanceTrackedFilesOptions LanceTrackedFilesOptions

Options for lance_dataset_tracked_files_stream.

A NULL options pointer uses native defaults. A non-zero has_min_version forwards min_version, including zero. progress == NULL disables progress reporting.

◆ LanceTrackedFilesProgress

typedef struct LanceTrackedFilesProgress LanceTrackedFilesProgress

Foreign progress callback and owned context for tracked-file enumeration.

When passed to lance_dataset_tracked_files_stream, both function pointers must be non-NULL. Ownership of callback_ctx transfers to the library before any other validation. release(callback_ctx) is called exactly once, including on factory errors and early stream release. Until release runs, the callback and context must remain valid. The stream's own release callback may return before an in-flight native progress callback finishes.

◆ LanceTrackedFilesProgressCallback

typedef void(* LanceTrackedFilesProgressCallback) (void *callback_ctx, uint64_t manifests_processed, const uint64_t *manifests_total)

Tracked-files progress callback.

manifests_total is NULL when the native total is not yet known. Otherwise it points to a value borrowed for the duration of this call only. Native learns the total from a manifest listing that races the walk, so it may stay NULL for some or all updates, including the update that completes the last manifest; it is an optional hint, not a completion signal. Progress callbacks run on a native background task and must not block or unwind.

Definition at line 1663 of file lance.h.

◆ LanceTrackedFilesProgressRelease

typedef void(* LanceTrackedFilesProgressRelease) (void *callback_ctx)

Release a tracked-files progress context.

The library invokes this exactly once after the native emitter releases the progress closure. It may run on a native worker after the exported stream was released or after the stream factory returned an error. Must not unwind.

Definition at line 1676 of file lance.h.

◆ LanceTransactionOptions

typedef struct LanceTransactionOptions LanceTransactionOptions

Options for one-shot native transaction construction.

uuid == NULL lets Lance generate a v4 UUID. A non-NULL value, including an empty string, is passed through unchanged. tag == NULL maps to native None; a non-NULL empty string maps to Some("").

has_transaction_properties == false maps to native None. has_transaction_properties == true maps to Some(map), including Some(empty) when property_count == 0. If property_count > 0, property_keys and property_values must contain that many non-NULL UTF-8 strings. Keys and values are separate parallel arrays, so keys may contain any character, including =. Duplicate keys follow native last-write-wins map behavior.

◆ LanceTransactionProperties

typedef struct LanceTransactionProperties LanceTransactionProperties

Optional transaction properties for one native add_bases commit.

keys and values are parallel arrays of length count; every key and value must be a non-NULL C string. Empty strings are values. Duplicate keys follow native HashMap last-write-wins behavior.

◆ LanceUDFBatchInfo

typedef struct LanceUDFBatchInfo LanceUDFBatchInfo

Native BatchInfo passed to checkpoint callbacks. The pointer is borrowed for the callback only. batch_index is size_t to match native usize.

◆ LanceUDFCheckpointGetBatch

typedef int32_t(* LanceUDFCheckpointGetBatch) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *output, LanceCallbackError *error)

Retrieve a checkpointed output batch.

Return 1 with output initialized to an owned ArrowArray, 0 with output left zero-initialized, or -1 with error initialized.

Definition at line 2036 of file lance.h.

◆ LanceUDFCheckpointGetBatchV2

typedef int32_t(* LanceUDFCheckpointGetBatchV2) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *output, struct ArrowSchema *output_schema, LanceCallbackError *error)

Retrieve a checkpointed output batch together with its schema.

Return 1 with both output and output_schema initialized to owned Arrow C Data values, 0 with both slots left zero-initialized, or -1 with error initialized. The schema is authoritative: native stores a checkpoint context marker in its metadata, so the callback must retain and return the exact schema received through LanceUDFCheckpointInsertBatch. Rebuilding a batch from the declared output schema drops that metadata and native rejects the hit as incompatible.

Definition at line 2054 of file lance.h.

◆ LanceUDFCheckpointGetFragment

typedef int32_t(* LanceUDFCheckpointGetFragment) (void *callback_ctx, uint32_t fragment_id, LanceOwnedString *out_json, LanceCallbackError *error)

Retrieve native Fragment JSON for a fragment checkpoint hit.

Return 1 with out_json initialized, 0 for a miss, or -1 with error. The library copies the JSON before calling out_json->release exactly once.

Definition at line 2085 of file lance.h.

◆ LanceUDFCheckpointInsertBatch

typedef int32_t(* LanceUDFCheckpointInsertBatch) (void *callback_ctx, const LanceUDFBatchInfo *info, struct ArrowArray *batch, struct ArrowSchema *batch_schema, LanceCallbackError *error)

Retain a checkpoint batch.

batch and batch_schema are owned, movable Arrow C Data Interface values. The callback may move both structs into its storage and clear the source release fields. The library releases any ownership left in these argument slots after the callback returns, so a retained value can outlive the call and dataset close. Return 0 on success or -1 with error.

Definition at line 2071 of file lance.h.

◆ LanceUDFCheckpointInsertFragment

typedef int32_t(* LanceUDFCheckpointInsertFragment) (void *callback_ctx, uint64_t fragment_id, const char *fragment_json, LanceCallbackError *error)

Persist native Fragment JSON and its native u64 Fragment ID.

fragment_json is borrowed for the callback only. Return 0 on success or -1 with error.

Definition at line 2098 of file lance.h.

◆ LanceUDFCheckpointStore

typedef struct LanceUDFCheckpointStore LanceUDFCheckpointStore

Foreign UDFCheckpointStore adapter.

All four callbacks are required. callback_ctx is a call-scoped borrow and may be NULL for stateless callbacks. The library neither retains nor releases it.

◆ LanceUDFCheckpointStoreV2

typedef struct LanceUDFCheckpointStoreV2 LanceUDFCheckpointStoreV2

Schema-aware foreign UDFCheckpointStore adapter.

Same contract as LanceUDFCheckpointStore, but get_batch returns the batch schema alongside the batch. Insert and fragment callbacks are shared with the original struct. All four callbacks are required when engaged.

◆ LanceUInt32List

typedef struct LanceUInt32List LanceUInt32List

Borrowed list of native u32 values.

A NULL pointer maps to native None. A non-NULL pointer with count == 0 maps to native Some(empty). Values are copied by lance_native_write_options_new.

◆ LanceUncommittedWriteOptions

typedef struct LanceUncommittedWriteOptions LanceUncommittedWriteOptions

Native write options for an uncommitted Arrow stream.

write reuses the LanceWriteOptions mapping from the committing writer. Pass an all-zero struct for native WriteParams::default().

write.skip_auto_cleanup is parsed but cannot affect this call because no commit occurs. Pass the same setting through LanceCommitOptions when publishing the returned transaction. write.auto_cleanup still participates in a CREATE transaction's native config upsert.

transaction_properties is a NULL-terminated key-value array. NULL means native None. A non-NULL pointer, including one whose first entry is NULL, means native Some and distinguishes an explicitly empty map. The selected core's CommitBuilder has a separate transaction-properties setter, but its execute/execute_batch path does not apply that field; properties for this delivery are therefore carried by the transaction produced here.

◆ LanceUpdateConfigOperationOptions

typedef struct LanceUpdateConfigOperationOptions LanceUpdateConfigOperationOptions

Borrowed UpdateConfig operation inputs.

Each map pointer is optional: NULL maps to native None and a non-NULL handle is cloned, including an explicitly empty map. field_metadata_updates may be NULL only when field_metadata_update_count == 0.

◆ LanceUpdateMap

Owned native UpdateMap snapshot.

A native update map is an ordered list of key edits plus a replacement flag, not a hash map. Duplicate keys, entry order and absent values are native data. Native commit code applies entries in order: replacement clears the target and inserts only entries that carry a value, while incremental mode upserts values and removes keys whose value is None.

Definition at line 7192 of file lance.h.

◆ LanceUpdateMode

Native update mode for an Update operation. Values are pinned for the ABI.

◆ LanceUpdateOperationOptions

typedef struct LanceUpdateOperationOptions LanceUpdateOperationOptions

Complete input for lance_operation_update_new().

Every array is borrowed for the duration of the call and copied into native owned values. A NULL array is accepted only with a zero count. Native fields are not defaulted: an empty fields_modified, compacted_sstables, removed_fragment_ids or fields_for_preserving_frag_bitmap means the caller supplied none.

A NULL inserted_rows_filter or updated_fragment_offsets maps to native None, as does has_update_mode == false; these are distinct from the populated and empty-value states. update_mode is ignored unless has_update_mode is true and must then be a LanceUpdateMode value.

This struct grows only by appending fields.

◆ LanceVectorIndexOptions

typedef struct LanceVectorIndexOptions LanceVectorIndexOptions

Additive native vector-build options. Zero-initialize this structure.

Optional numeric fields distinguish absent (is_set == false) from an explicit value, including zero. Native Lance code owns defaults, validation timing and execution semantics. num_bits applies to IVF_PQ and IVF_RQ; absent PQ bits use the native default and an absent RQ value uses the native default of 5. num_partitions and target_partition_size may be absent for native automatic sizing.

ivf_centroids and pq_codebook are native Arrow C Data Interface FixedSizeList values. The whole options object is borrowed only for this call. A non-NULL ArrowArray may be replaced while a live caller-owned equivalent is left in place; the schema remains caller-owned. Both members of each pair must be NULL or non-NULL. Native model shape and dtype acceptance is not narrowed here.

rabitq_model_json is the native RabitQuantizationMetadata JSON accepted by IVF_RQ. Use lance_index_build_rq_model() to mint a portable fast rotation. runtime_hints may contain arbitrary UTF-8 keys and values and does not enable any accelerator execution in this binding.

has_train == false retains the native default train=true.

◆ LanceVectorIndexSegmentParams

typedef struct LanceVectorIndexSegmentParams LanceVectorIndexSegmentParams

Vector parameters with fixed-width, boundary-validated discriminants. num_partitions is required for every variant; num_sub_vectors is required for PQ variants; hnsw_m is required for HNSW variants. num_bits is 0 for the Lance default (8). PQ accepts 4 or 8; SQ accepts only 8.

◆ LanceVectorIndexSegmentScope

typedef struct LanceVectorIndexSegmentScope LanceVectorIndexSegmentScope

Fragment selection and optional segment UUID for the additive vector builder.

A NULL scope preserves both native selections as None. Within a non-NULL scope, a NULL fragment_ids with count 0 is None, while a non-NULL pointer with count 0 is Some(empty). IDs and a non-NULL UUID are copied at builder creation; native Lance code decides duplicate/missing validation and timing. index_uuid, when non-NULL, points to exactly 16 RFC 4122 bytes.

◆ LanceWriteFragmentProgressCallback

typedef int32_t(* LanceWriteFragmentProgressCallback) (void *callback_ctx, const LanceWriteFragmentProgressInfo *info, LanceCallbackError *error)

Report native begin/complete fragment progress.

Return 0 on success. A nonzero status reports failure through error; the write then follows native cleanup and no-commit behavior. Callbacks may run concurrently from native worker threads and must be thread-safe. info is borrowed and must not be retained. error is zero-initialized before every invocation; LanceCallbackError uses the same code/message ownership rules as other callback APIs.

Definition at line 6783 of file lance.h.

◆ LanceWriteFragmentProgressInfo

typedef struct LanceWriteFragmentProgressInfo LanceWriteFragmentProgressInfo

Native fragment progress payload, borrowed for one callback invocation.

physical_rows is present for complete-fragment events and normally absent for begin-fragment events, matching the native fragment state at each call.

◆ LanceWriteOptions

typedef struct LanceWriteOptions LanceWriteOptions

Native write options for lance_dataset_write_with_options.

Zero-initialize this struct to select native WriteParams::default(): auto_cleanup = NULL (native None) and skip_auto_cleanup = false. The embedded params retains the zero-means-upstream-default mapping of LanceWriteParams.

A non-NULL auto_cleanup selects native Some, including interval 0 or a zero-length retention window. skip_auto_cleanup affects only the current commit and never changes persisted configuration.

◆ LanceWriteParams

typedef struct LanceWriteParams LanceWriteParams

Tunable parameters for lance_dataset_write_with_params. Numeric fields default-out via 0; data_storage_version defaults out via NULL.

Note: enable_stable_row_ids is a bool and therefore has no default sentinel — callers that zero-initialize this struct end up explicitly setting it to false (which matches upstream's current default).

◆ LanceWriteStats

typedef struct LanceWriteStats LanceWriteStats

Native cumulative WriteStats passed to the write-stats callback.

bytes_written and rows_written are cumulative. files_written counts completed native data files/fragments. Values describe actual native progress, not wrapper estimates.

◆ LanceWriteStatsCallback

typedef void(* LanceWriteStatsCallback) (void *callback_ctx, const LanceWriteStats *stats)

Receive cumulative native WriteStats.

Native write progress has no error channel. The callback must be cheap, non-blocking, thread-safe and must not unwind.

Definition at line 6795 of file lance.h.

Enumeration Type Documentation

◆ LanceApproxMode

Speed / accuracy tradeoff for approximate vector search.

Enumerator
LANCE_APPROX_MODE_FAST 
LANCE_APPROX_MODE_NORMAL 
LANCE_APPROX_MODE_ACCURATE 

Definition at line 83 of file lance.h.

◆ LanceBlobReadOrder

Result ordering for planned blob reads.

Enumerator
LANCE_BLOB_READ_PRESERVE_ORDER 
LANCE_BLOB_READ_UNORDERED 

Definition at line 4474 of file lance.h.

◆ LanceBlobRowSelector

Row selector for planned blob reads. The C ABI passes this as an int32_t, so callers built with non-default enum sizing cannot mismatch the Rust ABI.

NONE leaves the native builder without a selection and therefore preserves the native "requires a row selection" error. IDS, ADDRESSES and INDICES with a zero count are explicit empty selections and produce an empty stream.

Enumerator
LANCE_BLOB_ROWS_NONE 
LANCE_BLOB_ROWS_IDS 
LANCE_BLOB_ROWS_ADDRESSES 
LANCE_BLOB_ROWS_INDICES 

Definition at line 4464 of file lance.h.

◆ LanceCleanupFileKind

Native CleanupFileKind discriminants. Accessors return a fixed-width int32_t carrying one of these values.

Enumerator
LANCE_CLEANUP_FILE_MANIFEST 
LANCE_CLEANUP_FILE_DATA 
LANCE_CLEANUP_FILE_TRANSACTION 
LANCE_CLEANUP_FILE_INDEX 
LANCE_CLEANUP_FILE_DELETION 
LANCE_CLEANUP_FILE_TEMPORARY_MANIFEST 

Definition at line 501 of file lance.h.

◆ LanceColumnNullableMode

Tri-state nullability override for LanceColumnAlteration. The UNCHANGED discriminant is zero so a zero-initialised LanceColumnAlteration leaves nullability alone by default.

Discriminants are pinned for ABI stability. Out-of-range values are rejected with LANCE_ERR_INVALID_ARGUMENT — that's why the field on LanceColumnAlteration is int32_t, not this enum directly.

Enumerator
LANCE_COLUMN_NULLABLE_UNCHANGED 
LANCE_COLUMN_NULLABLE_TRUE 
LANCE_COLUMN_NULLABLE_FALSE 

Definition at line 2849 of file lance.h.

◆ LanceCommitTimeoutMode

Tri-state mapping for the native overall commit timeout.

Enumerator
LANCE_COMMIT_TIMEOUT_DEFAULT 

Keep the native default (30 minutes).

LANCE_COMMIT_TIMEOUT_DISABLED 

Pass None and disable the overall timeout.

LANCE_COMMIT_TIMEOUT_EXPLICIT 

Use the explicit seconds/nanoseconds value, including zero.

Definition at line 7337 of file lance.h.

◆ LanceCompactionMode

Controls how data is rewritten during compaction.

Enumerator
LANCE_COMPACTION_REENCODE 
LANCE_COMPACTION_TRY_BINARY_COPY 
LANCE_COMPACTION_FORCE_BINARY_COPY 

Definition at line 2376 of file lance.h.

◆ LanceDataOverlayCoverageKind

Coverage layout for a data overlay.

LANCE_DATA_OVERLAY_COVERAGE_SHARED stores one bitmap covering every field in the overlay data file. LANCE_DATA_OVERLAY_COVERAGE_PER_FIELD stores one bitmap per field in data_file.fields order. The FFI takes the integer value so unknown kinds are rejected with a descriptive error.

Enumerator
LANCE_DATA_OVERLAY_COVERAGE_SHARED 
LANCE_DATA_OVERLAY_COVERAGE_PER_FIELD 

Definition at line 7551 of file lance.h.

◆ LanceDataType

Enumerator
LANCE_DTYPE_FLOAT32 
LANCE_DTYPE_FLOAT16 
LANCE_DTYPE_FLOAT64 
LANCE_DTYPE_UINT8 
LANCE_DTYPE_INT8 

Definition at line 89 of file lance.h.

◆ LanceExternalBlobMode

Native external blob handling for a dataset write.

The FFI field is a fixed-width int32_t; out-of-range values are rejected with LANCE_ERR_INVALID_ARGUMENT.

Enumerator
LANCE_EXTERNAL_BLOB_REFERENCE 
LANCE_EXTERNAL_BLOB_INGEST 

Definition at line 6679 of file lance.h.

◆ LanceFieldReferenceKind

Selects a field by numeric ID or by Lance field path.

Enumerator
LANCE_FIELD_REFERENCE_ID 
LANCE_FIELD_REFERENCE_PATH 

Definition at line 869 of file lance.h.

◆ LanceFileCacheMode

Enumerator
LANCE_FILE_CACHE_NONE 
LANCE_FILE_CACHE_SESSION 

Definition at line 10033 of file lance.h.

◆ LanceFileEncodingKind

Enumerator
LANCE_FILE_ENCODING_ABSENT 
LANCE_FILE_ENCODING_NONE 
LANCE_FILE_ENCODING_DIRECT 
LANCE_FILE_ENCODING_INDIRECT 

Definition at line 10507 of file lance.h.

◆ LanceFileFormatVersion

Enumerator
LANCE_FILE_FORMAT_V1 
LANCE_FILE_FORMAT_V2_0 
LANCE_FILE_FORMAT_V2_1 
LANCE_FILE_FORMAT_V2_2 
LANCE_FILE_FORMAT_V2_3 

Definition at line 10479 of file lance.h.

◆ LanceFtsCoverageMode

Required relationship between a pinned dataset snapshot and its committed FTS index segments. Values are ABI-stable; API parameters use int32_t.

Enumerator
LANCE_FTS_COVERAGE_STRICT 

Fail prepare if any current fragment is not covered by the FTS index.

LANCE_FTS_COVERAGE_INDEX_ONLY 

Score and search only rows covered by committed FTS index segments.

Definition at line 5981 of file lance.h.

◆ LanceFtsDocumentGranularity

Document unit selected by a Match or Phrase query.

Enumerator
LANCE_FTS_DOCUMENT_GRANULARITY_UNSPECIFIED 

Infer the granularity stored by the target FTS index.

LANCE_FTS_DOCUMENT_GRANULARITY_ROW 

All text selected from one dataset row is one document.

LANCE_FTS_DOCUMENT_GRANULARITY_LIST_ELEMENT 

Each element of the deepest list on the field path is one document.

Definition at line 5997 of file lance.h.

◆ LanceFtsMatchOperator

How the analyzed terms of one Match query are combined.

Enumerator
LANCE_FTS_MATCH_OPERATOR_OR 

At least one analyzed term must match.

LANCE_FTS_MATCH_OPERATOR_AND 

Every analyzed term must match.

Definition at line 5989 of file lance.h.

◆ LanceFtsOccur

Membership requirement for one Boolean query clause.

Enumerator
LANCE_FTS_OCCUR_SHOULD 

The clause may match and contributes its score when it does.

LANCE_FTS_OCCUR_MUST 

The clause must match and contributes its score.

LANCE_FTS_OCCUR_MUST_NOT 

The clause must not match and never contributes to the score.

Definition at line 6007 of file lance.h.

◆ LanceIndexBuildProgressEvent

Event codes for LanceIndexBuildProgressCallback, passed as the event argument. Exactly one stage is active at a time: a stage's LANCE_INDEX_BUILD_PROGRESS_STAGE_COMPLETE is always delivered before the next stage's LANCE_INDEX_BUILD_PROGRESS_STAGE_START.

Enumerator
LANCE_INDEX_BUILD_PROGRESS_STAGE_START 
LANCE_INDEX_BUILD_PROGRESS_STAGE_PROGRESS 
LANCE_INDEX_BUILD_PROGRESS_STAGE_COMPLETE 

Definition at line 4622 of file lance.h.

◆ LanceIndexFileVersion

Enumerator
LANCE_INDEX_FILE_VERSION_V3 
LANCE_INDEX_FILE_VERSION_LEGACY 

Definition at line 115 of file lance.h.

◆ LanceIndexRemapMode

Controls how the old-to-new row-address mapping is represented.

Enumerator
LANCE_INDEX_REMAP_COMPACT 
LANCE_INDEX_REMAP_DIRECT 

Definition at line 2383 of file lance.h.

◆ LanceIndexSegmentBuildMode

Options for an uncommitted index segment build.

fragment_ids == NULL && fragment_count == 0 preserves native None and selects the whole dataset. A non-NULL pointer with fragment_count == 0 preserves native Some(empty). Any non-empty list is copied when the builder is created. Duplicate and missing-ID handling follows the native CreateIndexBuilder at build time. index_uuid, when non-NULL, points to exactly 16 RFC 4122 bytes and is also copied during builder creation. Lance does not support an assigned UUID for fragment-scoped BTree builds; leave it NULL for that combination.

The Arrow array/schema pairs provide vector model injection. Both pointers in a pair must be NULL or both must be non-NULL. Vector builder creation borrows model pairs synchronously. It may replace each ArrowArray struct but leaves a live caller-owned equivalent in place, so one trained model can be reused by multiple segment builders. Schemas remain caller-owned. Scalar builders reject non-NULL model pairs. Inputs must be valid Arrow C Data Interface trees; malformed arrays may be moved/released while reporting an error. Models produced by the trainer functions carry provenance metadata; vector builders reject mismatched metric/dimension or PQ/IVF model identity.

mode is zero-defaulted: AUTO uses a supplied model set, or trains locally when no model set is supplied. For IVF-PQ and IVF-HNSW-PQ, IVF centroids and the PQ codebook are one model set: callers must supply both or neither; partial model training is not supported. LOCAL_TRAIN rejects supplied models; PRECOMPUTED requires the complete model set needed by the selected vector index. Scalar builders accept AUTO and LOCAL_TRAIN. Passing NULL for the entire options pointer uses AUTO.

Temporary limitation: with the DOT metric, IVF-PQ and IVF-HNSW-PQ reject a supplied model set when the fragment selection is an effective strict subset of the dataset, in both AUTO and PRECOMPUTED modes. Cover every fragment in one segment (or pass NULL fragment_ids) until the upstream Lance distributed builder reconstructs supplied codebooks with an L2 ProductQuantizer. L2 and Cosine model sets are unaffected.

Enumerator
LANCE_INDEX_SEGMENT_BUILD_AUTO 
LANCE_INDEX_SEGMENT_BUILD_LOCAL_TRAIN 
LANCE_INDEX_SEGMENT_BUILD_PRECOMPUTED 

Definition at line 4908 of file lance.h.

◆ LanceKeyExistenceFilterKind

Kind of a native key-existence filter. Values are pinned for the ABI.

Enumerator
LANCE_KEY_EXISTENCE_FILTER_EXACT 
LANCE_KEY_EXISTENCE_FILTER_BLOOM 

Definition at line 8556 of file lance.h.

◆ LanceMemWalDistanceType

Distance metric for a MemWAL vector search plan.

These values are this ABI's stable mapping, not native enum discriminants. New metrics append; existing values never change.

Enumerator
LANCE_MEM_WAL_DISTANCE_L2 
LANCE_MEM_WAL_DISTANCE_COSINE 
LANCE_MEM_WAL_DISTANCE_DOT 
LANCE_MEM_WAL_DISTANCE_HAMMING 

Definition at line 11057 of file lance.h.

◆ LanceMemWalShardingMode

How initialize_mem_wal() partitions rows into shards.

These values are this ABI's stable mapping, not native enum discriminants. New modes append; existing values never change.

Enumerator
LANCE_MEM_WAL_SHARDING_MANUAL 
LANCE_MEM_WAL_SHARDING_UNSHARDED 
LANCE_MEM_WAL_SHARDING_BUCKET 
LANCE_MEM_WAL_SHARDING_IDENTITY 

Definition at line 11044 of file lance.h.

◆ LanceMergeWhenMatched

Behavior when a target row matches a source row on the join keys. Defaults are zero-valued so a zero-initialized LanceMergeInsertParams is a valid find-or-create configuration.

Enumerator
LANCE_MERGE_WHEN_MATCHED_DO_NOTHING 
LANCE_MERGE_WHEN_MATCHED_UPDATE_ALL 
LANCE_MERGE_WHEN_MATCHED_UPDATE_IF 
LANCE_MERGE_WHEN_MATCHED_FAIL 
LANCE_MERGE_WHEN_MATCHED_DELETE 

Definition at line 1829 of file lance.h.

◆ LanceMergeWhenNotMatched

Behavior when a source row has no matching target row.

Enumerator
LANCE_MERGE_WHEN_NOT_MATCHED_INSERT_ALL 
LANCE_MERGE_WHEN_NOT_MATCHED_DO_NOTHING 

Definition at line 1844 of file lance.h.

◆ LanceMergeWhenNotMatchedBySource

Behavior when a target row has no matching source row.

Enumerator
LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_KEEP 
LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_DELETE 
LANCE_MERGE_WHEN_NOT_MATCHED_BY_SOURCE_DELETE_IF 

Definition at line 1852 of file lance.h.

◆ LanceMetadataUpdateMode

How a metadata update applies to the existing map.

Enumerator
LANCE_METADATA_UPDATE_MERGE 
LANCE_METADATA_UPDATE_REPLACE 

Definition at line 796 of file lance.h.

◆ LanceMetricType

Enumerator
LANCE_METRIC_L2 
LANCE_METRIC_COSINE 
LANCE_METRIC_DOT 
LANCE_METRIC_HAMMING 

Definition at line 75 of file lance.h.

◆ LanceOperationKind

Native operation variant. Discriminants are ABI-stable.

Append and Overwrite are constructed by the native writer. Overwrite, Merge, Clone and UpdateConfig have typed native constructors and inspection. Delete, CreateIndex, DataReplacement and Project have their existing typed constructors and inspection. The other variants can be read from history and inspected by kind; their constructors and variant-specific mutation helpers remain later issue #112 scope.

Enumerator
LANCE_OPERATION_UNKNOWN 
LANCE_OPERATION_APPEND 
LANCE_OPERATION_DELETE 
LANCE_OPERATION_OVERWRITE 
LANCE_OPERATION_CREATE_INDEX 
LANCE_OPERATION_REWRITE 
LANCE_OPERATION_DATA_REPLACEMENT 
LANCE_OPERATION_DATA_OVERLAY 
LANCE_OPERATION_MERGE 
LANCE_OPERATION_RESTORE 
LANCE_OPERATION_RESERVE_FRAGMENTS 
LANCE_OPERATION_UPDATE 
LANCE_OPERATION_PROJECT 
LANCE_OPERATION_UPDATE_CONFIG 
LANCE_OPERATION_UPDATE_MEM_WAL_STATE 
LANCE_OPERATION_CLONE 
LANCE_OPERATION_UPDATE_BASES 

Definition at line 7293 of file lance.h.

◆ LanceScalarIndexType

Enumerator
LANCE_SCALAR_BTREE 
LANCE_SCALAR_BITMAP 
LANCE_SCALAR_LABEL_LIST 
LANCE_SCALAR_INVERTED 
LANCE_SCALAR_NGRAM 
LANCE_SCALAR_ZONE_MAP 
LANCE_SCALAR_BLOOM_FILTER 
LANCE_SCALAR_MINHASH_LSH 
LANCE_SCALAR_RTREE 

Definition at line 63 of file lance.h.

◆ LanceSchedulerLiteMode

Enumerator
LANCE_SCHEDULER_LITE_AUTO 
LANCE_SCHEDULER_LITE_STANDARD 
LANCE_SCHEDULER_LITE_LITE 

Definition at line 10091 of file lance.h.

◆ LanceSessionCacheSpecKind

Cache selection for one session cache tier.

Discriminants are ABI-stable. The kind field in LanceSessionCacheSpec is a fixed-width int32_t, not this enum type, so callers built with non-default enum sizing cannot mismatch the Rust ABI.

Enumerator
LANCE_SESSION_CACHE_SPEC_DEFAULT 
LANCE_SESSION_CACHE_SPEC_SIZE 
LANCE_SESSION_CACHE_SPEC_URI 
LANCE_SESSION_CACHE_SPEC_CONFIG 

Definition at line 356 of file lance.h.

◆ LanceUpdateMode

Native update mode for an Update operation. Values are pinned for the ABI.

Enumerator
LANCE_UPDATE_MODE_REWRITE_ROWS 
LANCE_UPDATE_MODE_REWRITE_COLUMNS 

Definition at line 8527 of file lance.h.

◆ LanceVectorIndexType

Enumerator
LANCE_INDEX_IVF_FLAT 
LANCE_INDEX_IVF_SQ 
LANCE_INDEX_IVF_PQ 
LANCE_INDEX_IVF_HNSW_SQ 
LANCE_INDEX_IVF_HNSW_PQ 
LANCE_INDEX_IVF_HNSW_FLAT 
LANCE_INDEX_IVF_RQ 

Definition at line 53 of file lance.h.

◆ LanceWriteMode

Write mode for lance_dataset_write. Values are ABI-stable.

The mode parameter on the FFI call is a fixed-width int32_t — not this enum type — so callers built with -fshort-enums or non-default enum sizing cannot mismatch the Rust ABI. The Rust implementation validates the received integer and rejects any out-of-range value with LANCE_ERR_INVALID_ARGUMENT.

Enumerator
LANCE_WRITE_CREATE 
LANCE_WRITE_APPEND 
LANCE_WRITE_OVERWRITE 

Definition at line 6411 of file lance.h.

Function Documentation

◆ lance_blob_descriptor_array_builder_append_dedicated()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_dedicated ( LanceBlobDescriptorArrayBuilder * builder,
uint32_t blob_id,
uint64_t length )

Append one dedicated descriptor. Native validates the blob ID.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_append_external()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_external ( LanceBlobDescriptorArrayBuilder * builder,
uint32_t base_id,
const char * uri,
uint64_t offset,
uint64_t length )

Append one External descriptor with an explicit native base ID.

Native rejects an empty URI and an overflowing offset + length.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_append_inline()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_inline ( LanceBlobDescriptorArrayBuilder * builder,
const uint8_t * data,
size_t len )

Append an inline payload.

data == NULL && len == 0 is a valid empty inline blob. A NULL data pointer with non-zero len is an error. Foreign bytes are copied before the call returns.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_append_managed()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_managed ( LanceBlobDescriptorArrayBuilder * builder,
const char * uri,
uint64_t offset,
uint64_t length,
bool has_base_id,
uint32_t base_id )

Append one Managed descriptor.

has_base_id == false maps to native base_id: None; true maps to Some(base_id), including explicit base ID 0. Native validates that uri is a canonical relative object path and that offset + length does not overflow. Whether the base is registered and whether the dataset schema opts in through lance.blob.managed=true are validated by the native dataset write path, not by this builder.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_append_null()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_null ( LanceBlobDescriptorArrayBuilder * builder)

Append a null blob descriptor.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_append_packed()

LANCE_API int32_t lance_blob_descriptor_array_builder_append_packed ( LanceBlobDescriptorArrayBuilder * builder,
uint32_t blob_id,
uint64_t offset,
uint64_t length )

Append one packed descriptor for offset..offset + length.

length maps to native BlobRange.size. Native validates the blob ID and the 64-bit range before appending.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_close()

LANCE_API void lance_blob_descriptor_array_builder_close ( LanceBlobDescriptorArrayBuilder * builder)

Free a descriptor builder handle. NULL is a no-op. An unfinished native builder is dropped without sidecar rollback or publication.

◆ lance_blob_descriptor_array_builder_extend_packed()

LANCE_API int32_t lance_blob_descriptor_array_builder_extend_packed ( LanceBlobDescriptorArrayBuilder * builder,
uint32_t blob_id,
const LanceBlobRange * ranges,
size_t num_ranges )

Append one packed descriptor per range in input order.

Native pushes one range at a time. If a later range is invalid, all ranges before it remain appended and the error is returned. ranges may be NULL only when num_ranges == 0.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_field()

LANCE_API int32_t lance_blob_descriptor_array_builder_field ( const LanceBlobDescriptorArrayBuilder * builder,
struct ArrowSchema * out )

Export the complete native prepared field for this column.

The field remains exportable after a successful or failed finish. out is caller-owned and is written only on success.

Parameters
builderBuilder handle. Must not be NULL.
outCaller-owned ArrowSchema. Must not be NULL.
Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_finish()

LANCE_API int32_t lance_blob_descriptor_array_builder_finish ( LanceBlobDescriptorArrayBuilder * builder,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Finish the native prepared descriptor column and export both parts.

This consumes the native builder. On every return path, later append calls report that the builder is finished; field remains available. On success out_array receives an owned ArrowArray and out_schema receives the complete native prepared field (including extension and threshold metadata). The caller must release each non-NULL output exactly once.

Both outputs are written only after the complete native finish and both FFI conversions succeed. On error neither output is modified.

Returns
0 on success, -1 on error.

◆ lance_blob_descriptor_array_builder_new()

LANCE_NODISCARD LANCE_API LanceBlobDescriptorArrayBuilder * lance_blob_descriptor_array_builder_new ( const char * column)

Create a native writer-prepared blob descriptor array builder.

This wraps lance::BlobDescriptorArrayBuilder. It builds the prepared struct representation consumed by dataset writes; it does not allocate blob IDs, write payload objects, choose sidecar paths, or commit data.

Parameters
columnBlob column name. Must not be NULL.
Returns
Builder handle, or NULL on error.

◆ lance_blob_descriptor_array_builder_push_external()

LANCE_API int32_t lance_blob_descriptor_array_builder_push_external ( LanceBlobDescriptorArrayBuilder * builder,
const char * uri,
bool has_range,
uint64_t offset,
uint64_t length )

Append an External descriptor through native push_external.

This convenience sets native base_id = 0. When has_range is false, native receives None and stores offset 0, length 0. When true, the range is passed through, including an explicit 0/0 range. offset and length are ignored when has_range is false.

Returns
0 on success, -1 on error.

◆ lance_blob_field()

LANCE_API int32_t lance_blob_field ( const char * name,
bool nullable,
struct ArrowSchema * out )

Export the native blob v2 field with default storage thresholds.

The exported field is the complete native lance::blob_field result: Struct<data: LargeBinary?, uri: Utf8?>, extension name lance.blob.v2, and its native field metadata. The caller owns out and must invoke its non-NULL release callback exactly once. out is written only on success.

Parameters
nameField name. May be empty but must not be NULL.
nullableNative field nullability.
outCaller-owned ArrowSchema. Must not be NULL.
Returns
0 on success, -1 on error.

◆ lance_blob_field_with_options()

LANCE_API int32_t lance_blob_field_with_options ( const char * name,
bool nullable,
const LanceBlobFieldOptions * options,
struct ArrowSchema * out )

Export the native blob v2 field with explicit storage thresholds.

options == NULL selects native defaults. Threshold conversion follows LanceBlobFieldOptions. The result is otherwise identical to lance_blob_field().

Parameters
nameField name. May be empty but must not be NULL.
nullableNative field nullability.
optionsOptional threshold options, or NULL for defaults.
outCaller-owned ArrowSchema. Must not be NULL.
Returns
0 on success, -1 on error.

◆ lance_blob_file_close()

LANCE_API void lance_blob_file_close ( LanceBlobFile * blob)

Free a blob handle's opaque allocation.

This does not perform the native close operation; use lance_blob_file_mark_closed() for that. Call exactly once per non-NULL handle; the handle is invalid afterwards. Dropping the allocation also drops the underlying native BlobFile. NULL is a no-op. Never fails and leaves the pending error untouched.

Parameters
blobBlob handle, or NULL.

◆ lance_blob_file_is_closed()

LANCE_API int32_t lance_blob_file_is_closed ( const LanceBlobFile * blob,
bool * out_closed )

Report whether the native blob file is closed.

Parameters
blobBlob handle. NULL is an error.
out_closedReceives the native closed state. Must not be NULL. Written only on success.
Returns
0 on success, -1 on error

◆ lance_blob_file_mark_closed()

LANCE_API int32_t lance_blob_file_mark_closed ( LanceBlobFile * blob)

Mark the native blob file closed.

This maps to the native BlobFile close operation. It is idempotent and does not free the opaque allocation. After this succeeds, size() remains available but cursor and range reads, tell() and set_buffer_size() follow native closed-handle errors. Releasing the allocation still requires lance_blob_file_close().

The existing single-range zero-length compatibility is unchanged: a zero-length lance_blob_file_read_range() request succeeds without reaching the closed-state check.

Parameters
blobBlob handle. NULL is an error.
Returns
0 on success, -1 on error

◆ lance_blob_file_read()

LANCE_API int32_t lance_blob_file_read ( LanceBlobFile * blob,
uint8_t * dst,
size_t dst_len )

Read from the current cursor to the end of the blob.

With the cursor at 0 that is the whole blob. The cursor ends up at the end. dst must hold every remaining byte; a smaller buffer is an error and reads nothing. At or past the end this writes nothing and succeeds.

Parameters
blobBlob handle. NULL is an error.
dstDestination buffer. May be NULL only when no bytes remain from the current cursor.
dst_lenCapacity of dst in bytes. Must be at least the number of bytes remaining from the cursor, or 0 if the cursor is at or past the end.
Returns
0 on success, -1 on error

◆ lance_blob_file_read_range()

LANCE_API int32_t lance_blob_file_read_range ( const LanceBlobFile * blob,
uint64_t offset,
uint8_t * dst,
size_t len )

Read exactly len bytes starting at offset, without moving the cursor.

offset is blob-relative. A non-empty range that ends past the blob size, or an offset plus len that overflows 64 bits, is an error; len 0 succeeds without checking offset. Nothing is written to dst on error.

Parameters
blobBlob handle. NULL is an error.
offsetByte offset from the start of the blob.
dstDestination buffer of at least len bytes. May be NULL only when len is zero.
lenNumber of bytes to read. Zero is a no-op that succeeds.
Returns
0 on success, -1 on error

◆ lance_blob_file_read_ranges()

LANCE_API int32_t lance_blob_file_read_ranges ( const LanceBlobFile * blob,
const LanceBlobRange * ranges,
size_t num_ranges,
uint8_t *const * destinations,
const size_t * destination_lens )

Read multiple blob-relative ranges without moving the cursor.

The result for ranges[i] is copied to destinations[i]. Input order, duplicate ranges, overlaps and empty ranges are preserved. Each destination_lens[i] is a capacity, not an exact length: it must be at least ranges[i].length, and any excess capacity is left untouched.

Every offset-plus-length is checked for 64-bit overflow. Blob bounds and the closed state are validated by the native implementation for the complete request before any destination is written. A request with num_ranges == 0 still reaches native closed-state validation, so it succeeds on an open handle and fails on one marked closed.

When num_ranges is zero, ranges, destinations and destination_lens may be NULL. For a zero-length range, its destination may be NULL. For a non-empty range, its destination must not be NULL. On any error no destination is modified.

Parameters
blobBlob handle. NULL is an error.
rangesArray of ranges. May be NULL only when num_ranges is zero.
num_rangesNumber of entries in each range/buffer array.
destinationsParallel array of destination pointers.
destination_lensParallel array of destination capacities in bytes.
Returns
0 on success, -1 on error

◆ lance_blob_file_read_up_to()

LANCE_API int32_t lance_blob_file_read_up_to ( LanceBlobFile * blob,
uint8_t * dst,
size_t len,
size_t * bytes_read )

Read at most len bytes from the current cursor.

Reads min(len, size - cursor) bytes and advances the cursor past them, so repeated calls walk the blob. At or past the end this writes no bytes, stores 0 in *bytes_read, and succeeds.

Parameters
blobBlob handle. NULL is an error.
dstDestination buffer. May be NULL only when len is zero.
lenMaximum number of bytes to read.
bytes_readReceives the number of bytes actually written to dst, never more than len. Must not be NULL. Written only on success.
Returns
0 on success, -1 on error

◆ lance_blob_file_seek()

LANCE_API int32_t lance_blob_file_seek ( LanceBlobFile * blob,
uint64_t pos )

Move the cursor to pos.

Seeking past the end of the blob is allowed, mirroring the underlying Lance API; a subsequent read then returns zero bytes.

Parameters
blobBlob handle. NULL is an error.
posNew cursor position, in bytes from the start of the blob.
Returns
0 on success, -1 on error

◆ lance_blob_file_set_buffer_size()

LANCE_API int32_t lance_blob_file_set_buffer_size ( LanceBlobFile * blob,
size_t buffer_size )

Set the sequential read-ahead size used by future reads.

Zero disables read-ahead. A changed value drops any unused prefetched bytes, matching the native BlobFile behavior. The size is a hint and does not change the visible blob bytes or cursor.

Parameters
blobBlob handle. NULL is an error.
buffer_sizeRead-ahead size in bytes; zero disables it.
Returns
0 on success, -1 on error

◆ lance_blob_file_size()

LANCE_API uint64_t lance_blob_file_size ( const LanceBlobFile * blob)

Return the size of the blob in bytes.

Metadata carried by the handle: no storage access, independent of the cursor, still available after lance_dataset_close().

Parameters
blobBlob handle. NULL is an error.
Returns
The blob size, or 0 on error. A return of 0 may be an empty blob or an error; check lance_last_error_code() to tell them apart.

◆ lance_blob_file_tell()

LANCE_API int32_t lance_blob_file_tell ( const LanceBlobFile * blob,
uint64_t * pos )

Report the current cursor position.

Parameters
blobBlob handle. NULL is an error.
posReceives the cursor position in bytes from the start of the blob. Must not be NULL. Written only on success.
Returns
0 on success, -1 on error

◆ lance_byte_buffer_close()

LANCE_API void lance_byte_buffer_close ( LanceByteBuffer * buffer)

◆ lance_byte_buffer_data()

LANCE_NODISCARD LANCE_API const uint8_t * lance_byte_buffer_data ( const LanceByteBuffer * buffer)

◆ lance_byte_buffer_len()

LANCE_API size_t lance_byte_buffer_len ( const LanceByteBuffer * buffer)

◆ lance_cleanup_explanation_candidate_count()

LANCE_API uint64_t lance_cleanup_explanation_candidate_count ( const LanceCleanupExplanation * explanation)

Number of candidate files included in the explanation.

◆ lance_cleanup_explanation_candidate_file_limit()

LANCE_API uint64_t lance_cleanup_explanation_candidate_file_limit ( const LanceCleanupExplanation * explanation)

Native maximum candidate-file count used by the explanation.

◆ lance_cleanup_explanation_candidate_files_truncated()

LANCE_API int32_t lance_cleanup_explanation_candidate_files_truncated ( const LanceCleanupExplanation * explanation)

Whether more candidate files were found than included.

Returns
1 or 0 on success, -1 on error.

◆ lance_cleanup_explanation_candidate_kind_at()

LANCE_API int32_t lance_cleanup_explanation_candidate_kind_at ( const LanceCleanupExplanation * explanation,
size_t index )

Candidate LanceCleanupFileKind at index.

Returns
the fixed-width discriminant, or -1 on error.

◆ lance_cleanup_explanation_candidate_path_at()

LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_candidate_path_at ( const LanceCleanupExplanation * explanation,
size_t index )

Candidate path at index; owned by explanation. NULL on error.

◆ lance_cleanup_explanation_candidate_size_bytes_at()

LANCE_API uint64_t lance_cleanup_explanation_candidate_size_bytes_at ( const LanceCleanupExplanation * explanation,
size_t index )

Candidate file size in bytes at index; 0 on error (check error code).

◆ lance_cleanup_explanation_candidate_unverified_at()

LANCE_API int32_t lance_cleanup_explanation_candidate_unverified_at ( const LanceCleanupExplanation * explanation,
size_t index )

Candidate unverified flag at index.

Returns
1 or 0 on success, -1 on error.

◆ lance_cleanup_explanation_close()

LANCE_API void lance_cleanup_explanation_close ( LanceCleanupExplanation * explanation)

Close an explanation snapshot. Safe to call with NULL.

◆ lance_cleanup_explanation_read_version()

LANCE_API uint64_t lance_cleanup_explanation_read_version ( const LanceCleanupExplanation * explanation)

Dataset version observed when the explanation was produced.

◆ lance_cleanup_explanation_referenced_branch_cleanup_candidate_at()

LANCE_API int32_t lance_cleanup_explanation_referenced_branch_cleanup_candidate_at ( const LanceCleanupExplanation * explanation,
size_t index )

Whether the referenced branch at index is a cascade cleanup candidate.

Returns
1 or 0 on success, -1 on error.

◆ lance_cleanup_explanation_referenced_branch_count()

LANCE_API uint64_t lance_cleanup_explanation_referenced_branch_count ( const LanceCleanupExplanation * explanation)

Number of referenced child branches in the explanation.

◆ lance_cleanup_explanation_referenced_branch_name_at()

LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_referenced_branch_name_at ( const LanceCleanupExplanation * explanation,
size_t index )

Referenced branch name at index; owned by explanation. NULL on error.

◆ lance_cleanup_explanation_referenced_branch_version_at()

LANCE_API uint64_t lance_cleanup_explanation_referenced_branch_version_at ( const LanceCleanupExplanation * explanation,
size_t index )

Referenced version at index; 0 on error (check error code).

◆ lance_cleanup_explanation_stats()

LANCE_API int32_t lance_cleanup_explanation_stats ( const LanceCleanupExplanation * explanation,
LanceRemovalStats * out_stats )

Copy aggregate removal stats from an explanation. The output is written only on success.

Returns
0 on success, -1 on error.

◆ lance_cleanup_explanation_warning_at()

LANCE_NODISCARD LANCE_API const char * lance_cleanup_explanation_warning_at ( const LanceCleanupExplanation * explanation,
size_t index )

Warning at index; owned by explanation. NULL on error.

◆ lance_cleanup_explanation_warning_count()

LANCE_API uint64_t lance_cleanup_explanation_warning_count ( const LanceCleanupExplanation * explanation)

Number of non-fatal warnings in the explanation.

◆ lance_commit_lock_close()

LANCE_API void lance_commit_lock_close ( LanceCommitLock * lock)

Close a commit-lock handle. Safe to call with NULL.

Retained datasets and leases keep their native context owner.

◆ lance_commit_lock_new()

LANCE_NODISCARD LANCE_API LanceCommitLock * lance_commit_lock_new ( const LanceCommitLockCallbacks * callbacks)

Construct a foreign commit lock from a callback table.

callbacks and its lock/release entries must be non-NULL. destroy_lease and release_context may be NULL.

Returns
Owned lock handle, or NULL on error

◆ lance_compaction_options_v2_clone()

LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_clone ( const LanceCompactionOptionsV2 * options)

Clone an owned native options value.

◆ lance_compaction_options_v2_free()

LANCE_API void lance_compaction_options_v2_free ( LanceCompactionOptionsV2 * options)

Free options. NULL-safe.

◆ lance_compaction_options_v2_from_dataset()

LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_from_dataset ( const LanceDataset * dataset)

Create options from native CompactionOptions::from_dataset_config().

◆ lance_compaction_options_v2_new()

LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_options_v2_new ( void )

Create options from native CompactionOptions::default().

◆ lance_compaction_options_v2_set_batch_size()

LANCE_API int32_t lance_compaction_options_v2_set_batch_size ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_binary_copy_read_batch_bytes()

LANCE_API int32_t lance_compaction_options_v2_set_binary_copy_read_batch_bytes ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_compaction_mode()

LANCE_API int32_t lance_compaction_options_v2_set_compaction_mode ( LanceCompactionOptionsV2 * options,
bool has_value,
int32_t mode )

has_value == false selects native None; true selects the given mode.

◆ lance_compaction_options_v2_set_data_storage_version()

LANCE_API int32_t lance_compaction_options_v2_set_data_storage_version ( LanceCompactionOptionsV2 * options,
const char * selector )

Parse the selector with native LanceFileVersion::from_str(). NULL = None.

◆ lance_compaction_options_v2_set_defer_index_remap()

LANCE_API int32_t lance_compaction_options_v2_set_defer_index_remap ( LanceCompactionOptionsV2 * options,
bool value )

◆ lance_compaction_options_v2_set_excluded_fragment_ids()

LANCE_API int32_t lance_compaction_options_v2_set_excluded_fragment_ids ( LanceCompactionOptionsV2 * options,
const uint32_t * fragment_ids,
size_t count )

Replace excluded IDs. NULL with count=0 is the empty list.

◆ lance_compaction_options_v2_set_index_remap_mode()

LANCE_API int32_t lance_compaction_options_v2_set_index_remap_mode ( LanceCompactionOptionsV2 * options,
int32_t mode )

◆ lance_compaction_options_v2_set_io_buffer_size()

LANCE_API int32_t lance_compaction_options_v2_set_io_buffer_size ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_materialize_deletions()

LANCE_API int32_t lance_compaction_options_v2_set_materialize_deletions ( LanceCompactionOptionsV2 * options,
bool value )

◆ lance_compaction_options_v2_set_materialize_deletions_threshold()

LANCE_API int32_t lance_compaction_options_v2_set_materialize_deletions_threshold ( LanceCompactionOptionsV2 * options,
float value )

◆ lance_compaction_options_v2_set_max_bytes_per_file()

LANCE_API int32_t lance_compaction_options_v2_set_max_bytes_per_file ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

has_value == false selects native None; true preserves zero.

◆ lance_compaction_options_v2_set_max_overlays_per_fragment()

LANCE_API int32_t lance_compaction_options_v2_set_max_overlays_per_fragment ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_max_rows_per_group()

LANCE_API int32_t lance_compaction_options_v2_set_max_rows_per_group ( LanceCompactionOptionsV2 * options,
uint64_t value )

◆ lance_compaction_options_v2_set_max_source_bytes()

LANCE_API int32_t lance_compaction_options_v2_set_max_source_bytes ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_max_source_fragments()

LANCE_API int32_t lance_compaction_options_v2_set_max_source_fragments ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_max_source_rows()

LANCE_API int32_t lance_compaction_options_v2_set_max_source_rows ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

◆ lance_compaction_options_v2_set_num_threads()

LANCE_API int32_t lance_compaction_options_v2_set_num_threads ( LanceCompactionOptionsV2 * options,
bool has_value,
uint64_t value )

Store an optional thread-count override. has_value = false selects the native default. An explicit zero is stored by this setter but rejected with LANCE_ERR_INVALID_ARGUMENT when native compaction executes.

◆ lance_compaction_options_v2_set_target_rows_per_fragment()

LANCE_API int32_t lance_compaction_options_v2_set_target_rows_per_fragment ( LanceCompactionOptionsV2 * options,
uint64_t value )

◆ lance_compaction_options_v2_set_transaction_properties()

LANCE_API int32_t lance_compaction_options_v2_set_transaction_properties ( LanceCompactionOptionsV2 * options,
const LanceTransactionProperties * properties )

NULL = native None; non-NULL with count=0 = Some(empty map).

◆ lance_compaction_plan_close()

LANCE_API void lance_compaction_plan_close ( LanceCompactionPlan * plan)

◆ lance_compaction_plan_from_json()

LANCE_NODISCARD LANCE_API LanceCompactionPlan * lance_compaction_plan_from_json ( const char * json)

◆ lance_compaction_plan_json()

LANCE_NODISCARD LANCE_API const char * lance_compaction_plan_json ( const LanceCompactionPlan * plan)

Native serde transport. Free strings with lance_free_string().

◆ lance_compaction_plan_options_clone()

LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_plan_options_clone ( const LanceCompactionPlan * plan)

Clone effective plan options, including the resolved exact storage version.

◆ lance_compaction_plan_read_version()

LANCE_API uint64_t lance_compaction_plan_read_version ( const LanceCompactionPlan * plan)

◆ lance_compaction_plan_task_at()

LANCE_NODISCARD LANCE_API LanceCompactionTask * lance_compaction_plan_task_at ( const LanceCompactionPlan * plan,
size_t index )

Owned task snapshot; free with lance_compaction_task_close().

◆ lance_compaction_plan_task_count()

LANCE_API size_t lance_compaction_plan_task_count ( const LanceCompactionPlan * plan)

◆ lance_compaction_task_close()

LANCE_API void lance_compaction_task_close ( LanceCompactionTask * task)

◆ lance_compaction_task_execute()

LANCE_NODISCARD LANCE_API LanceRewriteResult * lance_compaction_task_execute ( const LanceDataset * dataset,
const LanceCompactionTask * task )

Execute against the dataset at the task's planned read version.

◆ lance_compaction_task_fragment_count()

LANCE_API size_t lance_compaction_task_fragment_count ( const LanceCompactionTask * task)

◆ lance_compaction_task_fragment_metadata_json_at()

LANCE_NODISCARD LANCE_API const char * lance_compaction_task_fragment_metadata_json_at ( const LanceCompactionTask * task,
size_t index )

◆ lance_compaction_task_from_json()

LANCE_NODISCARD LANCE_API LanceCompactionTask * lance_compaction_task_from_json ( const char * json)

◆ lance_compaction_task_json()

LANCE_NODISCARD LANCE_API const char * lance_compaction_task_json ( const LanceCompactionTask * task)

◆ lance_compaction_task_options_clone()

LANCE_NODISCARD LANCE_API LanceCompactionOptionsV2 * lance_compaction_task_options_clone ( const LanceCompactionTask * task)

◆ lance_compaction_task_read_version()

LANCE_API uint64_t lance_compaction_task_read_version ( const LanceCompactionTask * task)

◆ lance_data_file_base_id()

LANCE_API int32_t lance_data_file_base_id ( const LanceDataFile * file,
bool * out_is_set,
uint32_t * out_base_id )

Read the optional native base ID. On success *out_is_set reports native Some/None; out_base_id is written only when present. Returns 0 on success, -1 on error.

◆ lance_data_file_clone()

LANCE_NODISCARD LANCE_API LanceDataFile * lance_data_file_clone ( const LanceDataFile * file)

Clone a data-file handle into an independent snapshot. Returns NULL on error; close the result exactly once.

◆ lance_data_file_close()

LANCE_API void lance_data_file_close ( LanceDataFile * file)

Close a data-file handle. NULL-safe. Close exactly once.

◆ lance_data_file_column_index_at()

LANCE_API int32_t lance_data_file_column_index_at ( const LanceDataFile * file,
size_t index,
int32_t * out_column_index )

Read one native column index, including the native -1 marker. Returns 0 on success, -1 on error. The output is written only on success.

◆ lance_data_file_column_index_count()

LANCE_API size_t lance_data_file_column_index_count ( const LanceDataFile * file)

Read the number of native column indices. Returns 0 on error; check lance_last_error_code() to distinguish failure from an empty list.

◆ lance_data_file_field_count()

LANCE_API size_t lance_data_file_field_count ( const LanceDataFile * file)

Read the number of native field IDs. Returns 0 on error; check lance_last_error_code() to distinguish failure from an empty list.

◆ lance_data_file_field_id_at()

LANCE_API int32_t lance_data_file_field_id_at ( const LanceDataFile * file,
size_t index,
int32_t * out_field_id )

Read one native field ID. Returns 0 on success, -1 on error. out_field_id is written only on success.

◆ lance_data_file_file_size()

LANCE_API int32_t lance_data_file_file_size ( const LanceDataFile * file,
bool * out_is_set,
uint64_t * out_size )

Read the optional native data-file size. On success *out_is_set reports native Some/None; out_size is written only when present. Returns 0 on success, -1 on error.

◆ lance_data_file_file_version()

LANCE_API int32_t lance_data_file_file_version ( const LanceDataFile * file,
uint32_t * out_major,
uint32_t * out_minor )

Read the native data-file format version. Both outputs are required and written only on success. Returns 0 on success, -1 on error.

◆ lance_data_file_path()

LANCE_NODISCARD LANCE_API const char * lance_data_file_path ( const LanceDataFile * file)

Return the native data-file path. The pointer is borrowed from file and remains valid until the handle is closed. Returns NULL on error.

◆ lance_data_overlay_file_bitmap_at()

LANCE_API int32_t lance_data_overlay_file_bitmap_at ( const LanceDataOverlayFile * file,
size_t index,
uint8_t ** out_bytes,
size_t * out_len )

Serialize one coverage bitmap to a caller-owned buffer.

index is 0 for shared coverage and the field position for per-field coverage. On success out_bytes receives a libc::malloc allocation of out_len bytes; release it exactly once with lance_free_bytes. Outputs are written only on success. Parity is bitmap semantics: the native writer may re-serialize with a different optimized container layout. Returns 0 on success, -1 on error.

◆ lance_data_overlay_file_bitmap_count()

LANCE_API int32_t lance_data_overlay_file_bitmap_count ( const LanceDataOverlayFile * file,
uint64_t * out_count )

Read the number of coverage bitmaps (1 for shared, field count for per-field). Returns 0 on success, -1 on error.

◆ lance_data_overlay_file_clone()

LANCE_NODISCARD LANCE_API LanceDataOverlayFile * lance_data_overlay_file_clone ( const LanceDataOverlayFile * file)

Clone a data overlay value into an independent snapshot. Returns NULL on error; close the result exactly once.

◆ lance_data_overlay_file_close()

LANCE_API void lance_data_overlay_file_close ( LanceDataOverlayFile * file)

Close a data overlay value. NULL-safe.

◆ lance_data_overlay_file_committed_version()

LANCE_API int32_t lance_data_overlay_file_committed_version ( const LanceDataOverlayFile * file,
uint64_t * out_version )

Read the overlay's committed-version stamp. Returns 0 on success, -1 on error; zero is a valid pre-commit placeholder.

◆ lance_data_overlay_file_coverage_kind()

LANCE_API int32_t lance_data_overlay_file_coverage_kind ( const LanceDataOverlayFile * file,
int32_t * out_kind )

Read the coverage kind (0 shared, 1 per-field). Returns 0 on success, -1 on error; out_kind is unchanged on failure.

◆ lance_data_overlay_file_data_file()

LANCE_NODISCARD LANCE_API LanceDataFile * lance_data_overlay_file_data_file ( const LanceDataOverlayFile * file)

Clone the complete data file metadata owned by the overlay. The output is written only on success and must be closed independently. Returns an owned data file, or NULL on error.

◆ lance_data_overlay_file_new()

LANCE_NODISCARD LANCE_API LanceDataOverlayFile * lance_data_overlay_file_new ( const LanceDataFile * data_file,
int32_t coverage_kind,
const uint8_t *const * bitmaps,
const size_t * bitmap_lens,
size_t bitmap_count,
uint64_t committed_version )

Create an owned native data overlay value.

data_file is borrowed and its complete native metadata is copied. coverage_kind is 0 (shared, exactly one bitmap) or 1 (per-field, bitmaps in data_file.fields order). Each bitmap is portable 32-bit Roaring serialization and is borrowed for the duration of the call; empty per-field coverage is retained. committed_version is copied unchanged. Native code owns field compatibility, coverage validity, row layout and publication checks; this constructor adds no policy.

Returns an owned overlay, or NULL on error. Close it exactly once with lance_data_overlay_file_close.

◆ lance_data_overlay_group_clone()

LANCE_NODISCARD LANCE_API LanceDataOverlayGroup * lance_data_overlay_group_clone ( const LanceDataOverlayGroup * group)

Clone a data overlay group into an independent snapshot. Returns NULL on error; close the result exactly once.

◆ lance_data_overlay_group_close()

LANCE_API void lance_data_overlay_group_close ( LanceDataOverlayGroup * group)

Close a data overlay group. NULL-safe.

◆ lance_data_overlay_group_fragment_id()

LANCE_API int32_t lance_data_overlay_group_fragment_id ( const LanceDataOverlayGroup * group,
uint64_t * out_fragment_id )

Read the target fragment ID. Returns 0 on success, -1 on error; fragment ID 0 is valid.

◆ lance_data_overlay_group_new()

LANCE_NODISCARD LANCE_API LanceDataOverlayGroup * lance_data_overlay_group_new ( uint64_t fragment_id,
const LanceDataOverlayFile *const * overlays,
size_t overlay_count )

Construct an owned native data overlay group.

Overlay handles are borrowed and cloned in input order. A NULL array is accepted only with a zero count. Empty groups are retained because the native operation permits them. Returns NULL on error.

◆ lance_data_overlay_group_overlay_at()

LANCE_API int32_t lance_data_overlay_group_overlay_at ( const LanceDataOverlayGroup * group,
size_t index,
LanceDataOverlayFile ** out_overlay )

Clone one overlay from the group. The output is written only on success and must be closed independently. Returns 0 on success, -1 on error.

◆ lance_data_overlay_group_overlay_count()

LANCE_API int32_t lance_data_overlay_group_overlay_count ( const LanceDataOverlayGroup * group,
uint64_t * out_count )

Read the number of overlays in the group. Returns 0 on success, -1 on error.

◆ lance_data_replacement_group_clone()

LANCE_NODISCARD LANCE_API LanceDataReplacementGroup * lance_data_replacement_group_clone ( const LanceDataReplacementGroup * group)

Clone a data replacement group into an independent snapshot. Returns NULL on error; close the result exactly once.

◆ lance_data_replacement_group_close()

LANCE_API void lance_data_replacement_group_close ( LanceDataReplacementGroup * group)

Close a data replacement group. NULL-safe. Close exactly once.

◆ lance_data_replacement_group_file()

LANCE_API int32_t lance_data_replacement_group_file ( const LanceDataReplacementGroup * group,
LanceDataFile ** out_file )

Clone the data file owned by a data replacement group. The output is written only on success and must be closed independently. Returns 0 on success, -1 on error.

◆ lance_data_replacement_group_fragment_id()

LANCE_API uint64_t lance_data_replacement_group_fragment_id ( const LanceDataReplacementGroup * group)

Read the native fragment ID. Returns 0 on error; check lance_last_error_code(). Fragment ID 0 is a valid native value.

◆ lance_data_replacement_group_new()

LANCE_NODISCARD LANCE_API LanceDataReplacementGroup * lance_data_replacement_group_new ( uint64_t fragment_id,
const LanceDataFile * new_file )

Construct a native data replacement group.

new_file is borrowed and its complete native metadata is cloned. The fragment ID is copied unchanged. No binding-side ordering, uniqueness or coverage policy is added. Returns NULL on error.

◆ lance_data_statistics_bytes_on_disk_at()

LANCE_API uint64_t lance_data_statistics_bytes_on_disk_at ( const LanceDataStatistics * stats,
size_t index )

Compressed on-disk byte size of the field at index. Returns 0 on error (NULL handle or out-of-range index), setting LANCE_ERR_INVALID_ARGUMENT. A field written with the legacy (v1) storage format also reports 0 but sets no error, so check lance_last_error_code() to distinguish a genuine 0 from the error sentinel.

◆ lance_data_statistics_close()

LANCE_API void lance_data_statistics_close ( LanceDataStatistics * stats)

Close and free a data statistics handle. Safe to call with NULL.

◆ lance_data_statistics_count()

LANCE_API uint64_t lance_data_statistics_count ( const LanceDataStatistics * stats)

Number of fields in the statistics snapshot. Clears the thread-local error on success. Returns 0 and sets LANCE_ERR_INVALID_ARGUMENT on a NULL handle; a dataset with an empty schema also yields 0 with no error set, so check lance_last_error_code() to distinguish the error case from an empty result.

◆ lance_data_statistics_field_id_at()

LANCE_API uint32_t lance_data_statistics_field_id_at ( const LanceDataStatistics * stats,
size_t index )

Schema field id at index (0 <= index < count). Returns 0 on error (NULL handle or out-of-range index), setting LANCE_ERR_INVALID_ARGUMENT. Because 0 is itself a valid field id, check lance_last_error_code() when passing an untrusted index; iterating 0..count never errors.

◆ lance_dataset_add_bases()

LANCE_API int32_t lance_dataset_add_bases ( LanceDataset * dataset,
const LanceBasePath * bases,
size_t base_count,
const LanceTransactionProperties * transaction_properties )

Register new base paths and commit one native Dataset::add_bases transaction.

bases may be NULL when base_count == 0. An empty list is passed to the native transaction builder and follows its commit behavior.

transaction_properties == NULL maps to native None. A non-NULL pointer with count == 0 maps to native Some(empty map), so the caller's explicit empty selection is preserved at this boundary. Native handling determines how that empty map is persisted.

Inputs are copied before the asynchronous operation starts. ID allocation, duplicate/conflict checks, persistence and path resolution follow Lance core. On success the same dataset handle sees the new version; existing snapshots and streams keep their prior view.

Returns
0 on success, -1 on error.

◆ lance_dataset_add_columns_batch_udf()

LANCE_API int32_t lance_dataset_add_columns_batch_udf ( LanceDataset * dataset,
const LanceBatchUDF * udf,
const char *const * read_columns,
const uint32_t * batch_size )

Add columns through native NewColumnTransform::BatchUDF.

read_columns NULL maps to native None. A non-NULL NULL-terminated array maps to native Some; an immediately terminated array maps to Some(empty). batch_size NULL maps to None. A non-NULL pointer maps to Some(*batch_size), including explicit zero; native owns validation of zero.

Native owns output schema compatibility, row alignment, checkpoint ordering, file cleanup, publication, and commit conflicts. Mapper and store callbacks execute synchronously under the dataset handle's exclusive mutation lock. They must not re-enter the same handle; use an independent handle or an existing fragment/scanner snapshot for reads.

Returns
0 on success, -1 on error.

◆ lance_dataset_add_columns_batch_udf_v2()

LANCE_API int32_t lance_dataset_add_columns_batch_udf_v2 ( LanceDataset * dataset,
const LanceBatchUDFV2 * udf,
const char *const * read_columns,
const uint32_t * batch_size )

Add columns through a schema-aware native NewColumnTransform::BatchUDF.

Identical to lance_dataset_add_columns_batch_udf except that batch checkpoints are restored from an owned ArrowArray plus the schema that carries native schema metadata. Use this entry when replaying cached batches; the original entry remains ABI-stable and honestly rejects markerless batch hits through native validation.

Returns
0 on success, -1 on error.

◆ lance_dataset_add_columns_nulls()

LANCE_API int32_t lance_dataset_add_columns_nulls ( LanceDataset * dataset,
const struct ArrowSchema * schema )

Add one or more all-null columns described by an Arrow C Data Interface schema, committing a new manifest. On non-legacy datasets this is a metadata-only operation — no data files are rewritten. Every field in the schema must be nullable.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight keep their pre-add view.

Parameters
datasetOpen dataset (not consumed). Mutated in place. Must not be NULL.
schemaArrow C ArrowSchema describing the new columns. Read by shared reference; its release callback is never invoked. Must not be NULL. Only the top-level schema is validated before it is handed to arrow-rs; the caller is responsible for providing fully-initialised child fields.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for a NULL dataset/schema, an uninitialised or already-released schema, an invalid Arrow schema, a non-nullable field, or a name that collides with an existing column. LANCE_ERR_NOT_SUPPORTED for a legacy-format dataset (which cannot take all-null columns as a metadata-only change). LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_add_columns_sql()

LANCE_API int32_t lance_dataset_add_columns_sql ( LanceDataset * dataset,
const LanceSqlColumn * columns,
size_t num_columns,
uint64_t batch_size )

Add one or more columns computed from SQL expressions over the dataset's existing columns, committing a new manifest. Each fragment is scanned, the expressions are evaluated, and the results are written as new column files.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight keep their pre-add view.

Parameters
datasetOpen dataset (not consumed). Mutated in place. Must not be NULL.
columnsArray of LanceSqlColumn. Must not be NULL; each entry's name and expression must be non-NULL and non-empty.
num_columnsLength of columns. Must be > 0.
batch_sizeRows per scan batch while evaluating expressions. 0 = upstream default.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty inputs, NULL or empty name / expression, non-UTF-8 strings, malformed SQL syntax, a new column name that collides with an existing column, an expression that references a non-existent column (an upstream schema error reclassified in Lance 9.1; previously LANCE_ERR_INTERNAL), or a batch_size beyond UINT32_MAX. LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_add_columns_stream()

LANCE_API int32_t lance_dataset_add_columns_stream ( LanceDataset * dataset,
struct ArrowArrayStream * stream,
uint64_t batch_size )

Add columns by splicing precomputed data from an Arrow C Data Interface stream into the dataset, committing a new manifest. The stream's batches are consumed in order and aligned positionally to the dataset's existing rows; the total row count must match the dataset exactly.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight keep their pre-add view.

Parameters
datasetOpen dataset (not consumed). Mutated in place. Must not be NULL.
streamArrow C stream of new column data. When non-NULL it is consumed (released) on every return path, including error returns — the caller must not use it again. (A NULL stream is rejected before anything is consumed.) Its schema defines the new columns and must not collide with existing column names.
batch_sizeRows per write batch while aligning the stream to fragments. 0 = upstream default.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for a NULL dataset/stream, a stream missing a mandatory get_schema/get_next/release callback, a stream whose total row count does not match the dataset, a new column name that collides with an existing column, or a batch_size beyond UINT32_MAX. LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_all_files_stream()

LANCE_API int32_t lance_dataset_all_files_stream ( const LanceDataset * dataset,
struct ArrowArrayStream * out )

Export Dataset::all_files as an Arrow C stream.

This lists only the primary dataset root. Registered additional base paths are not scanned, and untracked files physically present under the primary root are included. The native schema, values and unspecified row order are preserved. The stream remains valid after the source dataset is closed.

out is caller-owned, must be zero-initialized by convention, and is written only on success. Invoke its non-NULL release callback exactly once.

Returns
0 on success, -1 on error.

◆ lance_dataset_alter_columns()

LANCE_API int32_t lance_dataset_alter_columns ( LanceDataset * dataset,
const LanceColumnAlteration * alterations,
size_t num_alterations )

Apply one or more column alterations and commit a new manifest. Rename and nullability-only changes are zero-copy and preserve any indices on the affected columns. A type change rewrites the column's data files and drops any indices that referenced it, mirroring upstream behaviour.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-alteration view.

Parameters
datasetOpen dataset (not consumed). Mutated in place to see the new version. Must not be NULL.
alterationsArray of LanceColumnAlteration. Must not be NULL.
num_alterationsLength of alterations. Must be > 0.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty inputs, NULL or empty path, non-UTF-8 strings, no-op alterations (all three optional fields left at their sentinels), invalid nullable_mode discriminant, unknown columns, type changes that aren't a valid cast, or tightening nullability when existing rows hold NULLs; LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_base_paths_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_base_paths_json ( const LanceDataset * dataset)

Return the current snapshot's native base-path registry as a JSON object keyed by decimal base ID.

Each value contains exactly the native fields:

  • id: unsigned base ID;
  • name: string or JSON null;
  • path: full URI string;
  • is_dataset_root: boolean.

The snapshot owns copied strings and remains independent of later dataset versions. Caller must free the returned string with lance_free_string(). Returns NULL on error.

◆ lance_dataset_branch_create()

LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_branch_create ( const LanceDataset * dataset,
const char * branch_name,
const LanceRef * reference,
const char *const * storage_opts )

Create a branch from a native ref.

branch_name must be UTF-8. reference must be an existing LanceRef. Branch-name validation, reference resolution and duplicate detection are performed by Lance's Dataset::create_branch. Reusing an existing branch name may fail in the native shallow-clone phase instead of reaching the BranchContents conflict check; that native error is passed through rather than replaced with a synthesized conflict.

storage_opts is NULL-terminated key-value pairs, or NULL. NULL passes None to native, so the source dataset's store params are used. A non-NULL array, including an immediately NULL-terminated empty array, passes explicit object-store params.

Native creation is a non-atomic shallow clone followed by a BranchContents write. If creation stops after the clone, a branch dataset without BranchContents may remain. Retrying the same name may then fail; use lance_dataset_branch_force_delete() to remove that zombie dataset.

The returned dataset owns an independent snapshot and remains usable after the source dataset or reference is closed.

Returns
new dataset handle, or NULL on error

◆ lance_dataset_branch_delete()

LANCE_API int32_t lance_dataset_branch_delete ( const LanceDataset * dataset,
const char * branch_name )

Delete a branch.

Native checks reject a branch referenced by a child branch or by any tag with LANCE_ERR_COMMIT_CONFLICT. A missing BranchContents produces LANCE_ERR_NOT_FOUND. The branch dataset directories are cleaned up by the native implementation.

Returns
0 on success, -1 on error

◆ lance_dataset_branch_force_delete()

LANCE_API int32_t lance_dataset_branch_force_delete ( const LanceDataset * dataset,
const char * branch_name )

Delete a branch, bypassing only a missing BranchContents.

This is the native recovery path for a branch dataset left without BranchContents by the non-atomic creation sequence. Child-branch and tag reference checks still apply and surface as LANCE_ERR_COMMIT_CONFLICT.

Returns
0 on success, -1 on error

◆ lance_dataset_branch_get_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_branch_get_json ( const LanceDataset * dataset,
const char * branch_name )

Serialize one native BranchContents as JSON.

The object follows the selected core's BranchContents serde shape. The caller owns the string and frees it with lance_free_string().

Returns
JSON string, or NULL on error (including LANCE_ERR_NOT_FOUND)

◆ lance_dataset_branch_identifier_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_branch_identifier_json ( const LanceDataset * dataset)

Serialize the current dataset's native BranchIdentifier as JSON.

The object follows the selected core's BranchIdentifier serde shape: {"version_mapping":[[version,uuid],...]}. For the main branch this is empty. The caller owns the string and frees it with lance_free_string().

Returns
JSON string, or NULL on error

◆ lance_dataset_branch_replace_metadata()

LANCE_API int32_t lance_dataset_branch_replace_metadata ( const LanceDataset * dataset,
const char * branch_name,
const char *const * metadata )

Replace all metadata entries on an existing branch.

metadata is NULL-terminated key-value pairs ["key","value",NULL]. NULL or an empty array means an empty native map. This is a full replacement of BranchContents.metadata, not a merge or a special NULL-delete operation. Other branch fields are preserved. An unknown branch surfaces as LANCE_ERR_NOT_FOUND.

Returns
0 on success, -1 on error

◆ lance_dataset_branches_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_branches_json ( const LanceDataset * dataset)

Serialize all branches as a JSON object keyed by branch name.

The value is Lance's native HashMap<String, BranchContents> serde output. Each value has the selected core's BranchContents shape, including parentBranch, identifier.version_mapping, parentVersion, createAt (Unix seconds), manifestSize and metadata. Map enumeration order is not promised. The caller owns the string and frees it with lance_free_string().

Returns
JSON string, or NULL on error

◆ lance_dataset_calculate_data_stats()

LANCE_NODISCARD LANCE_API LanceDataStatistics * lance_dataset_calculate_data_stats ( const LanceDataset * dataset)

Compute per-field data statistics (compressed on-disk byte size) for query planning. Walks every fragment, so this performs I/O. Caller frees the returned handle with lance_data_statistics_close().

Entries are ordered by schema field id, one per field (including nested struct/list children).

Returns
handle on success, or NULL on error

◆ lance_dataset_checkout_branch()

LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_checkout_branch ( const LanceDataset * dataset,
const char * branch_name )

Check out the latest version of a branch as an independent dataset.

"main" selects the default branch. The returned handle remains usable after the source dataset is closed.

Returns
new dataset handle, or NULL on error

◆ lance_dataset_checkout_ref()

LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_checkout_ref ( const LanceDataset * dataset,
const LanceRef * reference )

Check out a native Ref as a new dataset handle.

The source dataset and reference are unchanged. The returned handle owns an independent snapshot and is usable after the source dataset is closed. Caller closes it with lance_dataset_close().

Returns
new dataset handle, or NULL on error

◆ lance_dataset_cleanup()

LANCE_API int32_t lance_dataset_cleanup ( const LanceDataset * dataset,
const LanceCleanupPolicy * policy,
const LanceCleanupOperationOptions * operation_options,
LanceRemovalStats * out_stats )

Execute manual cleanup with an explicit native policy.

Cleanup re-evaluates current dataset references and storage state. It protects the current version, tags and referenced branches according to Lance core. Deletes already performed are not rolled back when a later delete fails; failed_deletes reports failures.

Parameters
datasetOpen dataset. Must not be NULL.
policyNative cleanup policy. Must not be NULL.
operation_optionsOptional operation overrides; NULL uses defaults.
out_statsReceives copied native stats on success only.
Returns
0 on success, -1 on error.

◆ lance_dataset_cleanup_explain()

LANCE_NODISCARD LANCE_API LanceCleanupExplanation * lance_dataset_cleanup_explain ( const LanceDataset * dataset,
const LanceCleanupPolicy * policy,
const LanceCleanupOperationOptions * operation_options )

Explain manual cleanup without deleting files.

Execution state is re-evaluated by a later lance_dataset_cleanup/lance_dataset_cleanup_old_versions call, so an explanation is not a deletion plan or a reservation.

Parameters
datasetOpen dataset. Must not be NULL.
policyNative cleanup policy. Must not be NULL.
operation_optionsOptional operation overrides; NULL uses defaults.
Returns
Owned explanation snapshot, or NULL on error. Close it with lance_cleanup_explanation_close. All strings borrowed from it remain valid until close.

◆ lance_dataset_cleanup_old_versions()

LANCE_API int32_t lance_dataset_cleanup_old_versions ( const LanceDataset * dataset,
const LanceCleanupOldVersionsOptions * options,
LanceRemovalStats * out_stats )

Destructively clean versions older than a relative duration using native Dataset::cleanup_old_versions.

The current version, tagged versions, referenced branch state and unverified-file protection follow Lance core. Deletes already performed are not rolled back if a later delete fails; inspect failed_deletes. The function has no lease or ownership relationship with historical snapshot handles, and removed files are no longer available to them.

Parameters
datasetOpen dataset. Must not be NULL.
optionsRelative window and optional native flags. Must not be NULL.
out_statsReceives copied native stats on success only.
Returns
0 on success, -1 on error.

◆ lance_dataset_commit_compaction()

LANCE_API int32_t lance_dataset_commit_compaction ( LanceDataset * dataset,
const LanceRewriteResult *const * results,
size_t result_count,
const LanceCompactionOptionsV2 * options,
LanceCompactionMetrics * out_metrics )

Commit rewrite results through native commit_compaction. NULL options select CompactionOptions::default(). Metrics are written only on success.

◆ lance_dataset_commit_index_segments()

LANCE_API int32_t lance_dataset_commit_index_segments ( LanceDataset * dataset,
const char * index_name,
const char * column,
const uint8_t *const * segment_metadata_bytes,
const size_t * segment_metadata_lens,
size_t segment_count )

Commit previously built uncommitted index segments as one logical index.

segment_metadata_bytes[i] must point to segment_metadata_lens[i] bytes of protobuf-encoded IndexMetadata produced by lance_index_segment_builder_execute_uncommitted() (typically built on distributed workers). All segments are registered under index_name on column in a single commit, so the dataset version increases by exactly one on success.

The segment set is validated by the Lance core and rejected with LANCE_ERR_INVALID_ARGUMENT when it is empty, contains duplicate segment UUIDs, or has overlapping fragment coverage. All segments must share one index type, and the commit fails if column does not exist. Every segment must declare column as its keyed field — that is, have been built for column — or the commit fails with LANCE_ERR_INVALID_ARGUMENT. Vector segments that will coexist (incoming segments and retained existing segments) must have compatible distance metrics, dimensions, sub-index types, and quantizer kinds. Independently trained IVF centroids and PQ codebooks may differ. Incompatible segments are rejected with LANCE_ERR_INVALID_ARGUMENT without changing the dataset version or index.

Replacement is automatic and coverage-driven — there is no replace flag: existing same-name segments of the same index type whose fragment coverage is fully covered by the incoming set are replaced, while existing segments covering disjoint fragments are retained as additional deltas of the logical index. A commit that would orphan fragments from an existing segment (partial overlap) is rejected. A commit whose index type differs from the existing same-name index replaces that index entirely, and therefore requires the incoming segments to cover every current fragment; a partial-coverage type change is rejected with LANCE_ERR_INVALID_ARGUMENT. Vector compatibility is checked after selecting replacements, so a complete replacement may change the metric without conflicting with removed segments.

Parameters
datasetOpen dataset (mutated; same handle remains valid).
index_nameLogical index name; must not be NULL or empty.
columnIndexed column; must not be NULL or empty.
segment_metadata_bytesArray of pointers to encoded IndexMetadata.
segment_metadata_lensArray of byte lengths, parallel to segment_metadata_bytes.
segment_countNumber of segments; must be > 0.
Returns
0 on success, -1 on error.

◆ lance_dataset_commit_optimize_indices()

LANCE_API int32_t lance_dataset_commit_optimize_indices ( LanceDataset * dataset,
const LanceIndexSegmentResult *const * results,
size_t result_count,
const LanceOptimizeIndicesOptions * options )

Commit merged results. Empty results retain native no-op/MemWAL behavior.

◆ lance_dataset_compact_files()

LANCE_API int32_t lance_dataset_compact_files ( LanceDataset * dataset,
const LanceCompactionOptions * options,
LanceCompactionMetrics * out_metrics )

Compact the dataset's fragments, committing a new manifest if anything changed. Each compaction task merges adjacent small fragments and materializes any deletion files in the process. A clean dataset (no fragment under the target size, no deletions worth materializing) is a no-op: the function returns success with all-zero metrics and the dataset's version is unchanged.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-compaction snapshot view.

Parameters
datasetOpen dataset (not consumed). Must not be NULL.
optionsTunable parameters. Pass NULL for upstream defaults.
out_metricsOptional. If non-NULL, on success receives the per-call compaction metrics. On error the slot is left unchanged — do not read it.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL dataset or for numeric overrides that exceed usize::MAX on the running target; LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_compact_files_v2()

LANCE_API int32_t lance_dataset_compact_files_v2 ( LanceDataset * dataset,
const LanceCompactionOptionsV2 * options,
LanceCompactionMetrics * out_metrics )

Compact using native CompactionOptions. NULL options select from_dataset_config. Metrics are written only on success.

◆ lance_dataset_config()

LANCE_NODISCARD LANCE_API LanceDatasetConfig * lance_dataset_config ( const LanceDataset * dataset)

Return a snapshot of the dataset's manifest config map.

The snapshot owns copies of the keys and values, so it remains valid after the dataset handle is closed. Accessors borrow from the snapshot and remain valid until lance_dataset_config_close().

Returns NULL on error (for example a NULL dataset handle).

Keys and values are exposed as NUL-terminated C strings. A config entry containing an embedded NUL byte cannot be represented and fails the snapshot with LANCE_ERR_INTERNAL. Entry order is unspecified.

◆ lance_dataset_config_close()

LANCE_API void lance_dataset_config_close ( LanceDatasetConfig * config)

Close and free a dataset config snapshot. Safe to call with NULL.

◆ lance_dataset_config_count()

LANCE_API uint64_t lance_dataset_config_count ( const LanceDatasetConfig * config)

Return the number of entries in the config snapshot. Returns 0 and sets LANCE_ERR_INVALID_ARGUMENT on a NULL handle. An empty config also yields 0 with no error set, so check lance_last_error_code() to distinguish the two.

◆ lance_dataset_config_key_at()

LANCE_NODISCARD LANCE_API const char * lance_dataset_config_key_at ( const LanceDatasetConfig * config,
size_t index )

Return the key at index (0 <= index < count). The pointer is borrowed from the snapshot. Returns NULL and sets LANCE_ERR_INVALID_ARGUMENT on a NULL handle or out-of-range index.

◆ lance_dataset_config_value_at()

LANCE_NODISCARD LANCE_API const char * lance_dataset_config_value_at ( const LanceDatasetConfig * config,
size_t index )

Return the value at index (0 <= index < count). The pointer is borrowed from the snapshot. Returns NULL and sets LANCE_ERR_INVALID_ARGUMENT on a NULL handle or out-of-range index.

◆ lance_dataset_count_deleted_rows()

LANCE_API int32_t lance_dataset_count_deleted_rows ( const LanceDataset * dataset,
uint64_t * out_rows )

Count rows hidden by deletion files across all fragments.

Parameters
datasetOpen dataset. Must not be NULL.
out_rowsReceives the native count on success only.
Returns
0 on success, -1 on error.

◆ lance_dataset_create_data_file()

LANCE_API int32_t lance_dataset_create_data_file ( const LanceDataset * dataset,
const char * path,
const uint32_t * base_id,
LanceDataFile ** out_file )

Owned native DataFile metadata snapshot. Create native data-file metadata from an existing Lance file.

Maps directly to Dataset::create_data_file. path is relative to the selected native data directory and must be non-NULL UTF-8. base_id == NULL maps to native None; a non-NULL pointer maps to native Some, including zero. Empty paths, missing files, malformed Lance files, schema mismatches and unregistered base IDs retain native validation and error timing.

On success *out_file receives an independently owned snapshot that remains valid after the dataset is closed. The output is written only on success.

Returns
0 on success, -1 on error.

◆ lance_dataset_create_scalar_index()

LANCE_API int32_t lance_dataset_create_scalar_index ( LanceDataset * dataset,
const char * column,
const char * index_name,
LanceScalarIndexType index_type,
const char * params_json,
bool replace )

Create a scalar index on a column.

Parameters
datasetOpen dataset (mutated; the same handle remains valid).
columnColumn name to index.
index_nameOptional index name; NULL selects the native default.
index_typeScalar index type, for example LANCE_SCALAR_BTREE or LANCE_SCALAR_INVERTED.
params_jsonOptional JSON params forwarded unchanged to the native Lance scalar-index plugin, or NULL for plugin defaults. An empty string is invalid JSON and is rejected with LANCE_ERR_INVALID_ARGUMENT, not treated as defaults. Plugin field names and validation apply; for example ZoneMap uses rows_per_zone/use_seeds and BloomFilter uses number_of_items/probability. MinHash LSH uses num_hashes, num_bands, shingle_size, and tokenizer. RTree uses page_size.
replaceIf true, replace any existing index of the same name.
Returns
0 on success, -1 on error.

◆ lance_dataset_create_scalar_index_with_options()

LANCE_API int32_t lance_dataset_create_scalar_index_with_options ( LanceDataset * dataset,
const char * column,
const char * index_name,
LanceScalarIndexType index_type,
const char * params_json,
const LanceScalarIndexOptions * options,
bool replace )

Create a scalar index with the additive native train control.

options == NULL or options->has_train == false preserves the native default. params_json remains the native plugin parameter object.

◆ lance_dataset_create_scalar_index_with_options_and_progress()

LANCE_API int32_t lance_dataset_create_scalar_index_with_options_and_progress ( LanceDataset * dataset,
const char * column,
const char * index_name,
LanceScalarIndexType index_type,
const char * params_json,
const LanceScalarIndexOptions * options,
LanceIndexBuildProgressCallback callback,
void * callback_ctx,
bool replace )

Create a scalar index with native train controls and optional progress.

This is lance_dataset_create_scalar_index_with_options() plus an observer. A NULL callback disables observation and preserves the legacy behavior; a non-NULL callback follows LanceIndexBuildProgressCallback's contract and is retired before this blocking call returns. options == NULL or options->has_train == false still preserves the native train default.

Native Lance commits before reloading index metadata, so an error can be returned after a dataset version was published. This call does not claim rollback on every nonzero return; reopen the dataset to inspect its current version.

Returns
0 on success, -1 on error.

◆ lance_dataset_create_scalar_index_with_progress()

LANCE_API int32_t lance_dataset_create_scalar_index_with_progress ( LanceDataset * dataset,
const char * column,
const char * index_name,
LanceScalarIndexType index_type,
const char * params_json,
LanceIndexBuildProgressCallback callback,
void * callback_ctx,
bool replace )

Create a scalar index with optional ordinary native build progress.

This is the legacy scalar entry point plus an observer. A NULL callback disables observation and preserves the legacy behavior; a non-NULL callback follows LanceIndexBuildProgressCallback's contract and is retired before this blocking call returns. params_json, name generation, replacement and native errors are unchanged.

Native Lance commits before reloading index metadata, so an error can be returned after a dataset version was published. This call does not claim rollback on every nonzero return; reopen the dataset to inspect its current version.

Returns
0 on success, -1 on error.

◆ lance_dataset_create_vector_index()

LANCE_API int32_t lance_dataset_create_vector_index ( LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexParams * params,
bool replace )

Create a vector index on a column.

Parameters
datasetOpen dataset (mutated; same handle remains valid).
columnColumn name (must be FixedSizeList<float32|float16|uint8|int8>).
index_nameOptional index name; NULL → "<column>_idx".
paramsVector index params; index_type field selects the variant.
replaceIf true, replace any existing index of the same name.
Returns
0 on success, -1 on error.

◆ lance_dataset_create_vector_index_with_options()

LANCE_API int32_t lance_dataset_create_vector_index_with_options ( LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexOptions * options,
bool replace )

Create a vector index from additive native options.

The native builder commits the index and then reloads committed metadata. An error can therefore be returned after the dataset version has already been published. Reopen the dataset to determine its current version; the binding does not claim storage rollback.

options is borrowed for the call and must not be NULL.

Returns
0 on success, -1 on error.

◆ lance_dataset_create_vector_index_with_options_and_progress()

LANCE_API int32_t lance_dataset_create_vector_index_with_options_and_progress ( LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexOptions * options,
LanceIndexBuildProgressCallback callback,
void * callback_ctx,
bool replace )

Create a vector index from additive native options with optional progress.

This is lance_dataset_create_vector_index_with_options() plus an observer. A NULL callback disables observation and preserves the legacy behavior; a non-NULL callback follows LanceIndexBuildProgressCallback's contract and is retired before this blocking call returns. All option forms, train controls, name generation, replacement and native errors are unchanged.

Native Lance commits before reloading index metadata, so an error can be returned after a dataset version was published. This call does not claim rollback on every nonzero return; reopen the dataset to inspect its current version.

Returns
0 on success, -1 on error.

◆ lance_dataset_create_vector_index_with_progress()

LANCE_API int32_t lance_dataset_create_vector_index_with_progress ( LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexParams * params,
LanceIndexBuildProgressCallback callback,
void * callback_ctx,
bool replace )

Create a vector index from legacy parameters with optional progress.

This is the legacy LanceVectorIndexParams entry point plus an observer. A NULL callback disables observation and preserves the legacy behavior; a non-NULL callback follows LanceIndexBuildProgressCallback's contract and is retired before this blocking call returns. Parameters, name generation, replacement and native errors are the same as lance_dataset_create_vector_index().

Native Lance commits before reloading index metadata, so an error can be returned after a dataset version was published. This call does not claim rollback on every nonzero return; reopen the dataset to inspect its current version.

Returns
0 on success, -1 on error.

◆ lance_dataset_data_storage_version()

LANCE_NODISCARD LANCE_API const char * lance_dataset_data_storage_version ( const LanceDataset * dataset)

Return the current snapshot's canonical Lance data-storage version string (for example "2.2"). The value is the native manifest file-format version.

Caller must free the returned string with lance_free_string(). Returns NULL on error.

◆ lance_dataset_deep_clone()

LANCE_API int32_t lance_dataset_deep_clone ( const LanceDataset * dataset,
const char * target_path,
const LanceRef * reference,
const LanceStorageOptionsAccessor * target_storage_options,
LanceDataset ** out )

Deep clone a dataset snapshot into a new dataset at target_path.

The whole operation is performed by Lance's native Dataset::deep_clone on a private clone of the source handle's snapshot. The source handle is not modified and no source write lock is held while files are copied.

reference == NULL clones the source handle's current snapshot: its branch and version id are pinned into Ref::Version(branch, Some(version)). Treat it as "clone this exact snapshot", not "clone the latest head". Pass an explicit LanceRef from lance_ref_version(NULL, false, 0) to clone the current head of the default branch.

target_storage_options is an existing storage-options accessor, or NULL. Its native accessor Arc is forwarded into ObjectStoreParams without resolving, snapshotting, or copying credentials, so a dynamic provider keeps its refresh behavior. NULL passes native None; a non-NULL accessor that holds static options and/or a provider contributes its native Arc, while an accessor created with neither contributes native None.

Files are copied and the target dataset is published by native Lance. The out handle is written only on success. On failure the out parameter is untouched. A copy or commit error does not guarantee that the target remains unpublished. Object-store copies are not transactional: partial objects may remain under target_path and are not rolled back. Reopen the target to check its state after an error. A target that already contains a published dataset is rejected by the native preflight before any copy.

The returned dataset is a normal LanceDataset whose manifest keeps the cloned snapshot's version id (native clone commit semantics), so its lance_dataset_version is the cloned version rather than always 1.

Native clone commits resolve the target URI through the default object-store registry, so target_path must use a scheme that registry knows (for example file, memory, s3, gs, az, or another built-in). A scheme registered only on a custom session registry is not visible to the clone commit. Use lance_dataset_write/lance_dataset_branch_create with an explicit session for those schemes.

For datasets with additional base paths, native deep clone reads every collected file through the source dataset's object store; per-base distinct source credentials are not supported. This call does not create extra providers, caches, registries, or per-base credential sets.

Caller closes the returned handle with lance_dataset_close().

Parameters
datasetsource dataset handle (must not be NULL)
target_pathUTF-8 target dataset URI (must not be NULL)
referencesnapshot ref, or NULL for the source handle's snapshot
target_storage_optionstarget accessor, or NULL for native None
outreceives the new dataset handle on success (must not be NULL)
Returns
0 on success, -1 on error; the out handle is not written on error

◆ lance_dataset_delete()

LANCE_API int32_t lance_dataset_delete ( LanceDataset * dataset,
const char * predicate,
uint64_t * out_num_deleted )

Delete rows matching the SQL predicate, committing a new manifest.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-delete snapshot view.

Parameters
datasetOpen dataset (not consumed). Must not be NULL.
predicateSQL filter, e.g. "id > 100" or "name = 'alice'". Must not be NULL or empty.
out_num_deletedOptional. If non-NULL, on success receives the number of rows that were deleted (0 if the predicate matched nothing). On error the slot is left unchanged — do not read it.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty args (validated at this boundary) and for malformed SQL or unknown columns (surfaced from the upstream parser since Lance 9.1; previously LANCE_ERR_INTERNAL), and LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_delta_builder_build()

LANCE_API int32_t lance_dataset_delta_builder_build ( LanceDatasetDeltaBuilder * builder,
LanceDatasetDelta ** out_delta )

Build the delta synchronously and consume builder on every return path, including foreign-pointer errors and native validation failures. The caller must not use the builder after this call. Native build validates range combinations (compared-against version conflicts, partial version and date ranges, missing range) and normalizes the compared-against mode's versions. On success *out_delta receives an independently owned delta handle (close it with lance_dataset_delta_close); on error the slot is left unchanged.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_builder_close()

LANCE_API void lance_dataset_delta_builder_close ( LanceDatasetDeltaBuilder * builder)

Close a delta builder handle. NULL-safe. Close exactly once. lance_dataset_delta_builder_build consumes the allocation, so a consumed builder must not be closed.

◆ lance_dataset_delta_builder_new()

LANCE_NODISCARD LANCE_API LanceDatasetDeltaBuilder * lance_dataset_delta_builder_new ( const LanceDataset * dataset)

Moves a dataset snapshot into a native DatasetDeltaBuilder owned by the returned handle. The builder holds its own dataset clone, so it stays valid after the dataset handle closes.

Returns NULL on error, including a NULL dataset pointer.

◆ lance_dataset_delta_builder_set_begin_timestamp()

LANCE_API int32_t lance_dataset_delta_builder_set_begin_timestamp ( LanceDatasetDeltaBuilder * builder,
const LanceDeltaTimestamp * timestamp )

Set the begin date for date-mode ranges. Native build requires a begin date when an end date is provided. The timestamp is copied. A NULL timestamp is rejected and the builder keeps its prior value; a timestamp the native chrono constructor cannot represent is rejected the same way.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_builder_set_begin_version()

LANCE_API int32_t lance_dataset_delta_builder_set_begin_version ( LanceDatasetDeltaBuilder * builder,
uint64_t version )

Set the explicit begin version. Native build requires both begin and end versions, or a compared-against version. Not set until called.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_builder_set_compared_against_version()

LANCE_API int32_t lance_dataset_delta_builder_set_compared_against_version ( LanceDatasetDeltaBuilder * builder,
uint64_t version )

Compare against the named version. Native build rejects combining this with any explicit begin/end version or date. Not set (native None) until called; the compared-against mode normalizes its native versions.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_builder_set_end_timestamp()

LANCE_API int32_t lance_dataset_delta_builder_set_end_timestamp ( LanceDatasetDeltaBuilder * builder,
const LanceDeltaTimestamp * timestamp )

Set the end date for date-mode ranges (requires a begin date in native build).

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_builder_set_end_version()

LANCE_API int32_t lance_dataset_delta_builder_set_end_version ( LanceDatasetDeltaBuilder * builder,
uint64_t version )

Set the explicit end version.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_close()

LANCE_API void lance_dataset_delta_close ( LanceDatasetDelta * delta)

Close a delta handle. NULL-safe. Close exactly once.

◆ lance_dataset_delta_get_deleted_row_ids()

LANCE_API int32_t lance_dataset_delta_get_deleted_row_ids ( const LanceDatasetDelta * delta,
struct ArrowArrayStream * out_stream )

Stream the deleted row ids across the delta's range. The stream's single column is the native stable row-id column; native resolution and id normalization are authoritative, and native errors (unsupported versions, reversed ranges, missing stable row ids) surface as returned errors. See lance_dataset_delta_get_inserted_rows.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_get_inserted_rows()

LANCE_API int32_t lance_dataset_delta_get_inserted_rows ( const LanceDatasetDelta * delta,
struct ArrowArrayStream * out_stream )

Stream the rows inserted across the delta's range. *out_stream receives an Arrow C stream owned by the caller (release it exactly once); it stays valid after the delta and dataset handles close. On error the stream slot is left unchanged.

Native row-change streams require stable row IDs at both nonzero endpoints; version 0 denotes the empty snapshot. Missing stable row IDs produce LANCE_ERR_INVALID_ARGUMENT when requesting the stream.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_get_updated_rows()

LANCE_API int32_t lance_dataset_delta_get_updated_rows ( const LanceDatasetDelta * delta,
struct ArrowArrayStream * out_stream )

Stream the rows updated across the delta's range. See lance_dataset_delta_get_inserted_rows.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_get_upserted_rows()

LANCE_API int32_t lance_dataset_delta_get_upserted_rows ( const LanceDatasetDelta * delta,
struct ArrowArrayStream * out_stream )

Stream the rows upserted across the delta's range. See lance_dataset_delta_get_inserted_rows.

Returns 0 on success, -1 on error.

◆ lance_dataset_delta_list_transactions()

LANCE_API int32_t lance_dataset_delta_list_transactions ( const LanceDatasetDelta * delta,
LanceTransaction *** out_transactions,
size_t * out_count )

List the transactions committed between the delta's begin and end versions. Each returned transaction is independently owned; release them together with lance_transaction_array_free. Versions without a transaction file are skipped natively.

On success *out_transactions receives the array (NULL when the count is 0) and *out_count its length. Both slots are left unchanged on error.

Returns 0 on success, -1 on error.

◆ lance_dataset_describe_indices_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_describe_indices_json ( const LanceDataset * dataset)

JSON array of every native IndexDescription, including system indexes.

Each entry carries the native name/type URL/index type, keyed field IDs, resolved field paths, approximate indexed-row count, native details JSON, total size (null when any segment lacks file sizes), and segment metadata. Native details conversion and field-path errors are returned as errors; the binding does not substitute {} or fabricated field paths. For each segment, fragment_ids is null for unknown coverage and [] for known-empty coverage. An empty dataset returns [].

Caller must free the returned string with lance_free_string().

◆ lance_dataset_drop_columns()

LANCE_API int32_t lance_dataset_drop_columns ( LanceDataset * dataset,
const char *const * columns,
size_t num_columns )

Drop one or more columns from the dataset's schema, committing a new manifest. This is a metadata-only operation: the data files on storage are not rewritten until a later lance_dataset_compact_files call materializes the projection (after which the previous version's files can be removed by a future cleanup operation).

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-drop schema view.

Parameters
datasetOpen dataset (not consumed). Mutated in place to see the new version. Must not be NULL.
columnsArray of NUL-terminated UTF-8 column names to drop. Must not be NULL; entries must be non-NULL and non-empty.
num_columnsLength of columns. Must be > 0.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty inputs, NULL or empty entries, non-UTF-8 column names, unknown columns, or an attempt to drop every column; LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_drop_index()

LANCE_API int32_t lance_dataset_drop_index ( LanceDataset * dataset,
const char * name )

Drop an index by name. Returns -1 (NOT_FOUND) if no such index.

◆ lance_dataset_field_id_at()

LANCE_API int32_t lance_dataset_field_id_at ( const LanceDataset * dataset,
size_t index,
int32_t * out_field_id )

Return the field ID at index in native pre-order traversal. Index 0 is the first top-level field; nested children follow their parent. On success writes *out_field_id and returns 0; on error returns -1 and leaves the output untouched.

◆ lance_dataset_field_id_count()

LANCE_API int32_t lance_dataset_field_id_count ( const LanceDataset * dataset,
size_t * out_count )

Return the number of field IDs in the current snapshot's schema. IDs are available in native pre-order traversal through lance_dataset_field_id_at. On success writes *out_count and returns 0; on error returns -1 and leaves the output untouched.

◆ lance_dataset_field_path()

LANCE_NODISCARD LANCE_API const char * lance_dataset_field_path ( const LanceDataset * dataset,
int32_t field_id )

Return the native minimal Lance field path for field_id in the current schema. The path round-trips through Lance field-path parsing and includes nested fields. Caller must free the returned string with lance_free_string(). Returns NULL on error, including an unknown ID.

◆ lance_dataset_fragment_count()

LANCE_API uint64_t lance_dataset_fragment_count ( const LanceDataset * dataset)

Return the number of fragments in the dataset. Returns 0 on error; a dataset with no fragments also returns 0, so check lance_last_error_code().

◆ lance_dataset_fragment_ids()

LANCE_API int32_t lance_dataset_fragment_ids ( const LanceDataset * dataset,
uint64_t * out_ids )

Fill out_ids with the fragment IDs of the dataset. Caller must allocate out_ids with at least lance_dataset_fragment_count() elements.

Returns
0 on success, -1 on error

◆ lance_dataset_get_ivf_model()

LANCE_NODISCARD LANCE_API LanceIvfModel * lance_dataset_get_ivf_model ( const LanceDataset * dataset,
const char * index_name )

Open the first physical vector segment named index_name and return an owned clone of its IVF model. The handle does not borrow the dataset.

Returns NULL on error. index_name must be non-NULL and non-empty.

◆ lance_dataset_has_stable_row_ids()

LANCE_API int32_t lance_dataset_has_stable_row_ids ( const LanceDataset * dataset,
bool * out_has_stable_row_ids )

Report whether the current snapshot uses stable row IDs. On success writes *out_has_stable_row_ids and returns 0; on error returns -1 and leaves the output untouched.

◆ lance_dataset_index_count()

LANCE_API uint64_t lance_dataset_index_count ( const LanceDataset * dataset)

Number of user indexes (excludes system indexes). Returns 0 on error; a dataset with no user indexes also returns 0, so check lance_last_error_code().

◆ lance_dataset_index_list_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_index_list_json ( const LanceDataset * dataset)

JSON array describing all user indexes. Caller must free the returned string with lance_free_string(). Returns NULL on error.

◆ lance_dataset_index_segment_count()

LANCE_API uint64_t lance_dataset_index_segment_count ( const LanceDataset * dataset,
const char * index_name )

Count the segments that make up a logical vector index.

A logical index is a set of physical segments (one per distributed-build worker, or one per fragment range). Each segment has a stable UUID. Returns 0 if the index does not exist (also sets LANCE_ERR_NOT_FOUND) or on error.

◆ lance_dataset_index_segments()

LANCE_API int32_t lance_dataset_index_segments ( const LanceDataset * dataset,
const char * index_name,
uint8_t * out_uuids,
size_t capacity,
uint64_t * out_count )

Fill out_uuids with the UUIDs of the segments that make up a logical index. Each UUID is written as 16 raw bytes (RFC 4122 layout).

Parameters
datasetOpen dataset. Must not be NULL.
index_nameLogical index name. Must not be NULL or empty.
out_uuidsCaller-allocated buffer for the UUIDs (byte length >= capacity * 16).
capacityNumber of UUIDs the buffer can hold.
out_countOptional (may be NULL). On success, receives the number of UUIDs actually written.

Returns 0 on success, -1 on error. If the index has more segments than capacity, returns LANCE_ERR_INVALID_ARGUMENT without writing anything; the caller can retry with a larger buffer.

◆ lance_dataset_index_segments_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_index_segments_json ( const LanceDataset * dataset)

JSON array describing non-system physical index segments visible to the Rust core for this dataset snapshot. Core compatibility filtering applies.

Each entry contains name, uuid, columns, type, dataset_version, index_version, and fragment_ids.

index_version is the physical index format version recorded in the segment's Lance IndexMetadata. fragment_ids is the recorded coverage in ascending order, including fragment IDs that no longer exist in the current dataset; the listing does not intersect it with the dataset's live fragments. A JSON null means the recorded coverage is unknown, while an empty array means the recorded coverage is known to be empty. Per-segment row counts are not provided.

Index names, column names, and other string values are JSON-escaped. Caller must free the returned string with lance_free_string(). Returns NULL on error (see lance_last_error_code/message).

◆ lance_dataset_index_statistics_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_index_statistics_json ( LanceDataset * dataset,
const char * index_name )

Return the native index-family-specific statistics JSON unchanged.

An absent index or empty name returns LANCE_ERR_NOT_FOUND. On old corrupt fragment coverage the native path may publish a migration version before returning; this handle is not automatically refreshed. Caller must free the returned string with lance_free_string().

◆ lance_dataset_io_stats_incremental()

LANCE_API int32_t lance_dataset_io_stats_incremental ( const LanceDataset * dataset,
LanceObjectStoreIoStats * out_stats )

Return dataset object-store counters accumulated since the previous incremental call and reset the native accumulator. This binding keeps no delta baseline. Returns 0 on success or -1 on a NULL handle/out pointer or native failure. out_stats is written only on success.

◆ lance_dataset_io_stats_snapshot()

LANCE_API int32_t lance_dataset_io_stats_snapshot ( const LanceDataset * dataset,
LanceObjectStoreIoStats * out_stats )

Snapshot the dataset's native object-store I/O counters without resetting.

The counters come from Dataset::object_store(None) and the native store accumulator. They are the current accumulator without resetting it; a preceding incremental call resets those counters to zero. Returns 0 on success or -1 on a NULL handle/out pointer or native failure. out_stats is written only on success.

◆ lance_dataset_merge()

LANCE_API int32_t lance_dataset_merge ( LanceDataset * dataset,
const char * left_on,
const char * right_on,
struct ArrowArrayStream * source )

Left-join precomputed columns from source into dataset and commit one native Dataset::merge operation.

left_on may name an existing dataset column, _rowid, or _rowaddr. right_on names a field in the source schema. Field lookup is exact and case-sensitive. Empty key strings are forwarded to native validation.

The source field named by right_on is the join key and is not appended. Every other top-level RHS field must be new to the dataset. Native owns key matching, duplicate and NULL semantics, schema compatibility, field IDs, physical writes, and commit conflicts. The pinned native implementation rejects duplicate right-side join keys, including duplicate NULL keys, with LANCE_ERR_INVALID_ARGUMENT.

The non-NULL source stream is consumed on every return path, including invalid dataset/key arguments and native failures. After this call the caller must not read, move, or release the stream again. A NULL source is rejected without consuming anything.

On success the same dataset handle points at the newly committed version. Existing scanners, fragment snapshots, and independently opened handles retain their previous snapshot. On error the handle keeps its prior in-memory snapshot unless the native commit outcome is uncertain; reopen the URI to establish the actual committed state in that case.

Native may leave uncommitted data files after a failed merge. The binding does not delete or roll them back; dataset cleanup/GC owns their disposition.

Returns
0 on success, -1 on error.

◆ lance_dataset_merge_index_metadata()

LANCE_API int32_t lance_dataset_merge_index_metadata ( const LanceDataset * dataset,
const uint8_t index_uuid[16],
const char * index_type,
bool has_batch_readhead,
size_t batch_readhead,
LanceIndexBuildProgressCallback callback,
void * callback_ctx )

Merge distributed Inverted index files for index_uuid into one root artifact. This call writes/merges files only: it does not commit a dataset version or return metadata. On error, partial files may remain.

index_uuid points to 16 RFC 4122 bytes. index_type is parsed by native Lance; at this pin only "Inverted" is supported by this merge path. Other native index types return their native errors. has_batch_readhead absent maps to None; true forwards Some(batch_readhead), including zero. The selected core currently ignores this parameter.

A non-NULL callback follows LanceIndexBuildProgressCallback's threading and lifetime contract. Callback retirement is enforced before this blocking call returns.

Complete publication requires a separate CreateIndex operation.

◆ lance_dataset_merge_index_segments()

LANCE_API int32_t lance_dataset_merge_index_segments ( const LanceDataset * dataset,
const uint8_t *const * segment_metadata_bytes,
const size_t * segment_metadata_lens,
size_t segment_count,
uint8_t ** out_bytes,
size_t * out_len )

Merge existing uncommitted physical segments into one uncommitted segment.

Every input is a protobuf-encoded native IndexMetadata. Native Lance owns all compatibility, replay, stale-fragment, coverage and type-family rules. An empty set is passed to native validation. On success, *out_bytes and *out_len receive a library-owned metadata buffer to free with lance_free_bytes(); publication still requires lance_dataset_commit_index_segments(). This call does not commit or mutate the in-memory dataset snapshot.

◆ lance_dataset_merge_insert()

LANCE_API int32_t lance_dataset_merge_insert ( LanceDataset * dataset,
const char *const * on_columns,
size_t num_on_columns,
struct ArrowArrayStream * source,
const LanceMergeInsertParams * params,
LanceMergeInsertResult * out_result )

Merge source into dataset keyed on on_columns, committing a new manifest. Mirrors SQL MERGE; the default parameters yield a find-or-create (insert rows that do not match an existing key).

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-merge snapshot view.

Parameters
datasetOpen dataset (not consumed). Must not be NULL.
on_columnsJoin keys. Length = num_on_columns. Must be non-NULL when num_on_columns > 0; each entry must be a non-NULL, non-empty C string. Column names are matched case-insensitively (upstream).
num_on_columnsLength of on_columns. Must be >= 1.
sourceArrow C Data Interface stream of source rows. Consumed by this call. Its schema must be compatible with the dataset schema (full match or a subschema).
paramsTunable parameters. Pass NULL for find-or-create defaults.
out_resultOptional. If non-NULL, on success receives the per-call insert/update/delete counts. On error the slot is left unchanged — do not read it.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty args, out-of-range mode discriminants, missing or extraneous expression strings, malformed SQL, unknown columns, schema incompatibility, and no-op configurations; LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_merge_insert_with_compaction()

LANCE_API int32_t lance_dataset_merge_insert_with_compaction ( LanceDataset * dataset,
const char *const * on_columns,
size_t num_on_columns,
struct ArrowArrayStream * source,
const LanceMergeInsertParams * params,
const LanceCompactedSsTable * compacted_sstables,
size_t num_compacted_sstables,
LanceMergeInsertResult * out_result )

Merge-insert with atomic MemWAL SSTable compaction progress.

Behaves like lance_dataset_merge_insert(), then marks compacted_sstables as compacted in the same commit. Call this only on the final data-changing pass of a multi-pass compaction. compacted_sstables is required to be non-NULL when num_compacted_sstables > 0.

◆ lance_dataset_metadata_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_metadata_json ( const LanceDataset * dataset)

Return this snapshot's table metadata as a JSON object mapping keys to string values. Keys and values are JSON-escaped. An empty map is {}.

Schema metadata is part of the Arrow schema returned by lance_dataset_schema() and is not duplicated here.

Caller must free the returned string with lance_free_string(). Returns NULL on error.

◆ lance_dataset_migrate_manifest_paths_v2()

LANCE_API int32_t lance_dataset_migrate_manifest_paths_v2 ( LanceDataset * dataset)

Migrate this dataset's manifest paths to v2 naming. Native rename behavior.

◆ lance_dataset_num_small_files()

LANCE_API int32_t lance_dataset_num_small_files ( const LanceDataset * dataset,
size_t max_rows_per_group,
uint64_t * out_count )

Count fragments with fewer physical rows than max_rows_per_group.

This follows the infallible native contract: in particular, max_rows_per_group == 0 returns 0. The output is written on success only.

Returns
0 on success, -1 on binding input error.

◆ lance_dataset_open_fragment()

LANCE_NODISCARD LANCE_API LanceFragment * lance_dataset_open_fragment ( const LanceDataset * dataset,
uint64_t fragment_id )

Resolve a fragment by ID from this dataset snapshot.

The returned handle retains Native FileFragment snapshot ownership: it remains valid, and keeps reading the same dataset version, after dataset is closed or mutated.

Parameters
datasetOpen dataset snapshot.
fragment_idFragment ID from lance_dataset_fragment_ids().
Returns
Fragment handle, or NULL on error. A missing ID sets LANCE_ERR_NOT_FOUND; a NULL dataset sets LANCE_ERR_INVALID_ARGUMENT.

◆ lance_dataset_open_namespace()

LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_open_namespace ( const LanceNamespace * ns,
const char * table_id_json,
const char * storage_options_json,
uint64_t version,
const LanceSession * session )

Open a dataset through native DatasetBuilder::from_namespace.

Namespace-provided location and storage options use native precedence. storage_options_json entries are merged over namespace initial options and the native refresh provider stays attached. version 0 selects latest.

◆ lance_dataset_optimize_indices()

LANCE_API int32_t lance_dataset_optimize_indices ( LanceDataset * dataset,
const LanceOptimizeIndicesOptions * options )

Single-process native optimize_indices. NULL options use defaults.

◆ lance_dataset_plan_compaction()

LANCE_NODISCARD LANCE_API LanceCompactionPlan * lance_dataset_plan_compaction ( const LanceDataset * dataset,
const LanceCompactionOptionsV2 * options )

Plan compaction. NULL options select from_dataset_config.

◆ lance_dataset_plan_optimize_indices()

LANCE_NODISCARD LANCE_API LanceOptimizeIndicesPlan * lance_dataset_plan_optimize_indices ( const LanceDataset * dataset,
const LanceOptimizeIndicesOptions * options )

Plan the native distributed optimize workflow.

◆ lance_dataset_prepare_fts_match_query()

LANCE_NODISCARD LANCE_API LanceFtsQueryContext * lance_dataset_prepare_fts_match_query ( const LanceDataset * dataset,
const char * column,
const char * query,
int32_t match_operator,
uint32_t max_fuzzy_distance,
int32_t coverage_mode )

Prepare an immutable, process-local Match query context for one column.

Preparation pins the dataset handle's current snapshot, enumerates all committed FTS segments for column, checks fragment coverage, opens those segments, and prepares one global BM25 scorer across their indexed documents. match_operator supports both AND and OR.

The context can be shared by scanners created from the exact same process-local dataset snapshot. It has no serialization or cross-process transport format. Reopening the same URI and manifest version creates a different identity and cannot reuse the context because storage options and object-store endpoints may differ.

In LANCE_FTS_COVERAGE_INDEX_ONLY mode, unindexed fragments are allowed and excluded from both the scorer corpus and query results. In STRICT mode any unindexed fragment makes this call fail.

Parameters
datasetOpen dataset whose current snapshot the context pins.
columnFTS-indexed column name.
queryQuery terms.
match_operatorFixed-width LanceFtsMatchOperator discriminant.
max_fuzzy_distanceReserved for prepared fuzzy matching and currently must be 0. The parameter is retained so enabling canonical cross-segment fuzzy vocabulary injection later does not require another C ABI change.
coverage_modeFixed-width LanceFtsCoverageMode discriminant.
Returns
Context handle on success, or NULL on error.

◆ lance_dataset_prepare_fts_phrase_query()

LANCE_NODISCARD LANCE_API LanceFtsQueryContext * lance_dataset_prepare_fts_phrase_query ( const LanceDataset * dataset,
const char * column,
const char * query,
int32_t slop,
int32_t coverage_mode )

Prepare an immutable, process-local Phrase query context for one column.

The selected FTS index must store token positions. slop == 0 requires an exact phrase; a positive value permits that many intervening positions. Dataset identity, coverage, sharing, and segment-scoped execution follow the same contract as lance_dataset_prepare_fts_match_query().

Parameters
datasetOpen dataset whose current snapshot the context pins.
columnFTS-indexed column name.
queryPhrase terms.
slopMaximum non-negative number of intervening token positions permitted between adjacent phrase terms.
coverage_modeFixed-width LanceFtsCoverageMode discriminant.
Returns
Context handle on success, or NULL on error.

◆ lance_dataset_prewarm_index()

LANCE_API int32_t lance_dataset_prewarm_index ( const LanceDataset * dataset,
const char * index_name )

Synchronously prewarm a logical index in the dataset's session index cache.

Delegates to the Rust SDK's prewarm_index for all segments with index_name in the handle's current snapshot. Does not change the dataset version. Index types/formats follow the SDK's prewarm support and error behavior.

Reuse the same LanceSession when opening subsequent query datasets to reuse warmed entries across handles. Cache entries remain evictable; success does not guarantee full or permanent residency. Ordinary data columns are not prewarmed. An error may leave partially warmed entries; retrying is safe.

dataset must be valid and index_name must be a non-empty, NUL-terminated UTF-8 string. Both must remain valid until this blocking call returns. Returns 0 on success, -1 on error (see lance_last_error_code/message). NULL/empty/invalid UTF-8 arguments yield LANCE_ERR_INVALID_ARGUMENT; an index absent from this snapshot yields LANCE_ERR_NOT_FOUND.

◆ lance_dataset_prewarm_index_with_options()

LANCE_API int32_t lance_dataset_prewarm_index_with_options ( const LanceDataset * dataset,
const char * index_name,
const LanceIndexPrewarmOptions * options )

Synchronously prewarm selected physical segments with native FTS position controls. options == NULL preserves the legacy all-segment behavior. Existing index-name/schema-column collision handling applies. Cache entries remain evictable; no residency or latency guarantee is made.

◆ lance_dataset_read_blob_ranges()

LANCE_API int32_t lance_dataset_read_blob_ranges ( const LanceDataset * dataset,
const char * column,
int32_t selector,
const LanceBlobRangeRequest * requests,
size_t num_requests,
const LanceBlobReadOptions * options,
struct ArrowArrayStream * out )

Plan and export one blob-local range read per request.

The returned Arrow stream schema is, in order:

  1. request_index: UInt64, non-null
  2. row_address: UInt64, non-null
  3. offset: UInt64, non-null
  4. length: UInt64, non-null
  5. data: LargeBinary, nullable

Exactly one Arrow record follows each native ReadBlobRange. request_index is the zero-based input position and remains present for duplicate and unordered requests. NULL blobs have null data; a non-null blob with an empty range has a non-null empty buffer. Native payload Bytes are retained directly by the Arrow buffers; payload bytes are not copied when an Arrow record is assembled.

Native validation stages are retained. Request offset-plus-length overflow, scheduler buffer validation and physical range planning happen in the factory. Native null-blob requests skip logical bounds checks. Payload I/O errors happen while consuming the stream and use the ArrowArrayStream error contract. Exported batches own their buffers and remain valid after the stream is released.

Planning retains O(request_count) metadata. io_buffer_size bounds each scheduler-visible physical batch after range coalescing, except that one request larger than the buffer is materialized by itself. The scheduler separately applies byte backpressure to physical I/O; this is not a hard cap on all process memory.

out is written only after successful native planning and Arrow stream export, and must then be released exactly once. On error it is untouched.

Returns
0 on success, -1 on error.

◆ lance_dataset_read_blobs()

LANCE_API int32_t lance_dataset_read_blobs ( const LanceDataset * dataset,
const char * column,
int32_t selector,
const uint64_t * rows,
size_t num_rows,
const LanceBlobReadOptions * options,
struct ArrowArrayStream * out )

Plan and export whole-blob reads.

The returned Arrow stream schema is, in order:

  1. row_address: UInt64, non-null
  2. data: LargeBinary, nullable

Exactly one Arrow record follows each native ReadBlob result. NULL blob values have a null data entry; valid empty blobs have a non-null empty buffer. Native ordering, duplicate selection and payload bytes are preserved. Selected input rows are copied before native state retains them. Native payload Bytes are retained directly by the Arrow buffers; payload bytes are not copied when an Arrow record is assembled.

Column lookup and read planning run in this factory and their errors are returned before any output stream exists. Payload I/O errors happen while consuming the stream and use the ArrowArrayStream error contract (get_next nonzero plus get_last_error). Closing the dataset handle does not invalidate a successfully created stream. Exported batches own their buffers and remain valid after the stream is released.

out is written only after successful native planning and Arrow stream export, and must then be released exactly once. On error it is untouched.

Returns
0 on success, -1 on error.

◆ lance_dataset_read_index_partition()

LANCE_API int32_t lance_dataset_read_index_partition ( const LanceDataset * dataset,
const char * index_name,
uint64_t partition_id,
bool with_vector,
struct ArrowArrayStream * out_stream )

Read one logical IVF partition across every physical segment.

The returned ArrowArrayStream owns its native snapshot and remains valid after the source dataset is closed. The caller releases it once with its Arrow release callback.

◆ lance_dataset_read_transaction()

LANCE_API int32_t lance_dataset_read_transaction ( const LanceDataset * dataset,
LanceTransaction ** out_transaction )

Read the current snapshot's transaction.

Returns 0 on success. On success the output is either an independently owned transaction handle or NULL when the manifest has no transaction file. The output slot is unchanged on error. The transaction remains valid after the source dataset handle is closed.

◆ lance_dataset_read_transaction_by_version()

LANCE_API int32_t lance_dataset_read_transaction_by_version ( const LanceDataset * dataset,
uint64_t version,
LanceTransaction ** out_transaction )

Read a specific version's transaction.

version is resolved through the native dataset branch and storage rules. Missing versions and invalid IDs follow native errors. Returns 0 on success; success writes a transaction handle or NULL when that version has no transaction file. The output slot is unchanged on error.

◆ lance_dataset_resolve_field_id()

LANCE_API int32_t lance_dataset_resolve_field_id ( const LanceDataset * dataset,
const LanceFieldReference * field,
int32_t * out_field_id )

Resolve a field reference by ID or path against the current snapshot. Native FieldRef validation supplies the error for an unknown ID or path. On success writes *out_field_id and returns 0; on error returns -1 and leaves the output untouched.

◆ lance_dataset_restore()

LANCE_NODISCARD LANCE_API LanceDataset * lance_dataset_restore ( const LanceDataset * dataset,
uint64_t version )

Restore the dataset by committing a new manifest that carries the fragments of version. A new version is committed even when version is already the latest. The input dataset handle remains unchanged.

Parameters
datasetOpen dataset (not consumed). Must not be NULL.
versionTarget version id (>= 1). 0 is rejected since it is the "latest" sentinel used by lance_dataset_open.
Returns
Fresh LanceDataset* positioned at the newly committed version (caller closes with lance_dataset_close), or NULL on error. Error codes include LANCE_ERR_INVALID_ARGUMENT (NULL handle or version == 0), LANCE_ERR_NOT_FOUND (unknown version), LANCE_ERR_COMMIT_CONFLICT (concurrent writer).

◆ lance_dataset_schema()

LANCE_API int32_t lance_dataset_schema ( const LanceDataset * dataset,
struct ArrowSchema * out )

Export the dataset schema via Arrow C Data Interface.

Parameters
datasetOpen dataset. Must not be NULL.
outPointer to caller-allocated ArrowSchema struct
Returns
0 on success, -1 on error

◆ lance_dataset_schema_clone()

LANCE_API int32_t lance_dataset_schema_clone ( const LanceDataset * dataset,
LanceSchema ** out_schema )

Clone the dataset's current native schema into an independently owned handle.

The clone preserves field and parent IDs, logical types, encodings, dictionary values, nested metadata, field order, and nullability. It does not pass through Arrow. The handle remains valid after the dataset is closed.

Parameters
datasetOpen dataset snapshot. Must not be NULL.
out_schemaReceives the owned schema on success; unchanged on error.
Returns
0 on success, -1 on error. Close the result with lance_schema_close().

◆ lance_dataset_shallow_clone()

LANCE_API int32_t lance_dataset_shallow_clone ( const LanceDataset * dataset,
const char * target_path,
const LanceRef * reference,
const LanceStorageOptionsAccessor * target_storage_options,
LanceDataset ** out )

Shallow clone a dataset snapshot into a new dataset at target_path.

The whole operation is performed by Lance's native Dataset::shallow_clone on a private clone of the source handle's snapshot. The source handle is not modified and no source write lock is held while the clone is committed. Native shallow clone publishes a metadata-only target whose manifest reuses the source base paths instead of copying data files.

reference == NULL clones the source handle's current snapshot: its branch and version id are pinned into Ref::Version(branch, Some(version)). Treat it as "clone this exact snapshot", not "clone the latest head". Pass an explicit LanceRef from lance_ref_version(NULL, false, 0) to clone the current head of the default branch. Source location, reference resolution, and the published version are native-defined by the selected reference and manifest.

target_storage_options is an existing storage-options accessor, or NULL. Its native accessor Arc is forwarded into ObjectStoreParams without resolving, snapshotting, or copying credentials, so a dynamic provider keeps its refresh behavior. NULL passes native None, which makes the target inherit the source dataset's dataset-level store parameters as native shallow clone does. A non-NULL accessor that holds static options and/or a provider contributes its native Arc; an accessor created with neither contributes native None, while an accessor with an engaged static map, even an empty one, contributes Some and selects explicit target parameters.

Native shallow clone resolves the target through the source dataset's session and object-store registry, captured when the source handle was opened. Schemes visible only to another registry are not available here.

The returned dataset retains the source store parameters for its base paths as a runtime binding, so it can read shared source files after the source handle is closed. Those bindings and accessor owners are not persisted in the target manifest. Reopening the clone in a new dataset handle requires supplying them again through lance_dataset_open_with_base_store_params when the default store configuration cannot read a base. This call does not reopen the target, persist credentials, or add a custom ObjectStore API.

The out handle is written only on success. A target that already contains a published dataset is rejected by the native preflight before clone writes. Later native failures may leave partial files, including tagged index files, under target_path; they are not rolled back. Remote/cloud behavior is whatever the configured native providers return; this binding makes no additional availability or persistence guarantee.

Caller closes the returned handle with lance_dataset_close().

Parameters
datasetsource dataset handle (must not be NULL)
target_pathUTF-8 target dataset URI (must not be NULL)
referencesnapshot ref, or NULL for the source handle's snapshot
target_storage_optionstarget accessor, or NULL for native None
outreceives the new dataset handle on success (must not be NULL)
Returns
0 on success, -1 on error; the out handle is not written on error

◆ lance_dataset_sql_builder_new()

LANCE_NODISCARD LANCE_API LanceSqlQueryBuilder * lance_dataset_sql_builder_new ( const LanceDataset * dataset,
const char * sql )

Moves sql into a native SqlQueryBuilder owned by the returned handle. The SQL text is copied when the builder is created; the builder holds its own dataset snapshot (native Dataset clone), so it stays valid after the dataset handle closes.

Returns NULL on error, including a NULL dataset or NULL SQL pointer.

◆ lance_dataset_tag_create()

LANCE_API int32_t lance_dataset_tag_create ( const LanceDataset * dataset,
const char * tag_name,
const LanceRef * reference )

Create a tag from a native ref.

Target resolution, name validation, version lookup and duplicate detection are performed by the native Tags::create implementation. A duplicate tag surfaces as LANCE_ERR_COMMIT_CONFLICT; an unknown version surfaces as LANCE_ERR_NOT_FOUND.

Returns
0 on success, -1 on error

◆ lance_dataset_tag_delete()

LANCE_API int32_t lance_dataset_tag_delete ( const LanceDataset * dataset,
const char * tag_name )

Delete a tag. An unknown tag surfaces as LANCE_ERR_NOT_FOUND.

Returns
0 on success, -1 on error

◆ lance_dataset_tag_get()

LANCE_NODISCARD LANCE_API LanceTag * lance_dataset_tag_get ( const LanceDataset * dataset,
const char * tag_name )

Fetch one tag by name. Caller frees with lance_tag_close().

Returns
tag handle, or NULL on error

◆ lance_dataset_tag_replace_metadata()

LANCE_API int32_t lance_dataset_tag_replace_metadata ( const LanceDataset * dataset,
const char * tag_name,
const char *const * metadata )

Replace all metadata entries on an existing tag.

metadata is NULL-terminated key-value pairs ["key","value",NULL]. NULL means an empty map. Native storage serializes missing metadata as an empty map on read, so absent and empty metadata are observationally equivalent.

Returns
0 on success, -1 on error (including LANCE_ERR_NOT_FOUND)

◆ lance_dataset_tag_update()

LANCE_API int32_t lance_dataset_tag_update ( const LanceDataset * dataset,
const char * tag_name,
const LanceRef * reference )

Update an existing tag to a native ref. The native implementation preserves metadata while updating the target and timestamps.

Returns
0 on success, -1 on error (including LANCE_ERR_NOT_FOUND)

◆ lance_dataset_tags()

LANCE_NODISCARD LANCE_API LanceTags * lance_dataset_tags ( const LanceDataset * dataset)

Snapshot all tags. Caller frees with lance_tags_close(). The copied snapshot remains valid after the dataset is closed. Entry order is unspecified.

Returns
handle on success, or NULL on error

◆ lance_dataset_take()

LANCE_API int32_t lance_dataset_take ( const LanceDataset * dataset,
const uint64_t * indices,
size_t num_indices,
const char *const * columns,
struct ArrowArrayStream * out )

Take rows by indices.

On success, out is initialized in caller-owned storage; the caller must eventually invoke its non-NULL release callback exactly once. The schema is validated before the stream callbacks are exposed. A deferred iteration failure, including a caught panic in get_next, is reported through the Arrow C stream contract (nonzero get_next plus get_last_error). A panic during release cleanup is contained and logged; cleanup remains best-effort.

Parameters
datasetOpen dataset. Must not be NULL.
indicesArray of 0-based row offsets
num_indicesLength of indices array
columnsNULL-terminated column names, or NULL for all
outPointer to caller-allocated ArrowArrayStream
Returns
0 on success, -1 on error

◆ lance_dataset_take_blobs()

LANCE_API int32_t lance_dataset_take_blobs ( const LanceDataset * dataset,
const uint64_t * row_ids,
size_t num_row_ids,
const char * column,
LanceBlobFile ** out )

Take blob handles by dataset row ID.

Row IDs are values from the _rowid scanner column, not zero-based row offsets. They must belong to the same dataset snapshot used for this read.

On success out[i] holds the handle for row_ids[i], or NULL when that blob value is null (an empty blob is a handle of size 0). The caller closes every non-NULL handle exactly once. On failure out is left untouched; a row ID that does not resolve fails the whole call.

Parameters
datasetOpen dataset snapshot.
row_idsArray of dataset row IDs. May be NULL only when num_row_ids is zero.
num_row_idsLength of row_ids. Zero is a no-op that succeeds without writing to out.
columnName of a Blob v2 column. Must not be NULL. A missing column, or a column that is not a blob column, is an error.
outCaller-allocated array of at least num_row_ids handle pointers. Must not be NULL.
Returns
0 on success, -1 on error

◆ lance_dataset_take_blobs_by_addresses()

LANCE_API int32_t lance_dataset_take_blobs_by_addresses ( const LanceDataset * dataset,
const uint64_t * row_addresses,
size_t num_row_addresses,
const char * column,
LanceBlobFile ** out )

Take blob handles by physical row address.

A row address encodes (fragment_id << 32) | row_offset. These are physical row addresses, such as those produced by a scan with row addresses enabled; they are not stable row IDs from _rowid.

On success out[i] holds the handle for row_addresses[i], or NULL when that blob value is null. A valid empty blob yields a non-NULL handle of size zero. Handles preserve input order and duplicates, have independent cursors, and remain usable after the dataset closes. On failure out is left untouched.

Unlike the older take entry points, an empty selection still validates column through the native API. This includes rejecting a missing or non-blob column.

Parameters
datasetOpen dataset snapshot.
row_addressesArray of physical row addresses. May be NULL only when num_row_addresses is zero.
num_row_addressesLength of row_addresses.
columnBlob column to read. Must not be NULL.
outCaller-allocated array of at least num_row_addresses handle pointers. Must not be NULL.
Returns
0 on success, -1 on error

◆ lance_dataset_take_blobs_by_indices()

LANCE_API int32_t lance_dataset_take_blobs_by_indices ( const LanceDataset * dataset,
const uint64_t * indices,
size_t num_indices,
const char * column,
LanceBlobFile ** out )

Take blob handles by row index.

Row indices are 0-based offsets in the dataset, as used by lance_dataset_take(). Ownership, ordering, NULL slots, and failure behavior are identical to lance_dataset_take_blobs().

Parameters
datasetOpen dataset snapshot.
indicesArray of 0-based row offsets. May be NULL only when num_indices is zero.
num_indicesLength of indices. Zero is a no-op that succeeds without writing to out.
columnName of a Blob v2 column. Must not be NULL.
outCaller-allocated array of at least num_indices handle pointers. Must not be NULL.
Returns
0 on success, -1 on error

◆ lance_dataset_take_rows()

LANCE_API int32_t lance_dataset_take_rows ( const LanceDataset * dataset,
const uint64_t * row_ids,
size_t num_row_ids,
const char *const * columns,
struct ArrowArrayStream * out )

Take rows by dataset row IDs.

Row IDs are values from the _rowid scanner column, not zero-based row offsets. They must belong to the same dataset snapshot used for this read. Missing or deleted row IDs may be omitted from the result. For found rows, input order and duplicates are preserved.

On success, out is initialized in caller-owned storage; the caller must eventually invoke its non-NULL release callback exactly once. The schema is validated before the stream callbacks are exposed. A deferred iteration failure, including a caught panic in get_next, is reported through the Arrow C stream contract (nonzero get_next plus get_last_error). A panic during release cleanup is contained and logged; cleanup remains best-effort.

Parameters
datasetOpen dataset snapshot.
row_idsArray of dataset row IDs. May be NULL only when num_row_ids is zero.
num_row_idsLength of row_ids.
columnsNULL-terminated column names, or NULL for all. The system column _rowid may be requested explicitly.
outPointer to caller-allocated ArrowArrayStream.
Returns
0 on success, -1 on error.

◆ lance_dataset_tracked_files_stream()

LANCE_API int32_t lance_dataset_tracked_files_stream ( const LanceDataset * dataset,
const LanceTrackedFilesOptions * options,
struct ArrowArrayStream * out )

Export Dataset::tracked_files_with_options as an Arrow C stream.

The native schema, dictionary/timestamp types, values, optional min_version filtering and unspecified row order are preserved. Tracked files follow native manifest walking; this is not a physical file listing. The stream owns its resources and remains valid after the source dataset is closed.

out is caller-owned, must be zero-initialized by convention, and is written only on success. Invoke its non-NULL release callback exactly once.

Returns
0 on success, -1 on error.

◆ lance_dataset_truncate_table()

LANCE_API int32_t lance_dataset_truncate_table ( LanceDataset * dataset)

Delete all rows through native Dataset::truncate_table.

◆ lance_dataset_update()

LANCE_API int32_t lance_dataset_update ( LanceDataset * dataset,
const char * predicate,
const char *const * columns,
const char *const * values,
size_t num_updates,
uint64_t * out_num_updated )

Update rows matching the SQL predicate by applying per-column SQL expressions, committing a new manifest.

Mutates dataset in place — the same handle remains valid afterward and sees the new version. Scanners already in flight against this dataset keep their pre-update snapshot view.

Parameters
datasetOpen dataset (not consumed). Must not be NULL.
predicateSQL filter, e.g. "id > 100". Pass NULL to update every row. An explicit empty string is rejected.
columnsColumn names to update. Length = num_updates. Must not be NULL when num_updates > 0; each entry must be a non-NULL, non-empty C string.
valuesSQL scalar expressions, evaluated per row, one per columns[i] (e.g. "100", "price * 2", "CASE WHEN ... END"). Same NULL/length rules.
num_updatesLength of columns and values. Must be >= 1.
out_num_updatedOptional. If non-NULL, on success receives the number of rows that were updated (0 if the predicate matched nothing). On error the slot is left unchanged — do not read it.
Returns
0 on success, -1 on error. Error codes: LANCE_ERR_INVALID_ARGUMENT for NULL/empty args, num_updates == 0, malformed SQL, and unknown columns; LANCE_ERR_COMMIT_CONFLICT for a concurrent writer.

◆ lance_dataset_update_config()

LANCE_API int32_t lance_dataset_update_config ( LanceDataset * dataset,
const char *const * keys,
const char *const * values,
size_t num_entries )

Apply merge-style dataset config updates and commit a new manifest.

keys and values are parallel arrays of length num_entries. A non-NULL values[i] upserts keys[i]; a NULL values[i] removes it. This maps directly to the native Dataset::update_config merge operation. An entry count of 0 is passed through as an empty native update.

When num_entries > 0, both arrays must be non-NULL and every keys[i] must be a non-NULL C string. Empty keys and empty string values are passed through unchanged, matching native map semantics.

On success the dataset handle points at the newly committed version.

Returns
0 on success, -1 on error.

◆ lance_dataset_update_config_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_update_config_json ( LanceDataset * dataset,
const char *const * keys,
const char *const * values,
size_t count,
LanceMetadataUpdateMode mode )

Merge or replace dataset config and return the complete updated map as a JSON object.

keys and values are parallel arrays of length count.

  • keys[i] must be a non-NULL, NUL-terminated UTF-8 string.
  • values[i] == NULL removes keys[i].
  • An empty string value is a real value and is stored as "".
  • keys and values may be NULL only when count == 0.

mode is explicit:

  • LANCE_METADATA_UPDATE_MERGE applies the entries to the existing map.
  • LANCE_METADATA_UPDATE_REPLACE replaces the entire map. With count == 0, this clears the map; value-less entries are omitted.

Duplicate keys in one call are forwarded in input order and follow the native builder's last-write-wins behavior. The native builder commits one transaction and its complete resulting map is serialized as JSON. This mutates dataset in place; other dataset handles and existing streams keep their prior snapshot view.

Caller must free the returned JSON string with lance_free_string(). Returns NULL on error.

◆ lance_dataset_update_field_metadata()

LANCE_API int32_t lance_dataset_update_field_metadata ( LanceDataset * dataset,
const LanceFieldMetadataUpdate * updates,
size_t update_count )

Apply a batch of field metadata updates and commit one native operation.

Each updates[i] is resolved against the dataset's current schema when the call starts. A batch may mix field references, merge/replace modes and fields. If the same field is referenced more than once, the native builder's last update wins.

The input array, keys, values and paths are borrowed only for this call and are copied before the native asynchronous operation starts. The native builder performs the commit and validation. The same dataset handle sees the new version; existing snapshots, scanners and independent handles keep their prior view. Read the resulting field metadata through the Arrow schema returned by lance_dataset_schema().

Returns 0 on success, -1 on error. Input, field lookup, validation and commit errors follow the native Lance core.

◆ lance_dataset_update_metadata_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_update_metadata_json ( LanceDataset * dataset,
const char *const * keys,
const char *const * values,
size_t count,
LanceMetadataUpdateMode mode )

Merge or replace table metadata and return the complete updated map as a JSON object.

keys and values are parallel arrays of length count.

  • keys[i] must be a non-NULL, NUL-terminated UTF-8 string.
  • values[i] == NULL removes keys[i], matching the native None value. It does not store an empty value.
  • An empty string value is a real value and is stored as "".
  • keys and values may be NULL only when count == 0.

mode is explicit:

  • LANCE_METADATA_UPDATE_MERGE applies the entries to the existing map.
  • LANCE_METADATA_UPDATE_REPLACE replaces the entire map. With count == 0, this clears the map; value-less entries are omitted.

The native builder performs the commit. This mutates dataset in place; the same handle remains valid and sees the new version, while existing dataset snapshots and scanners keep their prior view. Key validation, version transitions, concurrent transaction behavior and error semantics follow the pinned Lance core.

Caller must free the returned JSON string with lance_free_string(). Returns NULL on error. Commit and error semantics follow the native core.

◆ lance_dataset_update_schema_metadata_json()

LANCE_NODISCARD LANCE_API const char * lance_dataset_update_schema_metadata_json ( LanceDataset * dataset,
const char *const * keys,
const char *const * values,
size_t count,
LanceMetadataUpdateMode mode )

Merge or replace schema metadata and return the complete updated schema metadata map as a JSON object. Input and ownership rules match lance_dataset_update_metadata_json.

This changes only schema metadata: dataset fields, fragments, table metadata and configuration are unchanged. Read the committed schema metadata through the Arrow schema returned by lance_dataset_schema().

Caller must free the returned JSON string with lance_free_string(). Returns NULL on error. Commit and error semantics follow the native core.

◆ lance_dataset_validate()

LANCE_API int32_t lance_dataset_validate ( const LanceDataset * dataset)

Validate the dataset's fragments, stable row IDs and indices.

Returns
0 on success, -1 on error.

◆ lance_dataset_write()

LANCE_API int32_t lance_dataset_write ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const char *const * storage_opts,
LanceDataset ** out_dataset )

Write an Arrow record batch stream to a Lance dataset at uri, committing a manifest.

This legacy entry point records the documented lance-c auto-cleanup policy in a newly created manifest: every 20 committed versions, versions older than 14 days are reclaimed automatically. Callers relying on lance_dataset_versions / lance_dataset_restore for time travel should be aware that versions past that horizon may no longer exist. Use lance_dataset_write_with_options to select native WriteParams defaults instead.

Parameters
uriDataset URI (file://, s3://, memory://, etc.). Must not be NULL or an empty string.
schemaRequired Arrow schema. The stream schema must match or the call fails with LANCE_ERR_INVALID_ARGUMENT. This function does NOT call schema->release; the caller retains ownership and must release the schema after the call returns (success or failure).
streamArrow C Data Interface stream consumed by this call. Do not use the stream after returning, regardless of the return code.
modeCREATE / APPEND / OVERWRITE (see LanceWriteMode).
storage_optsNULL-terminated key-value pairs ["k","v",NULL], or NULL.
out_datasetIf non-NULL, on success receives an open LanceDataset* at the newly-committed version (caller must lance_dataset_close it). Pass NULL to discard. On error *out_dataset is left unchanged — do not read or free it. On entry *out_dataset should be NULL or a pointer whose previous value is no longer needed; this function overwrites the slot on success without releasing any prior handle.
Returns
0 on success, -1 on error. Possible error codes include LANCE_ERR_DATASET_ALREADY_EXISTS (CREATE on an existing path), LANCE_ERR_INVALID_ARGUMENT (NULL/empty args, invalid mode, schema mismatch), LANCE_ERR_COMMIT_CONFLICT (concurrent writer).

◆ lance_dataset_write_namespace()

LANCE_API int32_t lance_dataset_write_namespace ( const LanceNamespace * ns,
const char * table_id_json,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteParams * params,
const LanceWriteOptions * options,
const char * storage_options_json,
const LanceSession * session,
const char * branch,
LanceDataset ** out_dataset )

Write an Arrow stream into a native namespace-managed table.

CREATE uses native declare_table. APPEND/OVERWRITE use native describe_table and the native namespace commit handler. A non-NULL branch calls native write_into_namespace_on_branch; NULL keeps main. params and options use the existing write conversion but with native write defaults (legacy auto-cleanup is not applied). storage_options_json is merged by native namespace write logic. The stream is consumed on every return once it has been accepted. out_dataset may be NULL to discard the result.

◆ lance_dataset_write_uncommitted_stream()

LANCE_API int32_t lance_dataset_write_uncommitted_stream ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceUncommittedWriteOptions * options,
const char *const * storage_opts,
const LanceSession * session,
LanceTransaction ** out_transaction )

Write an Arrow stream as uncommitted Lance data files and return the owned native transaction that would publish it.

Maps to InsertBuilder::execute_uncommitted_stream. The stream is consumed on every return path except a NULL stream pointer. schema is borrowed; the caller releases it after this call. The stream schema must match.

options may be NULL for native writer defaults. storage_opts uses the normal NULL-terminated key/value format. session may be NULL; a non-NULL session is retained by native derived values. Write mode, dataset existence, schema compatibility and create/append/overwrite normalization follow the selected core.

On success *out_transaction receives an independently owned handle. On error it remains unchanged. Data files already written by a failed call remain uncommitted; this API performs no rollback or cleanup policy.

Returns
0 on success, -1 on error.

◆ lance_dataset_write_uncommitted_stream_with_accessor()

LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_accessor ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceUncommittedWriteOptions * options,
const LanceStorageOptionsAccessor * storage_options_accessor,
const LanceSession * session,
LanceTransaction ** out_transaction )

Same as lance_dataset_write_uncommitted_stream but attaches a native dynamic storage-options accessor for data-file writes performed by this call. The returned transaction carries transaction metadata only and does not retain the accessor; pass the accessor again to the later commit when commit I/O needs dynamic storage options. A NULL accessor uses native defaults. All stream, validation and output semantics match the static-options entry point.

◆ lance_dataset_write_uncommitted_stream_with_commit_lock()

LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_commit_lock ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceUncommittedWriteOptions * options,
const LanceStorageOptionsAccessor * storage_accessor,
const LanceSession * session,
const LanceCommitLock * commit_lock,
LanceTransaction ** out_transaction )

Stage an Arrow stream into uncommitted data files through a foreign commit lock and an optional dynamic storage-options accessor.

Staging uses the accessor Arc and optional session exactly like lance_dataset_write_uncommitted_stream. The lock is retained for this call while native writes data files. The returned transaction carries metadata; keep the lock handle alive and pass it to the matching commit entry point. NULL handles keep native defaults.

Stream consumption, schema matching and out_transaction success-only output match lance_dataset_write_uncommitted_stream.

Returns
0 on success, -1 on error

◆ lance_dataset_write_uncommitted_stream_with_native_options()

LANCE_API int32_t lance_dataset_write_uncommitted_stream_with_native_options ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceNativeWriteOptions * options,
LanceTransaction ** out_transaction )

Stage an Arrow stream with an owned native-backed options handle.

options == NULL selects native WriteParams::default(). The handle supplies session, storage accessor, commit lock, base placement, blob policy, file-writer options and progress callbacks. The stream is consumed on every return path except a NULL stream.

The returned transaction owns metadata and uncommitted data-file references. It does not retain the options handle, its session, accessor or commit lock; pass those to the later commit entry point when commit I/O needs them. Publication naming remains controlled by the commit entry point's LanceCommitOptions. Returns 0 on success, -1 on error; a failed stage is guaranteed not to publish a version.

◆ lance_dataset_write_with_accessor()

LANCE_API int32_t lance_dataset_write_with_accessor ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceStorageOptionsAccessor * storage_options_accessor,
LanceDataset ** out_dataset )

Same as lance_dataset_write but attaches a native dynamic storage-options accessor instead of static storage_opts. The returned dataset retains the accessor and provider; later I/O follows native refresh, error and cache semantics. A NULL accessor uses native defaults. Static options belong in the accessor's initial options. This entry point keeps the legacy 20-version / 14-day auto-cleanup policy.

◆ lance_dataset_write_with_native_options()

LANCE_API int32_t lance_dataset_write_with_native_options ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceNativeWriteOptions * options,
LanceDataset ** out_dataset )

Write with an owned native-backed options handle.

options == NULL selects native WriteParams::default(). The handle supplies every native dataset-write option, including session, storage accessor, commit lock, base placement, blob policy, file-writer options and progress callbacks. The stream is consumed on every return path except a NULL stream. out_dataset follows the same success-only contract as lance_dataset_write. Returns 0 on success, -1 on error.

◆ lance_dataset_write_with_options()

LANCE_API int32_t lance_dataset_write_with_options ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteOptions * options,
const char *const * storage_opts,
LanceDataset ** out_dataset )

Same as lance_dataset_write but selects native WriteParams defaults instead of the legacy 20-version / 14-day policy.

Pass options = NULL to use a zero-initialized LanceWriteOptions, which is equivalent to WriteParams::default(): auto_cleanup = NULL (None) and skip_auto_cleanup = false.

On an existing dataset, auto_cleanup is written only by CREATE; APPEND and OVERWRITE leave the persisted policy unchanged. An explicit NULL auto_cleanup on an existing manifest therefore does not delete stored cleanup configuration.

The stream is consumed on every return path except a NULL stream. out_dataset follows the same contract as lance_dataset_write.

Returns
0 on success, -1 on error. Error codes match lance_dataset_write. Invalid auto-cleanup values also return LANCE_ERR_INVALID_ARGUMENT.

◆ lance_dataset_write_with_options_and_accessor()

LANCE_API int32_t lance_dataset_write_with_options_and_accessor ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteOptions * options,
const LanceStorageOptionsAccessor * storage_options_accessor,
LanceDataset ** out_dataset )

Same as lance_dataset_write_with_options but attaches a native dynamic storage-options accessor instead of static storage_opts. The accessor is retained by the returned dataset. A NULL accessor uses native defaults. options may be NULL to select native WriteParams::default().

◆ lance_dataset_write_with_options_with_commit_lock()

LANCE_API int32_t lance_dataset_write_with_options_with_commit_lock ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteOptions * options,
const LanceStorageOptionsAccessor * storage_accessor,
const LanceSession * session,
const LanceCommitLock * commit_lock,
LanceDataset ** out_dataset )

Same as lance_dataset_write_with_options but composes with a foreign commit lock and an optional dynamic storage-options accessor.

A non-NULL storage_accessor forwards its native accessor owner; NULL, or an accessor without an inner owner, selects native omission. A non-NULL commit_lock replaces the URI-derived handler; NULL keeps the native default. session may be NULL. The committed dataset retains both owners after this call returns.

The stream is consumed on every return path except a NULL stream. out_dataset follows the same success-only contract as lance_dataset_write_with_options.

Returns
0 on success, -1 on error

◆ lance_dataset_write_with_params()

LANCE_API int32_t lance_dataset_write_with_params ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteParams * params,
const char *const * storage_opts,
LanceDataset ** out_dataset )

Same as lance_dataset_write but takes a LanceWriteParams for tuning the output shape. Pass params = NULL to use defaults (equivalent to calling lance_dataset_write directly).

This legacy entry point keeps the documented 20-version / 14-day auto-cleanup policy. Use lance_dataset_write_with_options for native WriteParams defaults.

Returns
0 on success, -1 on error. See lance_dataset_write for the error code list; invalid data_storage_version also returns LANCE_ERR_INVALID_ARGUMENT.

◆ lance_dataset_write_with_params_and_accessor()

LANCE_API int32_t lance_dataset_write_with_params_and_accessor ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
int32_t mode,
const LanceWriteParams * params,
const LanceStorageOptionsAccessor * storage_options_accessor,
LanceDataset ** out_dataset )

Same as lance_dataset_write_with_params but attaches a native dynamic storage-options accessor instead of static storage_opts. The accessor is retained by the returned dataset. A NULL accessor uses native defaults. This entry point keeps the legacy 20/14 auto-cleanup policy.

◆ lance_dedicated_blob_writer_blob_id()

LANCE_API uint32_t lance_dedicated_blob_writer_blob_id ( const LanceDedicatedBlobWriter * writer)

Return the native dedicated writer blob ID.

Returns 0 and sets the thread-local error for a NULL, finished, or otherwise invalid handle.

◆ lance_dedicated_blob_writer_close()

LANCE_API void lance_dedicated_blob_writer_close ( LanceDedicatedBlobWriter * writer)

Free a dedicated writer allocation. NULL is a no-op. Close never calls native finish.

◆ lance_dedicated_blob_writer_finish_array()

LANCE_API int32_t lance_dedicated_blob_writer_finish_array ( LanceDedicatedBlobWriter * writer,
const char * field_name,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Consume the native dedicated writer and export its prepared descriptor parts.

The success result has exactly one Dedicated row covering the concatenated payload, including size zero. Preflight, consumption, output ownership, and error handling match the packed finish.

Returns
0 on success, -1 on error.

◆ lance_dedicated_blob_writer_path()

LANCE_NODISCARD LANCE_API const char * lance_dedicated_blob_writer_path ( const LanceDedicatedBlobWriter * writer)

Return a library-allocated copy of the native dedicated sidecar path.

Release the returned string with lance_free_string(). Returns NULL on error.

◆ lance_dedicated_blob_writer_write()

LANCE_API int32_t lance_dedicated_blob_writer_write ( LanceDedicatedBlobWriter * writer,
const uint8_t * data,
size_t len )

Append bytes to the dedicated sidecar.

Repeated writes concatenate. data == NULL && len == 0 is valid; a NULL data pointer with non-zero len is rejected before native invocation.

Returns
0 on success, -1 on error.

◆ lance_delimited_list_close()

LANCE_API void lance_delimited_list_close ( LanceDelimitedList * list)

◆ lance_delimited_list_common_prefix_at()

LANCE_NODISCARD LANCE_API const char * lance_delimited_list_common_prefix_at ( const LanceDelimitedList * list,
size_t index )

◆ lance_delimited_list_common_prefix_count()

LANCE_API uint64_t lance_delimited_list_common_prefix_count ( const LanceDelimitedList * list)

◆ lance_delimited_list_object_at()

LANCE_NODISCARD LANCE_API const char * lance_delimited_list_object_at ( const LanceDelimitedList * list,
size_t index )

◆ lance_delimited_list_object_count()

LANCE_API uint64_t lance_delimited_list_object_count ( const LanceDelimitedList * list)

◆ LANCE_DEPRECATED()

LANCE_DEPRECATED ( "Use lance_dataset_prepare_fts_match_query() to select the Match operator explicitly" ) const

Prepare an OR Match query context for one column.

Deprecated
Use lance_dataset_prepare_fts_match_query() to select the Match operator explicitly. This compatibility API is equivalent to LANCE_FTS_MATCH_OPERATOR_OR.

◆ lance_file_metadata_close()

LANCE_API void lance_file_metadata_close ( LanceFileMetadata * metadata)

◆ lance_file_metadata_get_columns()

LANCE_API int32_t lance_file_metadata_get_columns ( const LanceFileMetadata * metadata,
const LanceColumnMetadata ** out_columns,
size_t * out_count )

◆ lance_file_metadata_get_global_buffers()

LANCE_API int32_t lance_file_metadata_get_global_buffers ( const LanceFileMetadata * metadata,
const LanceBufferDescriptor ** out_buffers,
size_t * out_count )

◆ lance_file_metadata_get_info()

LANCE_API int32_t lance_file_metadata_get_info ( const LanceFileMetadata * metadata,
LanceFileMetadataInfo * out_info )

◆ lance_file_metadata_get_schema()

LANCE_API int32_t lance_file_metadata_get_schema ( const LanceFileMetadata * metadata,
struct ArrowSchema * out_schema )

◆ lance_file_reader_close()

LANCE_API void lance_file_reader_close ( LanceFileReader * reader)

◆ lance_file_reader_get_io_stats()

LANCE_API int32_t lance_file_reader_get_io_stats ( const LanceFileReader * reader,
LanceScanStats * out_stats )

◆ lance_file_reader_get_metadata()

LANCE_API int32_t lance_file_reader_get_metadata ( const LanceFileReader * reader,
LanceFileMetadata ** out_metadata )

◆ lance_file_reader_get_statistics()

LANCE_API int32_t lance_file_reader_get_statistics ( const LanceFileReader * reader,
LanceFileStatistics ** out_statistics )

◆ lance_file_reader_num_rows()

LANCE_API int32_t lance_file_reader_num_rows ( const LanceFileReader * reader,
uint64_t * out_rows )

◆ lance_file_reader_open()

LANCE_NODISCARD LANCE_API LanceFileReader * lance_file_reader_open ( const char * uri_or_path,
const LanceStorageOptionsAccessor * storage_options,
const LanceFileReaderOptions * options,
const LanceSession * session,
const LanceSchedulerConfig * scheduler_config )

◆ lance_file_reader_read_all()

LANCE_API int32_t lance_file_reader_read_all ( const LanceFileReader * reader,
uint32_t batch_size,
uint32_t batch_readahead,
struct ArrowArrayStream * out )

Stream all rows as Arrow C Data.

batch_size and batch_readahead must both be greater than zero. A zero value is rejected with LANCE_ERR_INVALID_ARGUMENT and does not select a default. On error, out is unchanged.

◆ lance_file_reader_read_global_buffer()

LANCE_API int32_t lance_file_reader_read_global_buffer ( const LanceFileReader * reader,
uint32_t index,
LanceByteBuffer ** out_bytes )

◆ lance_file_reader_read_indices()

LANCE_API int32_t lance_file_reader_read_indices ( const LanceFileReader * reader,
const uint32_t * indices,
size_t count,
uint32_t batch_size,
uint32_t batch_readahead,
struct ArrowArrayStream * out )

Stream native u32 row indices in the supplied order.

indices may be NULL only when count is zero. batch_size and batch_readahead must both be greater than zero. A zero value is rejected with LANCE_ERR_INVALID_ARGUMENT and does not select a default. On error, out is unchanged.

◆ lance_file_reader_read_range()

LANCE_API int32_t lance_file_reader_read_range ( const LanceFileReader * reader,
uint64_t offset,
uint64_t num_rows,
uint32_t batch_size,
uint32_t batch_readahead,
struct ArrowArrayStream * out )

Stream a checked native row range.

batch_size and batch_readahead must both be greater than zero. A zero value is rejected with LANCE_ERR_INVALID_ARGUMENT and does not select a default. The range is validated before the stream options. On error, out is unchanged.

◆ lance_file_session_base_path()

LANCE_NODISCARD LANCE_API const char * lance_file_session_base_path ( const LanceFileSession * session)

Release the returned string with lance_free_string().

◆ lance_file_session_close()

LANCE_API void lance_file_session_close ( LanceFileSession * session)

◆ lance_file_session_contains()

LANCE_API int32_t lance_file_session_contains ( const LanceFileSession * session,
const char * relative_path,
int32_t * out_exists )

◆ lance_file_session_delete_file()

LANCE_API int32_t lance_file_session_delete_file ( const LanceFileSession * session,
const char * relative_path )

◆ lance_file_session_download_file()

LANCE_API int32_t lance_file_session_download_file ( const LanceFileSession * session,
const char * relative_remote_path,
const char * local_path )

Download through the native local writer. It publishes the destination only after the source stream completes, including when both paths alias one file.

◆ lance_file_session_get_registry_stats()

LANCE_API int32_t lance_file_session_get_registry_stats ( const LanceFileSession * session,
LanceObjectStoreRegistryStats * out_stats )

◆ lance_file_session_get_scheduler_stats()

LANCE_API int32_t lance_file_session_get_scheduler_stats ( const LanceFileSession * session,
LanceScanStats * out_stats )

◆ lance_file_session_get_store_info()

LANCE_API int32_t lance_file_session_get_store_info ( const LanceFileSession * session,
LanceObjectStoreInfo * out_info )

◆ lance_file_session_get_store_io_stats()

LANCE_API int32_t lance_file_session_get_store_io_stats ( const LanceFileSession * session,
LanceObjectStoreIoStats * out_stats )

◆ lance_file_session_list()

LANCE_NODISCARD LANCE_API LancePathList * lance_file_session_list ( const LanceFileSession * session,
const char * relative_path )

◆ lance_file_session_list_with_delimiter()

LANCE_NODISCARD LANCE_API LanceDelimitedList * lance_file_session_list_with_delimiter ( const LanceFileSession * session,
const char * relative_path )

◆ lance_file_session_new()

LANCE_NODISCARD LANCE_API LanceFileSession * lance_file_session_new ( const char * base_uri,
const LanceStorageOptionsAccessor * storage_options,
const LanceSession * session,
const LanceSchedulerConfig * scheduler_config )

Create a raw-file session over base_uri.

storage_options may be NULL. session may be NULL; otherwise the session's existing object-store registry is shared. scheduler_config may be NULL, which uses native SchedulerConfig::max_bandwidth for the resolved store.

◆ lance_file_session_open_dedicated_blob_writer()

LANCE_NODISCARD LANCE_API LanceDedicatedBlobWriter * lance_file_session_open_dedicated_blob_writer ( const LanceFileSession * session,
const char * data_file_path,
uint32_t blob_id )

Open a native dedicated blob writer through an existing raw-file session.

Path derivation and ownership match the packed constructor. Returns NULL on error.

◆ lance_file_session_open_packed_blob_writer()

LANCE_NODISCARD LANCE_API LancePackedBlobWriter * lance_file_session_open_packed_blob_writer ( const LanceFileSession * session,
const char * data_file_path,
uint32_t blob_id )

Open a native packed blob writer through an existing raw-file session.

data_file_path is relative to the session base. Native validates the .lance suffix, derives the sidecar path, and rejects blob ID zero. The writer retains the session's native object store; closing the session, accessor, or provider does not invalidate the writer.

Callers choose unique data-file names and blob IDs. No collision check or ID allocation is added by the binding. Returns NULL on error.

◆ lance_file_session_open_reader()

LANCE_NODISCARD LANCE_API LanceFileReader * lance_file_session_open_reader ( const LanceFileSession * session,
const char * relative_path,
const LanceFileReaderOptions * options )

◆ lance_file_session_open_writer()

LANCE_NODISCARD LANCE_API LanceFileWriter * lance_file_session_open_writer ( const LanceFileSession * session,
const char * relative_path,
const struct ArrowSchema * schema,
const LanceFileWriterOptions * options )

◆ lance_file_session_read_range()

LANCE_NODISCARD LANCE_API LanceByteBuffer * lance_file_session_read_range ( const LanceFileSession * session,
const char * relative_path,
uint64_t offset,
uint64_t length )

◆ lance_file_session_upload_file()

LANCE_API int32_t lance_file_session_upload_file ( const LanceFileSession * session,
const char * local_path,
const char * relative_remote_path )

◆ lance_file_statistics_close()

LANCE_API void lance_file_statistics_close ( LanceFileStatistics * statistics)

◆ lance_file_statistics_get_columns()

LANCE_API int32_t lance_file_statistics_get_columns ( const LanceFileStatistics * statistics,
const LanceColumnStatistics ** out_columns,
size_t * out_count )

◆ lance_file_writer_abort()

LANCE_API int32_t lance_file_writer_abort ( LanceFileWriter * writer)

Call native FileWriter::abort.

Native v2.x abort bodies are currently empty. Allocation close drops the native writer, which owns remaining object-writer cleanup. This call does not implicitly destroy the allocation, and repeated calls are forwarded.

◆ lance_file_writer_add_global_buffer()

LANCE_API int32_t lance_file_writer_add_global_buffer ( LanceFileWriter * writer,
const uint8_t * data,
size_t len,
uint32_t * out_index )

◆ lance_file_writer_add_schema_metadata()

LANCE_API int32_t lance_file_writer_add_schema_metadata ( LanceFileWriter * writer,
const char * key,
const char * value )

◆ lance_file_writer_close()

LANCE_API void lance_file_writer_close ( LanceFileWriter * writer)

Destroy the writer allocation.

Native drop performs object-writer cleanup. This is not a successful finalization and does not replace an explicit fallible finish.

◆ lance_file_writer_finish()

LANCE_API int32_t lance_file_writer_finish ( LanceFileWriter * writer,
LanceFileWriteSummary * out_summary )

Finish the file.

Native mutable state and errors are forwarded directly. Repeated finish, writes after finish or abort, and failures retain the selected core's behavior; this binding does not add terminal-state rejection.

◆ lance_file_writer_open()

LANCE_NODISCARD LANCE_API LanceFileWriter * lance_file_writer_open ( const char * uri_or_path,
const struct ArrowSchema * schema,
const LanceFileWriterOptions * options,
const LanceStorageOptionsAccessor * storage_options,
const LanceSession * session )

◆ lance_file_writer_write_batch()

LANCE_API int32_t lance_file_writer_write_batch ( LanceFileWriter * writer,
const LanceBatch * batch )

Write one borrowed LanceBatch. The writer may clone its Arrow arrays.

◆ lance_fragment_add_columns_batch_udf()

LANCE_API int32_t lance_fragment_add_columns_batch_udf ( const LanceFragment * fragment,
const LanceBatchUDF * udf,
const char *const * read_columns,
const uint32_t * batch_size,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Add columns through a borrowed BatchUDF declaration.

The mapper, all four checkpoint callbacks, output-schema ownership and block_in_place behavior are shared with the dataset add-columns path. read_columns == NULL maps to native None; a non-NULL NULL-terminated array maps to Some, including an immediately terminated empty array. batch_size == NULL maps to None; zero remains Some(0).

Callback contexts remain borrowed until this synchronous call returns. Callbacks may read through independent dataset handles or existing snapshots; they must not use a closed handle. Both outputs are success-only.

Returns
0 on success, -1 on error.

◆ lance_fragment_add_columns_batch_udf_v2()

LANCE_API int32_t lance_fragment_add_columns_batch_udf_v2 ( const LanceFragment * fragment,
const LanceBatchUDFV2 * udf,
const char *const * read_columns,
const uint32_t * batch_size,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Add columns through a schema-aware borrowed BatchUDF declaration.

Identical to lance_fragment_add_columns_batch_udf except that batch checkpoints are restored from an owned ArrowArray plus the schema that carries native schema metadata. The original entry remains ABI-stable and honestly rejects markerless batch hits through native validation.

Both outputs are success-only. The output slots are unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_add_columns_nulls()

LANCE_API int32_t lance_fragment_add_columns_nulls ( const LanceFragment * fragment,
const struct ArrowSchema * columns,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Add all-null columns described by a borrowed Arrow schema.

This maps to NewColumnTransform::AllNulls. The Arrow schema supplies the logical new-column definitions; Native allocates new field identities and returns the complete final native schema. The schema is borrowed and its release callback is never called.

On success both outputs are written and own detached fragment metadata plus the complete native final schema. Both output slots are unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_add_columns_sql()

LANCE_API int32_t lance_fragment_add_columns_sql ( const LanceFragment * fragment,
const LanceSqlColumn * columns,
size_t column_count,
const uint32_t * batch_size,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Add columns computed from SQL expressions to one bound fragment.

This calls Native FileFragment::add_columns with NewColumnTransform::SqlExpressions. columns is borrowed and copied; a NULL array is accepted only when column_count == 0. Native validates the expressions, names, schema and row alignment.

batch_size == NULL maps to native None; a non-NULL pointer is forwarded as Some(value), including zero.

On success both outputs are written and own detached fragment metadata plus the complete native final schema. A detached input fragment returns LANCE_ERR_NOT_SUPPORTED. Both output slots are unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_add_columns_stream()

LANCE_API int32_t lance_fragment_add_columns_stream ( const LanceFragment * fragment,
struct ArrowArrayStream * stream,
const uint32_t * batch_size,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Add columns read from an Arrow stream with Native Reader semantics.

This follows Python's fragment add_columns_from_reader mapping: the native read_columns argument is None. A non-NULL stream is consumed exactly once on every return path after ownership transfer. batch_size == NULL maps to native None; a non-NULL pointer is forwarded as Some(value), including zero. Both outputs are success-only and contain detached fragment metadata plus the complete native final schema.

Returns
0 on success, -1 on error.

◆ lance_fragment_array_free()

LANCE_API void lance_fragment_array_free ( LanceFragment ** fragments,
size_t count )

Close every non-NULL fragment in an array from lance_fragment_create_many, then release the array allocation. NULL-safe. count must be the count returned by create_many; slots already cleared by a wrapper are skipped.

◆ lance_fragment_close()

LANCE_API void lance_fragment_close ( LanceFragment * fragment)

Close and free a fragment handle. Safe to call with NULL.

◆ lance_fragment_count_rows()

LANCE_API int32_t lance_fragment_count_rows ( const LanceFragment * fragment,
const char * filter,
uint64_t * out_rows )

Count this fragment's rows, optionally applying a native SQL filter.

NULL calls Native FileFragment::count_rows(None). A non-NULL string, including an empty string, is passed as Some(filter) without binding-side pruning; Native validation and errors are preserved.

Parameters
fragmentFragment snapshot. Must not be NULL.
filterSQL filter expression, or NULL for no filter.
out_rowsReceives the count on success; unchanged on failure.
Returns
0 on success, -1 on error.

◆ lance_fragment_create()

LANCE_API int32_t lance_fragment_create ( const char * dataset_uri,
uint64_t fragment_id,
const LanceFragmentCreateOptions * options,
struct ArrowArrayStream * stream,
LanceFragment ** out_fragment )

Create one fragment at dataset_uri without publishing a version.

Maps to native FragmentCreateBuilder::write(source, Some(fragment_id)). Native code owns schema inference and compatibility, file format selection, the physical row count and all error semantics. A non-empty input is required; an empty stream fails with the native "Input data was empty." error. The native API accepts any fragment_id, including IDs already used by existing metadata; duplicate detection happens at commit time. Non-NULL URI strings, including empty strings, are interpreted by native code. Native schema validation precedes target storage creation.

The stream is consumed on every return path except a NULL stream pointer, including validation failures and a NULL output slot. Passing a NULL stream is an invalid argument and leaves it untouched.

On success *out_fragment receives an independently owned detached metadata handle that remains valid after the dataset, schema and session handles are closed. Closing the handle never deletes the written data file. The output is written only on success.

Returns
0 on success, -1 on error. Errors include LANCE_ERR_INVALID_ARGUMENT (NULL stream/uri/output, invalid mode, empty input), native schema mismatches, storage errors and commit-less I/O failures.

◆ lance_fragment_create_from_file()

LANCE_API int32_t lance_fragment_create_from_file ( const LanceDataset * dataset,
const char * filename,
uint64_t fragment_id,
const uint64_t * physical_rows,
LanceFragment ** out_fragment )

Create one fragment from an existing Lance data file.

Maps to native FileFragment::create_from_file(filename, dataset_snapshot, fragment_id as usize, physical_rows). filename is relative to the dataset's data directory and keeps native file-version, schema compatibility and physical-row validation. Non-NULL filenames, including empty strings, are passed through unchanged. physical_rows == NULL maps to native None; a pointer to zero maps to Some(0), which the current native format may ignore. Values that do not fit the native usize are rejected.

Native validates the file schema against the dataset snapshot, so a file whose stored schema is a physical representation that the native version cannot project to the dataset schema is rejected. Blob v2 data files are one such case: they store descriptor columns where the dataset schema has blob.uri and blob.data, and both the native and the C entry points report the same schema-mismatch error for them.

The dataset handle supplies the target snapshot and is not modified. The output owns complete detached metadata and remains valid after the dataset is closed; it is written only on success. Closing the handle never deletes the file.

Returns
0 on success, -1 on error.

◆ lance_fragment_create_many()

LANCE_API int32_t lance_fragment_create_many ( const char * dataset_uri,
const LanceFragmentCreateOptions * options,
struct ArrowArrayStream * stream,
LanceFragment *** out_fragments,
size_t * out_count )

Create zero or more fragments without publishing a version.

Maps to native FragmentCreateBuilder::write_fragments. Native max_rows_per_file splitting, fragment ID assignment, file format and schema handling apply; the binding implements no splitting of its own.

The stream follows the same consumption contract as lance_fragment_create, and both output slots are written only on success. On success *out_fragments is a library-allocated array of *out_count independently owned detached handles. Release it with lance_fragment_array_free(*out_fragments, *out_count), which closes every remaining non-NULL element. A successful empty result writes NULL and 0.

Returns
0 on success, -1 on error.

◆ lance_fragment_data_file_at()

LANCE_API int32_t lance_fragment_data_file_at ( const LanceFragment * fragment,
size_t index,
LanceDataFile ** out_file )

Clone one native base data file from the fragment metadata.

index addresses the native Fragment::files array. The returned handle owns an independent copy and must be closed with lance_data_file_close().

Returns
0 on success, -1 on error. A missing index sets LANCE_ERR_INVALID_ARGUMENT; *out_file is unchanged on error.

◆ lance_fragment_data_file_count()

LANCE_API uint64_t lance_fragment_data_file_count ( const LanceFragment * fragment)

Return the number of Native base data files in the fragment. Overlay files and the deletion file are not included. Returns 0 and sets an error on a NULL handle.

◆ lance_fragment_data_file_for_field()

LANCE_API int32_t lance_fragment_data_file_for_field ( const LanceFragment * fragment,
int32_t field_id,
LanceDataFile ** out_file )

Find the native base data file that stores a field ID.

Bound handles use Native FileFragment::data_file_for_field; detached handles use the same fields membership rule on owned metadata. A missing field succeeds with *out_file == NULL; a negative field ID or NULL output slot is an invalid argument. The returned handle is independent and must be closed with lance_data_file_close().

Returns
0 on success, -1 on error; the output slot is unchanged on error.

◆ lance_fragment_delete()

LANCE_API int32_t lance_fragment_delete ( const LanceFragment * fragment,
const char * predicate,
LanceFragment ** out_fragment )

Delete rows from this fragment snapshot without publishing a transaction.

This calls native FileFragment::delete. The input fragment is borrowed and internally cloned, so it remains usable on every return path. The deletion file, when needed, is written during this call. The dataset manifest changes when the caller publishes the returned metadata in a Delete transaction.

On success, out_fragment receives:

  • a new independently owned fragment with the updated deletion-file metadata when some rows remain;
  • NULL when every row was deleted.

out_fragment is written only on success; it is unchanged on error. The returned fragment owns its dataset snapshot and can be scanned, taken, counted, closed, or used to build a Delete operation independently of the source dataset. A staged scanner reads the new deletion file before publication. A no-op predicate returns the original fragment metadata.

predicate must be non-NULL UTF-8 SQL. An empty string and all predicate semantics are passed to native Lance without binding-side pruning.

Parameters
fragmentFragment snapshot. Must not be NULL.
predicateSQL predicate. Must not be NULL.
out_fragmentReceives the fragment or NULL on success. Must not be NULL.
Returns
0 on success, -1 on error.

◆ lance_fragment_delete_rows()

LANCE_API int32_t lance_fragment_delete_rows ( const LanceFragment * fragment,
const uint32_t * offsets,
size_t offset_count,
LanceFragment ** out_fragment )

Add physical row offsets to a clone of one bound fragment.

Offsets are forwarded unchanged to Native FileFragment::extend_deletions. No binding-side range, sort, duplicate or full-deletion policy is added. The source handle remains usable. On success a partial deletion returns an independently owned bound fragment and a full deletion returns NULL. The output slot is unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_deleted_rows()

LANCE_API int32_t lance_fragment_deleted_rows ( const LanceFragment * fragment,
uint64_t * out_rows )

Read the deleted-row count.

Calls FileFragment::count_deletions(), which may load the deletion vector when its count is not cached in the manifest. Native errors propagate.

Parameters
fragmentFragment snapshot.
out_rowsReceives the count on success; unchanged on failure.
Returns
0 on success, -1 on error (including NULL fragment/out_rows).

◆ lance_fragment_id()

LANCE_API uint64_t lance_fragment_id ( const LanceFragment * fragment)

Return the fragment ID. Returns 0 and sets LANCE_ERR_INVALID_ARGUMENT on a NULL handle.

◆ lance_fragment_is_bound()

LANCE_API int32_t lance_fragment_is_bound ( const LanceFragment * fragment,
bool * out_is_bound )

Return whether this handle retains a dataset-bound native fragment.

Detached handles own only cloned native metadata, load no data files, and reject dataset-dependent reads with LANCE_ERR_NOT_SUPPORTED. The output slot is written only on success.

Returns
0 on success, -1 on error (including NULL fragment/out_is_bound).

◆ lance_fragment_logical_rows()

LANCE_API int32_t lance_fragment_logical_rows ( const LanceFragment * fragment,
uint64_t * out_rows )

Read the logical row count.

Calls FileFragment::count_rows(None) directly; the binding does not subtract the deletion count itself. Native errors propagate.

Parameters
fragmentFragment snapshot.
out_rowsReceives the count on success; unchanged on failure.
Returns
0 on success, -1 on error (including NULL fragment/out_rows).

◆ lance_fragment_merge_columns()

LANCE_API int32_t lance_fragment_merge_columns ( const LanceFragment * fragment,
struct ArrowArrayStream * stream,
const char * left_on,
const char * right_on,
LanceFragment ** out_fragment,
LanceSchema ** out_schema )

Merge a right-hand Arrow stream into one bound fragment with a native join.

The bound fragment is cloned before Native FileFragment::merge_columns. Native owns left/right column validation, the left join, schema merge, nullability behavior and final field identities. A non-NULL stream is consumed exactly once.

On success both outputs are written and own detached fragment metadata plus the complete native final schema. Both output slots are unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_metadata_json()

LANCE_NODISCARD LANCE_API const char * lance_fragment_metadata_json ( const LanceFragment * fragment)

Serialize the Native fragment metadata as JSON.

The object is Lance's Fragment serialization. It includes base data files (path, field IDs, column indices, file version, size, base ID), overlays, deletion-file metadata, row-id/version metadata, and physical_rows. Optional unknown values remain null or omitted as Native serializes them; they are never replaced with zero.

The caller must free the returned string with lance_free_string(). Returns NULL and sets an error for a NULL handle or serialization failure.

◆ lance_fragment_new()

LANCE_NODISCARD LANCE_API LanceFragment * lance_fragment_new ( uint64_t fragment_id,
const LanceDataFile *const * data_files,
size_t data_file_count,
const uint64_t * physical_rows )

Construct detached native Fragment metadata.

Starts from native Fragment::new(fragment_id), clones each borrowed LanceDataFile in input order, and optionally sets the native physical_rows value. Deletion-file, overlay, row-ID and row-version metadata retain their native Fragment::new defaults. The binding does not infer or independently validate schema coverage or row counts; native commit remains authoritative for publication.

data_files may be NULL only when data_file_count == 0. A non-NULL array must contain only non-NULL handles. physical_rows is optional: NULL maps to native None, while a non-NULL value must fit the platform usize. A fragment_id of zero requests native commit-time allocation, matching the native Append contract.

The returned detached handle retains independent copies of the data-file metadata and may outlive those handles. It supports metadata inspection and operation construction but rejects dataset-bound reads. On success the caller closes it with lance_fragment_close(). Returns NULL on error.

◆ lance_fragment_overlay_writer_abort()

LANCE_API void lance_fragment_overlay_writer_abort ( LanceFragmentOverlayWriter * writer)

Abort an overlay writer.

Consumes the writer allocation and discards staged data best-effort. This is the native abort path, not a finish or publication. NULL-safe. No error is reported.

◆ lance_fragment_overlay_writer_close()

LANCE_API void lance_fragment_overlay_writer_close ( LanceFragmentOverlayWriter * writer)

Close an overlay writer without finishing or publishing it.

Consumes the writer allocation and drops the native writer, matching ordinary Rust drop. NULL-safe.

◆ lance_fragment_overlay_writer_finish()

LANCE_API int32_t lance_fragment_overlay_writer_finish ( LanceFragmentOverlayWriter * writer,
LanceDataOverlayGroup ** out_group )

Finish an overlay writer.

Consumes the writer allocation on every return, including errors. On success out_group receives an owned group, or NULL when the staged coverage was empty (native None). out_group is written only on success and a non-NULL result must be closed with lance_data_overlay_group_close. Returns 0 on success, -1 on error.

◆ lance_fragment_overlay_writer_new()

LANCE_API int32_t lance_fragment_overlay_writer_new ( const LanceFragment * fragment,
const LanceSchema * schema,
LanceFragmentOverlayWriter ** out_writer )

Open an overlay writer for a bound fragment.

The fragment must belong to a dataset (a detached fragment returns LANCE_ERR_NOT_SUPPORTED). The writer captures the fragment's current native snapshot and the supplied schema. The schema may be a subset of the dataset schema; native code owns field compatibility, row layout, type, nullability and range checks. Commit the resulting overlay with the dataset read version used to open this writer.

Native overlays are experimental. For release builds, set LANCE_ENABLE_UNSTABLE_DATA_OVERLAY_FILES=1 in every process that reads or modifies an overlay dataset. Enable it before publication so all readers recognize the manifest feature.

Parameters
fragmentBound fragment snapshot. Must not be NULL.
schemaNative fragment schema, or a compatible subset.
out_writerReceives the writer on success; unchanged on failure.
Returns
0 on success, -1 on error.

◆ lance_fragment_overlay_writer_write_batch()

LANCE_API int32_t lance_fragment_overlay_writer_write_batch ( LanceFragmentOverlayWriter * writer,
const LanceBatch * batch )

Write one batch of overlay values to a writer.

The batch is borrowed for the duration of the call and may be closed afterwards. Rows are keyed by _rowaddr; each covered cell supplies a dense value in ascending fragment-offset order. Native validation owns missing or nullable _rowaddr, repeated or descending offsets, wrong fragment, wrong types and out-of-range offsets.

Returns 0 on success, -1 on error.

◆ lance_fragment_physical_rows()

LANCE_API int32_t lance_fragment_physical_rows ( const LanceFragment * fragment,
uint64_t * out_rows )

Read the physical row count, including deleted rows.

Calls FileFragment::physical_rows(), which may perform data-file I/O when the manifest has no trustworthy cached count. Native errors propagate.

Parameters
fragmentFragment snapshot.
out_rowsReceives the count on success; unchanged on failure.
Returns
0 on success, -1 on error (including NULL fragment/out_rows).

◆ lance_fragment_read_version()

LANCE_API int32_t lance_fragment_read_version ( const LanceFragment * fragment,
uint64_t * out_version )

Return the dataset read version captured by a bound fragment.

This is the native snapshot version carried by the fragment's FileFragment. Pass it as the read version when committing fragment mutations through the generic transaction API. A detached metadata-only handle has no dataset snapshot and returns LANCE_ERR_NOT_SUPPORTED. The output slot is written only on success.

Returns
0 on success, -1 on error.

◆ lance_fragment_scan()

LANCE_NODISCARD LANCE_API LanceScanner * lance_fragment_scan ( const LanceFragment * fragment)

Start a scanner over the fragment's owned dataset snapshot.

This calls Native FileFragment::scan, which uses the ordinary scanner path with this fragment selected as the initial scan scope. The returned scanner follows the normal scanner lifecycle and configuration rules. It remains valid after the fragment and source dataset handles are closed.

Parameters
fragmentFragment snapshot. Must not be NULL.
Returns
Scanner handle, or NULL on error.

◆ lance_fragment_schema()

LANCE_API int32_t lance_fragment_schema ( const LanceFragment * fragment,
struct ArrowSchema * out )

Export the fragment's logical dataset schema via Arrow C Data Interface.

This is FileFragment::schema(), the logical dataset schema, not a physical file schema. out is caller-allocated and remains caller-owned; invoke its non-NULL release callback exactly once.

Returns
0 on success, -1 on error.

◆ lance_fragment_schema_clone()

LANCE_API int32_t lance_fragment_schema_clone ( const LanceFragment * fragment,
LanceSchema ** out_schema )

Clone the fragment's native logical dataset schema.

This is FileFragment::schema() from the fragment's staged snapshot, not a physical file schema. The clone preserves native field identities and metadata without an Arrow round trip and remains valid after the fragment is closed.

On success writes *out_schema and returns 0; on error the output slot is untouched.

◆ lance_fragment_take()

LANCE_API int32_t lance_fragment_take ( const LanceFragment * fragment,
const uint32_t * indices,
size_t num_indices,
const char *const * columns,
struct ArrowArrayStream * out )

Take fragment-local logical rows by index.

Indices address logical rows in this fragment after deletion vectors are resolved. They are not dataset _rowid values or physical row addresses. Indices are forwarded unchanged to native FileFragment::take. Deletion resolution, supported index ordering, duplicate handling, range validation, projection and JSON conversion follow the selected core. Lance 14.0.2's v2 decoder can reject unsorted or duplicate indices.

columns is a NULL-terminated array of UTF-8 column paths:

  • NULL selects the fragment's full logical schema.
  • A non-NULL array whose first entry is NULL is an explicit empty projection. Native take returns a zero-column batch whose row count is the requested number of rows. Missing top-level columns and non-UTF-8 names are errors; nested paths follow Native Schema::project semantics. indices may be NULL only when num_indices is zero.

On success out is initialized in caller-owned storage and must have its non-NULL release callback invoked exactly once. The stream owns its result and remains valid after the fragment and dataset handles are closed. Schema validation and native take errors are reported before the callbacks are exposed; deferred iteration and cleanup panics follow the existing guarded Arrow stream contract. out is unchanged on failure.

Parameters
fragmentFragment snapshot. Must not be NULL.
indicesFragment-local logical row indices.
num_indicesLength of indices; zero is a valid empty request.
columnsNULL-terminated projected column paths, or NULL for all.
outPointer to caller-allocated ArrowArrayStream.
Returns
0 on success, -1 on error.

◆ lance_fragment_update_columns()

LANCE_API int32_t lance_fragment_update_columns ( const LanceFragment * fragment,
struct ArrowArrayStream * stream,
const char * left_on,
const char * right_on,
LanceFragmentUpdateColumnsResult ** out_result )

Rewrite existing columns in one bound fragment through a native join.

This calls Native FileFragment::update_columns_with_offsets on a cloned bound fragment. The result owns complete updated fragment metadata, the native modified field IDs and the native RoaringBitmap of matched physical row offsets. A non-NULL stream is consumed exactly once.

On success *out_result receives an independently owned result. Close it with lance_fragment_update_columns_result_close. The output slot is unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_update_columns_result_close()

LANCE_API void lance_fragment_update_columns_result_close ( LanceFragmentUpdateColumnsResult * result)

Close an update-columns result. NULL-safe.

◆ lance_fragment_update_columns_result_fields_modified_at()

LANCE_API int32_t lance_fragment_update_columns_result_fields_modified_at ( const LanceFragmentUpdateColumnsResult * result,
size_t index,
uint32_t * out_field_id )

Read one modified field ID in native result order.

Returns
0 on success, -1 on error. The output is unchanged on error.

◆ lance_fragment_update_columns_result_fields_modified_count()

LANCE_API int32_t lance_fragment_update_columns_result_fields_modified_count ( const LanceFragmentUpdateColumnsResult * result,
uint64_t * out_count )

Read the number of modified field IDs.

Returns
0 on success, -1 on error.

◆ lance_fragment_update_columns_result_fragment()

LANCE_API int32_t lance_fragment_update_columns_result_fragment ( const LanceFragmentUpdateColumnsResult * result,
LanceFragment ** out_fragment )

Clone the updated fragment metadata into an independent handle.

The returned handle is detached and owns complete metadata. The output slot is written only on success.

Returns
0 on success, -1 on error.

◆ lance_fragment_update_columns_result_matched_offset_at()

LANCE_API int32_t lance_fragment_update_columns_result_matched_offset_at ( const LanceFragmentUpdateColumnsResult * result,
size_t index,
uint32_t * out_offset )

Read one matched physical row offset in stable bitmap order.

Values remain in their native u32 domain. For all offsets, prefer lance_fragment_update_columns_result_matched_offsets() to avoid restarting the bitmap traversal for each index.

Returns
0 on success, -1 on error. The output is unchanged on error.

◆ lance_fragment_update_columns_result_matched_offset_count()

LANCE_API int32_t lance_fragment_update_columns_result_matched_offset_count ( const LanceFragmentUpdateColumnsResult * result,
uint64_t * out_count )

Read the number of matched physical row offsets.

Returns
0 on success, -1 on error.

◆ lance_fragment_update_columns_result_matched_offsets()

LANCE_API int32_t lance_fragment_update_columns_result_matched_offsets ( const LanceFragmentUpdateColumnsResult * result,
uint32_t * out_offsets,
size_t count )

Copy all matched physical row offsets in one native bitmap traversal.

The caller owns out_offsets, with count writable uint32_t elements. count must equal the value written by lance_fragment_update_columns_result_matched_offset_count(). NULL out_offsets is valid for an empty result with count == 0. Values retain native bitmap order and remain valid after the result handle is closed.

Returns
0 on success, -1 on error. The output buffer is unchanged on error.

◆ lance_fragment_update_columns_result_matched_offsets_serialize()

LANCE_API int32_t lance_fragment_update_columns_result_matched_offsets_serialize ( const LanceFragmentUpdateColumnsResult * result,
uint8_t ** out_bytes,
size_t * out_len )

Serialize the matched offsets with the portable Roaring format.

This optional interoperability export is separate from typed Update construction. The malloc-compatible buffer is allocated on success and must be released with lance_free_bytes; a zero-length encoding yields NULL. Both outputs are unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_fragment_write_column_with_version()

LANCE_API int32_t lance_fragment_write_column_with_version ( const LanceFragment * fragment,
const LanceSchema * schema,
struct ArrowArrayStream * stream,
int32_t file_version,
LanceDataReplacementGroup ** out_group )

Stage a replacement data file using an explicit file-format version.

file_version uses the LanceFileFormatVersion discriminants: V1=0, V2_0=1, V2_1=2, V2_2=3, V2_3=4. Native write_column_with_version owns V1 rejection, V2 compatibility and all layout checks. Stream ownership and output behavior match lance_fragment_write_columns.

Returns
0 on success, -1 on error.

◆ lance_fragment_write_columns()

LANCE_API int32_t lance_fragment_write_columns ( const LanceFragment * fragment,
const LanceSchema * schema,
struct ArrowArrayStream * stream,
LanceDataReplacementGroup ** out_group )

Stage a replacement data file for existing fragment columns.

The native schema is borrowed and forwarded unchanged. The consumed Arrow stream must produce the fragment's physical rows, including deleted slots. Native owns file-version, schema/layout, Blob preparation, row-alignment and failure-cleanup behavior. On success *out_group receives an independently owned DataReplacementGroup; the output slot is unchanged on error.

Returns
0 on success, -1 on error.

◆ lance_free_bytes()

LANCE_API void lance_free_bytes ( uint8_t * bytes)

Free metadata bytes returned by an uncommitted segment build. NULL-safe.

◆ lance_fts_query_boolean_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_boolean_new ( const int32_t * occurs,
const LanceFtsQuery *const * queries,
size_t query_count )

Create an immutable Boolean query.

An empty clause list is accepted here and rejected by scan planning when the query has no positive clause. Both arrays must contain query_count entries unless the count is zero. Child query values are copied during construction.

Parameters
occursFixed-width LanceFtsOccur discriminants.
queriesChild query handles.
query_countNumber of entries in both arrays.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_boost_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_boost_new ( const LanceFtsQuery * positive,
const LanceFtsQuery * negative,
const LanceFtsBoostOptions * options )

Create an immutable Boost query from positive and negative child queries. Child query values are copied during construction. negative_boost is validated by scan planning.

Parameters
positivePositive child query. Must not be NULL.
negativeNegative child query. Must not be NULL.
optionsBoost options, or NULL for the native default.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_boost_options_init()

LANCE_API void lance_fts_query_boost_options_init ( LanceFtsBoostOptions * options)

Initialize Boost options with the native defaults. NULL-safe.

◆ lance_fts_query_close()

LANCE_API void lance_fts_query_close ( LanceFtsQuery * query)

Close a typed query handle. NULL-safe. Composite children and scanners that already attached this query retain their own cloned values.

◆ lance_fts_query_combined_fields_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_combined_fields_new ( const char * terms,
const char *const * columns,
size_t column_count,
const LanceFtsCombinedFieldsOptions * options )

Create an immutable CombinedFields (BM25F) query.

The target columns form one virtual field whose term statistics are blended. Native construction rejects an empty or duplicate column list and weights outside [1, 2^20].

Parameters
termsQuery text. May be empty. Must not be NULL.
columnsArray of unique column names. Must not be NULL when column_count is non-zero.
column_countNumber of entries in columns.
optionsCombinedFields options, or NULL for the native defaults.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_combined_fields_options_init()

LANCE_API void lance_fts_query_combined_fields_options_init ( LanceFtsCombinedFieldsOptions * options)

Initialize CombinedFields options with the native defaults. NULL-safe.

◆ lance_fts_query_context_close()

LANCE_API void lance_fts_query_context_close ( LanceFtsQueryContext * context)

Close a context handle. NULL-safe. Scanners that already attached this context retain shared ownership and remain valid.

◆ lance_fts_query_match_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_match_new ( const char * terms,
const char * column,
const LanceFtsMatchOptions * options )

Create an immutable Match query.

Parameters
termsQuery text. May be empty. Must not be NULL.
columnTarget column, or NULL to let scan planning resolve the indexed columns.
optionsMatch options, or NULL for the native defaults.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_match_options_init()

LANCE_API void lance_fts_query_match_options_init ( LanceFtsMatchOptions * options)

Initialize Match options with the native defaults. NULL-safe.

◆ lance_fts_query_multi_match_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_multi_match_new ( const char * terms,
const char *const * columns,
size_t column_count,
const LanceFtsMultiMatchOptions * options )

Create an immutable MultiMatch query.

Each target field is scored independently and the maximum field score is retained, matching the native best-fields behavior. Native construction rejects an empty column list. A provided boost list must contain exactly one entry per column; its values are validated by scan planning.

Parameters
termsQuery text. May be empty. Must not be NULL.
columnsArray of column names. Must not be NULL when column_count is non-zero.
column_countNumber of entries in columns.
optionsMultiMatch options, or NULL for the native defaults.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_multi_match_options_init()

LANCE_API void lance_fts_query_multi_match_options_init ( LanceFtsMultiMatchOptions * options)

Initialize MultiMatch options with the native defaults. NULL-safe.

◆ lance_fts_query_phrase_new()

LANCE_NODISCARD LANCE_API LanceFtsQuery * lance_fts_query_phrase_new ( const char * terms,
const char * column,
const LanceFtsPhraseOptions * options )

Create an immutable Phrase query.

The selected FTS index must store token positions; scan planning reports an error otherwise.

Parameters
termsQuery text. May be empty. Must not be NULL.
columnTarget column, or NULL to let scan planning resolve the indexed columns.
optionsPhrase options, or NULL for the native defaults.
Returns
Query handle on success, or NULL on error.

◆ lance_fts_query_phrase_options_init()

LANCE_API void lance_fts_query_phrase_options_init ( LanceFtsPhraseOptions * options)

Initialize Phrase options with the native defaults. NULL-safe.

◆ lance_fts_token_list_close()

LANCE_API void lance_fts_token_list_close ( LanceFtsTokenList * tokens)

Close and free a token list. Safe to call with NULL.

◆ lance_fts_token_list_count()

LANCE_API uint64_t lance_fts_token_list_count ( const LanceFtsTokenList * tokens)

Number of tokens in tokens. Returns 0 and sets an error for NULL.

◆ lance_fts_token_list_get()

LANCE_API int32_t lance_fts_token_list_get ( const LanceFtsTokenList * tokens,
size_t index,
LanceFtsTokenView * out )

Borrow token index into out. Returns 0 on success or -1 on a NULL handle/out pointer or an out-of-range index. out is written only on success. The view remains valid until the list is closed.

◆ lance_fts_tokenize()

LANCE_NODISCARD LANCE_API LanceFtsTokenList * lance_fts_tokenize ( const char * text,
size_t text_len,
const char * params_json )

Tokenize text with the native Lance inverted-index analyzer.

text is an explicit UTF-8 byte range, not a C string. It may contain embedded NUL bytes. text may be NULL only when text_len is 0; NULL with a nonzero length, invalid UTF-8, or an oversized length is rejected.

params_json is a NULL-terminated JSON document using native InvertedIndexParams fields and defaults. NULL selects the native defaults. Field presence, optional null values, analyzer selection, validation, and error messages come from the native deserializer and builder.

Returns an owned token list, or NULL on error. Free it with lance_fts_token_list_close. Query-token positions match native collect_query_tokens; there is no binding-side tokenizer or position algorithm.

◆ lance_index_build_rq_model()

LANCE_NODISCARD LANCE_API const char * lance_index_build_rq_model ( uint32_t dimension,
uint32_t num_bits )

Build a portable IVF_RQ fast-rotation model as native RabitQuantizationMetadata JSON.

dimension must be positive and divisible by 8. num_bits == 0 selects the native RQ default of 5. The returned JSON can be shared across fragment builds through LanceVectorIndexOptions.rabitq_model_json. Matrix rotations are not emitted because their dense matrix is skipped by the native JSON representation.

Returns a library-owned NUL-terminated string on success, or NULL on error. Free a successful result with lance_free_string().

◆ lance_index_segment_builder_execute_uncommitted()

LANCE_API int32_t lance_index_segment_builder_execute_uncommitted ( LanceIndexSegmentBuilder * builder,
uint8_t ** out_bytes,
size_t * out_len )

Build segment artifacts without committing them to the dataset manifest. The builder is single-use, including when execution fails.

On success, *out_bytes receives protobuf-encoded IndexMetadata and *out_len receives its byte length. Free the buffer with lance_free_bytes(). On error, the output slots are left unchanged.

Returns
0 on success, -1 on error.

◆ lance_index_segment_builder_free()

LANCE_API void lance_index_segment_builder_free ( LanceIndexSegmentBuilder * builder)

Free an index segment builder. NULL-safe.

◆ lance_index_segment_builder_new_scalar()

LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_scalar ( const LanceDataset * dataset,
const char * column,
const char * index_name,
int32_t index_type,
const char * params_json,
const LanceIndexSegmentBuildOptions * options )

Create a single-use scalar index segment builder bound to the dataset's current snapshot. The dataset handle is not consumed and need not outlive the returned builder.

Parameters
datasetOpen dataset whose current snapshot the builder binds to.
columnColumn name to index.
index_nameOptional index name; NULL selects the Lance default.
index_typeLanceScalarIndexType discriminant, passed as int32_t so out-of-range values can be rejected safely.
params_jsonOptional scalar-index JSON parameters, or NULL.
optionsOptional build options, or NULL for defaults.
Returns
Builder handle on success, or NULL on error.

◆ lance_index_segment_builder_new_scalar_with_options()

LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_scalar_with_options ( const LanceDataset * dataset,
const char * column,
const char * index_name,
int32_t index_type,
const char * params_json,
const LanceScalarIndexOptions * scalar_options,
const LanceIndexSegmentBuildOptions * options )

Create a scalar segment builder with the additive native train control. scalar_options == NULL or an unset has_train preserves native defaults.

◆ lance_index_segment_builder_new_vector()

LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_vector ( const LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexSegmentParams * params,
const LanceIndexSegmentBuildOptions * options )

Create a single-use vector index segment builder. Model arrays and schemas are borrowed synchronously; arrays may be replaced but remain live and caller-owned. When no model set is supplied, AUTO trains locally. PQ variants require both the IVF centroids and PQ codebook, or neither.

◆ lance_index_segment_builder_new_vector_with_options()

LANCE_NODISCARD LANCE_API LanceIndexSegmentBuilder * lance_index_segment_builder_new_vector_with_options ( const LanceDataset * dataset,
const char * column,
const char * index_name,
const LanceVectorIndexOptions * options,
const LanceVectorIndexSegmentScope * scope )

Create a single-use vector segment builder from additive native options. The builder owns a dataset snapshot. Strings, maps, paths, fragment IDs and UUID are copied; Arrow models are borrowed synchronously as described by LanceVectorIndexOptions. The dataset handle need not outlive the builder.

scope may be NULL for whole-dataset/no-UUID semantics. train follows the native builder default unless options->has_train is true. Training with supplied PQ codebooks and DOT requires full dataset coverage on the selected core. A strict subset returns LANCE_ERR_INVALID_ARGUMENT, preserving the legacy protection against incompatible PQ assignment. Definition-only builds with train set to false accept fragment subsets.

◆ lance_index_segment_builder_set_progress_callback()

LANCE_API int32_t lance_index_segment_builder_set_progress_callback ( LanceIndexSegmentBuilder * builder,
LanceIndexBuildProgressCallback callback,
void * callback_ctx )

Register the index-build progress callback for a segment builder.

Must be called before the builder is executed; the builder is single-use, so calling it after lance_index_segment_builder_execute_uncommitted has been called (even if that call failed) returns -1. callback must not be NULL. callback_ctx may be NULL and is passed through to the callback opaquely. Setting a callback replaces any previously set callback.

Invocations occur only while lance_index_segment_builder_execute_uncommitted is executing, and this is enforced rather than contractual: lance-c disables the callback and drains in-flight invocations through a retirement gate before that call returns, including on error, so a worker task detached by lance core on an error path can never invoke the callback afterwards. callback and callback_ctx must therefore remain valid and safe to invoke until lance_index_segment_builder_execute_uncommitted returns. See LanceIndexBuildProgressCallback for the full threading and lifetime contract.

Returns
0 on success, -1 on error.

◆ lance_index_segment_metadata_base_id()

LANCE_API int32_t lance_index_segment_metadata_base_id ( const LanceIndexSegmentMetadata * metadata,
bool * out_is_set,
uint32_t * out_base_id )

Read the optional native base_id.

On success, absent is reported with is_set == false and base_id == 0; present is reported with is_set == true. Both outputs are unchanged on error. Returns 0 on success, -1 on error.

◆ lance_index_segment_metadata_clone()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_metadata_clone ( const LanceIndexSegmentMetadata * metadata)

Clone parsed index metadata into an independent handle.

The clone copies the complete in-memory native value, including optional index details, fragment bitmap, created_at, base_id and files. It does not re-encode through protobuf, so an in-memory Some(empty) files vector remains distinct from None even though the protobuf decoder normalizes it. Returns NULL on error.

◆ lance_index_segment_metadata_clone_with_fragment_ids()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_metadata_clone_with_fragment_ids ( const LanceIndexSegmentMetadata * metadata,
bool has_fragment_ids,
const uint32_t * fragment_ids,
size_t fragment_count )

Clone parsed index metadata with caller-supplied fragment coverage.

When has_fragment_ids is false, the native fragment_bitmap option is copied unchanged and fragment_ids / fragment_count are ignored. When true, the clone's coverage becomes some of the caller's IDs: fragment_count == 0 maps to present-empty coverage, and a positive count requires fragment_ids to point at that many uint32_t values. IDs are copied into the native bitmap, which sorts them and treats them as a set.

Every other native field is copied exactly, including name, field and covering declarations, dataset/index versions, index details, created_at, base_id, and files, together with their in-memory option presence. This call performs no coverage, overlap, staleness, index-family, or file validation; those rules remain with the native commit path. The source handle is unchanged and remains usable.

Returns an independently owned handle, or NULL on error.

◆ lance_index_segment_metadata_covering_field_count()

LANCE_API size_t lance_index_segment_metadata_covering_field_count ( const LanceIndexSegmentMetadata * metadata)

Return the number of covering field IDs. Returns 0 on error; zero is also a valid count, so check lance_last_error_code().

◆ lance_index_segment_metadata_covering_field_id_at()

LANCE_API int32_t lance_index_segment_metadata_covering_field_id_at ( const LanceIndexSegmentMetadata * metadata,
size_t index,
int32_t * out_field_id )

Copy one covering field ID in metadata order. Returns 0 on success, -1 on error; *out_field_id is unchanged on error.

◆ lance_index_segment_metadata_created_at()

LANCE_API int32_t lance_index_segment_metadata_created_at ( const LanceIndexSegmentMetadata * metadata,
LanceOptionalTimestamp * out_timestamp )

Read the optional native created_at timestamp.

On success, absent is reported with is_set == false and zeroed fields; present is reported with is_set == true. The output is unchanged on error. Returns 0 on success, -1 on error.

◆ lance_index_segment_metadata_dataset_version()

LANCE_API uint64_t lance_index_segment_metadata_dataset_version ( const LanceIndexSegmentMetadata * metadata)

Return the dataset version against which the segment was built, or 0 on error (check lance_last_error_code()).

◆ lance_index_segment_metadata_encode()

LANCE_API int32_t lance_index_segment_metadata_encode ( const LanceIndexSegmentMetadata * metadata,
uint8_t ** out_bytes,
size_t * out_len )

Encode parsed index metadata as protobuf-encoded Lance IndexMetadata.

This explicitly serializes the complete in-memory native value. On success, *out_bytes receives a library-owned buffer of *out_len bytes that the caller frees with lance_free_bytes(). Both output slots are success-only and remain unchanged on error. Protobuf cannot distinguish some in-memory optionals, so encoding may normalize them (for example present-empty files decode as absent); cloning does not perform that normalization.

Returns 0 on success, -1 on error.

◆ lance_index_segment_metadata_field_count()

LANCE_API size_t lance_index_segment_metadata_field_count ( const LanceIndexSegmentMetadata * metadata)

Return the number of indexed field IDs. Returns 0 on error; zero may also be a valid count, so check lance_last_error_code().

◆ lance_index_segment_metadata_field_ids()

LANCE_API int32_t lance_index_segment_metadata_field_ids ( const LanceIndexSegmentMetadata * metadata,
int32_t * out_field_ids,
size_t capacity,
size_t * out_count )

Copy indexed field IDs in metadata order.

◆ lance_index_segment_metadata_file_count()

LANCE_API size_t lance_index_segment_metadata_file_count ( const LanceIndexSegmentMetadata * metadata)

Return the number of files recorded in the metadata. Returns 0 on error or when the native files option is absent; check lance_last_error_code() to distinguish.

◆ lance_index_segment_metadata_file_path_at()

LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_file_path_at ( const LanceIndexSegmentMetadata * metadata,
size_t index )

Return one recorded file path, borrowed from the metadata handle. Returns NULL on error, including an out-of-range index.

◆ lance_index_segment_metadata_file_size_at()

LANCE_API int32_t lance_index_segment_metadata_file_size_at ( const LanceIndexSegmentMetadata * metadata,
size_t index,
uint64_t * out_size )

Copy one recorded file size. Returns 0 on success, -1 on error; *out_size is unchanged on error.

◆ lance_index_segment_metadata_fragment_count()

LANCE_API size_t lance_index_segment_metadata_fragment_count ( const LanceIndexSegmentMetadata * metadata)

Return the number of fragment IDs covered by the segment. Returns 0 on error; zero may also be a valid count, so check lance_last_error_code().

◆ lance_index_segment_metadata_fragment_ids()

LANCE_API int32_t lance_index_segment_metadata_fragment_ids ( const LanceIndexSegmentMetadata * metadata,
uint32_t * out_fragment_ids,
size_t capacity,
size_t * out_count )

Copy covered fragment IDs in ascending order.

capacity is measured in uint32_t elements. out_count is required and receives the number written. out_fragment_ids may be NULL only when the metadata covers zero fragments.

◆ lance_index_segment_metadata_free()

LANCE_API void lance_index_segment_metadata_free ( LanceIndexSegmentMetadata * metadata)

Free parsed segment metadata. NULL-safe.

◆ lance_index_segment_metadata_index_details_type_url()

LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_index_details_type_url ( const LanceIndexSegmentMetadata * metadata)

Return the protobuf Any type URL, borrowed until metadata is freed. Returns NULL if metadata has no index_details.

◆ lance_index_segment_metadata_index_details_value()

LANCE_NODISCARD LANCE_API const uint8_t * lance_index_segment_metadata_index_details_value ( const LanceIndexSegmentMetadata * metadata,
size_t * out_len )

Return the borrowed native index_details.value bytes.

The pointer remains valid until the metadata handle is freed. A present but empty value returns a non-NULL pointer and writes *out_len = 0. Absent index details return NULL with LANCE_ERR_NOT_FOUND. *out_len is unchanged on error.

◆ lance_index_segment_metadata_index_type()

LANCE_API int32_t lance_index_segment_metadata_index_type ( const LanceIndexSegmentMetadata * metadata)

Return the LanceScalarIndexType/LanceVectorIndexType discriminant, or -1 on error. Both enum domains use the stable, non-overlapping values above.

◆ lance_index_segment_metadata_index_version()

LANCE_API int32_t lance_index_segment_metadata_index_version ( const LanceIndexSegmentMetadata * metadata)

Return the physical index version, or -1 on error.

◆ lance_index_segment_metadata_name()

LANCE_NODISCARD LANCE_API const char * lance_index_segment_metadata_name ( const LanceIndexSegmentMetadata * metadata)

Return the segment name. The string is borrowed from metadata and remains valid until lance_index_segment_metadata_free(); do not free it separately.

◆ lance_index_segment_metadata_parse()

LANCE_API int32_t lance_index_segment_metadata_parse ( const uint8_t * bytes,
size_t len,
LanceIndexSegmentMetadata ** out_metadata )

Parse protobuf-encoded IndexMetadata into an opaque metadata handle. bytes is borrowed only for this call. On error, *out_metadata is left unchanged.

◆ lance_index_segment_metadata_uuid()

LANCE_API int32_t lance_index_segment_metadata_uuid ( const LanceIndexSegmentMetadata * metadata,
uint8_t * out_uuid )

Copy the segment UUID into a caller-provided 16-byte buffer.

◆ lance_index_segment_result_close()

LANCE_API void lance_index_segment_result_close ( LanceIndexSegmentResult * result)

◆ lance_index_segment_result_from_json()

LANCE_NODISCARD LANCE_API LanceIndexSegmentResult * lance_index_segment_result_from_json ( const char * json)

◆ lance_index_segment_result_group()

LANCE_API uint32_t lance_index_segment_result_group ( const LanceIndexSegmentResult * result)

◆ lance_index_segment_result_json()

LANCE_NODISCARD LANCE_API const char * lance_index_segment_result_json ( const LanceIndexSegmentResult * result)

◆ lance_index_segment_result_plan_id()

LANCE_API int32_t lance_index_segment_result_plan_id ( const LanceIndexSegmentResult * result,
uint8_t out_uuid[16] )

◆ lance_index_segment_result_read_version()

LANCE_API uint64_t lance_index_segment_result_read_version ( const LanceIndexSegmentResult * result)

◆ lance_index_segment_result_replace_count()

LANCE_API size_t lance_index_segment_result_replace_count ( const LanceIndexSegmentResult * result)

◆ lance_index_segment_result_replace_uuid_at()

LANCE_API int32_t lance_index_segment_result_replace_uuid_at ( const LanceIndexSegmentResult * result,
size_t index,
uint8_t out_uuid[16] )

◆ lance_index_segment_result_segment()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_index_segment_result_segment ( const LanceIndexSegmentResult * result)

◆ lance_index_train_ivf_model()

LANCE_API int32_t lance_index_train_ivf_model ( const LanceDataset * dataset,
const char * column,
uint32_t num_partitions,
int32_t metric,
const uint32_t * fragment_ids,
size_t fragment_count,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Train IVF centroids, exporting FixedSizeList<Float32>[vector_dimension]. The output structs must be zero-initialized; the caller owns and releases both Arrow C Data Interface outputs after success.

◆ lance_index_train_ivf_model_with_options()

LANCE_API int32_t lance_index_train_ivf_model_with_options ( const LanceDataset * dataset,
const char * column,
uint32_t num_partitions,
int32_t metric,
const uint32_t * fragment_ids,
size_t fragment_count,
const LanceIndexTrainerOptions * options,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Train IVF centroids with native sample-rate and iteration controls. options == NULL is equivalent to both fields absent. A present zero is forwarded to Lance; this binding does not add a zero-value policy.

◆ lance_index_train_pq_model()

LANCE_API int32_t lance_index_train_pq_model ( const LanceDataset * dataset,
const char * column,
uint32_t num_sub_vectors,
uint32_t num_bits,
int32_t metric,
const uint32_t * fragment_ids,
size_t fragment_count,
struct ArrowArray * ivf_centroids,
const struct ArrowSchema * ivf_centroids_schema,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Train a PQ codebook, exporting FixedSizeList<Float32>[dimension / num_sub_vectors] with num_sub_vectors * 2^num_bits rows. num_bits must be 4 or 8. The IVF centroids must be the shared centroids that will be injected with this PQ codebook. L2 and cosine training use them to compute residuals; DOT training keeps them for model identity but trains on raw vectors. The trainer borrows them synchronously: it may replace the ArrowArray struct, but leaves a live caller-owned equivalent in place.

◆ lance_index_train_pq_model_with_options()

LANCE_API int32_t lance_index_train_pq_model_with_options ( const LanceDataset * dataset,
const char * column,
uint32_t num_sub_vectors,
uint32_t num_bits,
int32_t metric,
const uint32_t * fragment_ids,
size_t fragment_count,
struct ArrowArray * ivf_centroids,
const struct ArrowSchema * ivf_centroids_schema,
const LanceIndexTrainerOptions * options,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Train a PQ codebook with native sample-rate and iteration controls. The IVF centroids and Arrow output otherwise follow lance_index_train_pq_model.

◆ lance_init_logging()

LANCE_API int32_t lance_init_logging ( const char * filter)

Opt in to native diagnostic logging on stderr.

filter is a NUL-terminated filter expression using the same directive syntax as Rust's RUST_LOG (tracing's EnvFilter): comma-separated target=level directives with an optional bare default level. Common target prefixes are lance, lance_core, lance_io, opendal, and lance_c. For example, "warn,lance=debug,opendal=debug" enables warnings everywhere and debug diagnostics for Lance and OpenDAL. NULL selects "info"; an empty string is rejected.

This call is optional; without it the library emits no diagnostics. It installs one stderr formatter for Rust tracing events and, unless the host already installed a log logger, a bridge that routes log records through the same filter. For the globals it installs, both event families obey the filter; a host global keeps its own filtering.

The process-global logger and tracing subscriber can only be installed once. This function never replaces either one: if the host already installed a log logger or a tracing subscriber, that global remains in place and receives its events. If both are already installed, this function leaves them unchanged. Calls are thread-safe; the first successful call's filter is final and later calls are no-ops. An invalid filter returns -1 with LANCE_ERR_INVALID_ARGUMENT and leaves logging unconfigured, so a later valid call can still enable it.

Filtering is evaluated per event; changing the filter after this call is not supported.

Returns
0 on success, -1 on an invalid or non-UTF-8 filter.

◆ lance_ivf_model_dimension()

LANCE_API uint64_t lance_ivf_model_dimension ( const LanceIvfModel * model)

◆ lance_ivf_model_export_centroids()

LANCE_API int32_t lance_ivf_model_export_centroids ( const LanceIvfModel * model,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Export an owned Arrow copy of the centroids. Both output structs must be zero-initialized and are unchanged on error. A model without centroids returns LANCE_ERR_NOT_FOUND.

◆ lance_ivf_model_free()

LANCE_API void lance_ivf_model_free ( LanceIvfModel * model)

Free an IVF model. NULL-safe.

◆ lance_ivf_model_has_centroids()

LANCE_API bool lance_ivf_model_has_centroids ( const LanceIvfModel * model)

Whether the model contains centroids. NULL sets INVALID_ARGUMENT.

◆ lance_ivf_model_num_partitions()

LANCE_API uint64_t lance_ivf_model_num_partitions ( const LanceIvfModel * model)

Native partition count, dimension, and per-partition row count.

These return 0 on an error sentinel; check lance_last_error_code(). An absent partition also returns 0 from lance_ivf_model_partition_size(), preserving IvfModel::partition_size for every representable usize.

◆ lance_ivf_model_partition_size()

LANCE_API uint64_t lance_ivf_model_partition_size ( const LanceIvfModel * model,
uint64_t partition_id )

◆ lance_key_existence_filter_bloom()

LANCE_API int32_t lance_key_existence_filter_bloom ( const LanceKeyExistenceFilter * filter,
uint8_t ** out_bitmap,
size_t * out_bitmap_len,
uint32_t * out_num_bits,
uint64_t * out_number_of_items,
double * out_probability )

Copy a bloom filter's bitmap and parameters.

The bitmap is allocated with malloc and must be released with lance_free_bytes; a zero-length bitmap yields a NULL pointer. All output pointers are required and are written only on success. Returns LANCE_ERR_NOT_SUPPORTED for an exact-set filter.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_clone()

LANCE_NODISCARD LANCE_API LanceKeyExistenceFilter * lance_key_existence_filter_clone ( const LanceKeyExistenceFilter * filter)

Clone a key-existence filter into independent native storage.

Returns
the new value, or NULL on error.

◆ lance_key_existence_filter_close()

LANCE_API void lance_key_existence_filter_close ( LanceKeyExistenceFilter * filter)

Free a key-existence filter. Safe to call with NULL.

◆ lance_key_existence_filter_exact_count()

LANCE_API int32_t lance_key_existence_filter_exact_count ( const LanceKeyExistenceFilter * filter,
uint64_t * out_count )

Read the number of keys in an exact-set filter.

Returns LANCE_ERR_NOT_SUPPORTED for a bloom filter.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_exact_key_at()

LANCE_API int32_t lance_key_existence_filter_exact_key_at ( const LanceKeyExistenceFilter * filter,
size_t index,
uint64_t * out_key )

Read one exact key by ascending position.

Native exact sets are unordered, so keys are reported in ascending order to keep repeated inspections stable. Returns LANCE_ERR_NOT_SUPPORTED for a bloom filter.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_field_id_at()

LANCE_API int32_t lance_key_existence_filter_field_id_at ( const LanceKeyExistenceFilter * filter,
size_t index,
int32_t * out_field_id )

Read one filtered field ID by position.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_field_id_count()

LANCE_API int32_t lance_key_existence_filter_field_id_count ( const LanceKeyExistenceFilter * filter,
uint64_t * out_count )

Read the number of filtered field IDs.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_from_proto()

LANCE_API int32_t lance_key_existence_filter_from_proto ( const uint8_t * bytes,
size_t len,
LanceKeyExistenceFilter ** out_filter )

Build an owned native key-existence filter from explicit protobuf bytes.

bytes is one encoded lance.table.transaction.KeyExistenceFilter message and is converted through the native TryFrom implementation, so absent bloom fields take the native defaults (number_of_items = 8192, probability = 0.00057) and an absent filter body becomes an empty exact set. NULL bytes are accepted only with a zero length.

Returns
0 on success and writes *out_filter, -1 on error.

◆ lance_key_existence_filter_kind()

LANCE_API int32_t lance_key_existence_filter_kind ( const LanceKeyExistenceFilter * filter,
LanceKeyExistenceFilterKind * out_kind )

Read the filter kind.

Returns
0 on success, -1 on error.

◆ lance_key_existence_filter_to_proto()

LANCE_API int32_t lance_key_existence_filter_to_proto ( const LanceKeyExistenceFilter * filter,
uint8_t ** out_bytes,
size_t * out_len )

Encode a key-existence filter with the native protobuf conversion.

This is the same encoding an Update operation persists, so a filter built with lance_key_existence_filter_from_proto() round-trips exactly. The buffer is allocated with malloc and must be released with lance_free_bytes; an empty encoding yields a NULL pointer.

Returns
0 on success, -1 on error.

◆ lance_lsm_point_lookup_planner_free()

LANCE_API void lance_lsm_point_lookup_planner_free ( LanceLsmPointLookupPlanner * planner)

Free a point-lookup planner. Safe to call with NULL.

◆ lance_lsm_point_lookup_planner_new()

LANCE_API int32_t lance_lsm_point_lookup_planner_new ( LanceDataset * dataset,
const LanceMemWalShardSnapshot *const * snapshots,
size_t num_snapshots,
int32_t has_pk_columns,
const char *const * pk_columns,
size_t num_pk_columns,
LanceLsmPointLookupPlanner ** out )

Create a point-lookup planner.

pk_columns is read only when has_pk_columns != 0; otherwise the native dataset primary key is used and an absent primary key is an error. The planner captures the snapshots and dataset schema. out is written only on success.

◆ lance_lsm_point_lookup_planner_plan()

LANCE_API int32_t lance_lsm_point_lookup_planner_plan ( LanceLsmPointLookupPlanner * planner,
const LanceBatch * pk_value,
int32_t has_columns,
const char *const * columns,
size_t num_columns,
LanceMemWalPlan ** out )

Plan a point lookup for exactly one key row.

pk_value must contain exactly one row. For a single-column primary key it must have exactly one non-Struct column; for a composite key it must have exactly one Struct column carrying one field per primary-key column. columns is read only when has_columns != 0. The caller owns *out_plan.

◆ lance_lsm_scanner_count_rows()

LANCE_API int32_t lance_lsm_scanner_count_rows ( const LanceLsmScanner * scanner,
uint64_t * out_count )

Count matching rows without materializing them.

◆ lance_lsm_scanner_filter()

LANCE_API int32_t lance_lsm_scanner_filter ( LanceLsmScanner * scanner,
const char * filter )

Set a native SQL filter expression. The scanner is updated only on success.

◆ lance_lsm_scanner_free()

LANCE_API void lance_lsm_scanner_free ( LanceLsmScanner * scanner)

Free an LSM scanner. Safe to call with NULL.

◆ lance_lsm_scanner_from_snapshots()

LANCE_API int32_t lance_lsm_scanner_from_snapshots ( LanceDataset * dataset,
const LanceMemWalShardSnapshot *const * snapshots,
size_t num_snapshots,
LanceLsmScanner ** out )

Create an LSM scanner over a dataset and snapshots, without an active MemTable. Primary-key columns come from the dataset schema.

◆ lance_lsm_scanner_limit()

LANCE_API int32_t lance_lsm_scanner_limit ( LanceLsmScanner * scanner,
int64_t limit,
int32_t has_limit,
int64_t offset,
int32_t has_offset )

Limit the scan, optionally with an offset. Each has_* flag is 0 or 1 and a present negative value is rejected. The scanner is updated only on success.

◆ lance_lsm_scanner_project()

LANCE_API int32_t lance_lsm_scanner_project ( LanceLsmScanner * scanner,
const char *const * columns,
size_t num_columns )

Project the scan onto ordered column names. An empty list is passed to native code as an empty projection; columns may be NULL only when num_columns == 0. The scanner is updated only on success.

◆ lance_lsm_scanner_schema()

LANCE_API int32_t lance_lsm_scanner_schema ( const LanceLsmScanner * scanner,
struct ArrowSchema * out_schema )

Schema produced by the scanner's native composition.

◆ lance_lsm_scanner_to_arrow_stream()

LANCE_API int32_t lance_lsm_scanner_to_arrow_stream ( const LanceLsmScanner * scanner,
struct ArrowArrayStream * out )

Execute the scan and export an Arrow stream. The scanner is not consumed and its native owners remain alive independently of the scan result.

◆ lance_lsm_scanner_to_batch()

LANCE_API int32_t lance_lsm_scanner_to_batch ( const LanceLsmScanner * scanner,
LanceBatch ** out )

Execute the scan and return one batch. The caller owns *out and closes it with lance_batch_free().

◆ lance_lsm_scanner_with_memtable_gen()

LANCE_API int32_t lance_lsm_scanner_with_memtable_gen ( LanceLsmScanner * scanner)

Include the _memtable_gen internal column.

◆ lance_lsm_scanner_with_row_address()

LANCE_API int32_t lance_lsm_scanner_with_row_address ( LanceLsmScanner * scanner)

Include the _rowaddr internal column.

◆ lance_lsm_vector_search_planner_free()

LANCE_API void lance_lsm_vector_search_planner_free ( LanceLsmVectorSearchPlanner * planner)

Free a vector-search planner. Safe to call with NULL.

◆ lance_lsm_vector_search_planner_new()

LANCE_API int32_t lance_lsm_vector_search_planner_new ( LanceDataset * dataset,
const LanceMemWalShardSnapshot *const * snapshots,
size_t num_snapshots,
const char * vector_column,
int32_t has_pk_columns,
const char *const * pk_columns,
size_t num_pk_columns,
LanceMemWalDistanceType distance_type,
const char * filter,
LanceLsmVectorSearchPlanner ** out )

Create a vector-search planner.

The vector column must be a native FixedSizeList column. filter is an optional native SQL filter expression. pk_columns follows the same rule as the point-lookup planner. Distance values are this ABI's stable mapping.

◆ lance_lsm_vector_search_planner_plan()

LANCE_API int32_t lance_lsm_vector_search_planner_plan ( LanceLsmVectorSearchPlanner * planner,
const float * query,
size_t query_len,
uint64_t k,
uint64_t nprobes,
int32_t has_columns,
const char *const * columns,
size_t num_columns,
int32_t refine_base_table,
double overfetch_factor,
LanceMemWalPlan ** out )

Plan a KNN search over the captured LSM tiers.

query holds exactly query_len == vector_dimension float32 values and is required to be non-NULL when query_len > 0. k, nprobes and overfetch_factor are validated by native code. columns is read only when has_columns != 0. The caller owns *out_plan.

◆ lance_mem_wal_compacted_sstable_new()

LANCE_API int32_t lance_mem_wal_compacted_sstable_new ( const char * shard_id,
uint64_t generation,
LanceCompactedSsTable * out )

Create a compacted SSTable value from a UUID string and generation.

The resulting value is the shared 16-byte UUID plus generation value type.

◆ lance_mem_wal_evaluate_sharding_spec()

LANCE_API int32_t lance_mem_wal_evaluate_sharding_spec ( LanceDataset * dataset,
const LanceBatch * batch,
const LanceMemWalShardingSpec * spec,
LanceBatch ** out_batch )

Evaluate a sharding spec against the dataset schema.

Adds a column named after the spec's field_id holding the native shard value. The caller owns *out_batch and frees it with lance_batch_free().

◆ lance_mem_wal_evaluate_sharding_spec_with_schema()

LANCE_API int32_t lance_mem_wal_evaluate_sharding_spec_with_schema ( const LanceBatch * batch,
const LanceMemWalShardingSpec * spec,
const LanceSchema * schema,
LanceBatch ** out_batch )

Evaluate a sharding spec against an explicit native schema.

Uses the native schema value for field ids and source resolution instead of the dataset schema. The caller owns *out_batch. A NULL schema is invalid.

◆ lance_mem_wal_index_details()

LANCE_API int32_t lance_mem_wal_index_details ( LanceDataset * dataset,
LanceMemWalIndexDetails ** out )

Read the native MemWAL index details.

Returns 0 with *out == NULL when MemWAL is not initialized on the dataset. On success with a value, the caller owns *out and frees it with lance_mem_wal_index_details_free().

◆ lance_mem_wal_index_details_dir_id()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_index_details_dir_id ( const LanceMemWalIndexDetails * details)

Borrow the MemWAL directory identifier recorded in the index details.

An empty string denotes the legacy _mem_wal directory. The string remains valid until the details handle is freed.

◆ lance_mem_wal_index_details_free()

LANCE_API void lance_mem_wal_index_details_free ( LanceMemWalIndexDetails * details)

Free an index-details handle. Safe to call with NULL.

◆ lance_mem_wal_index_details_maintain_all_indexes()

LANCE_API int32_t lance_mem_wal_index_details_maintain_all_indexes ( const LanceMemWalIndexDetails * details)

Whether the index maintains every dataset index: 1 or 0.

◆ lance_mem_wal_index_details_maintained_index_at()

LANCE_API int32_t lance_mem_wal_index_details_maintained_index_at ( const LanceMemWalIndexDetails * details,
size_t index,
const char ** out_name )

Borrow one explicitly maintained index name.

The name remains valid until the details handle is freed. Returns -1 on a NULL handle or an out-of-range index.

◆ lance_mem_wal_index_details_maintained_index_count()

LANCE_API size_t lance_mem_wal_index_details_maintained_index_count ( const LanceMemWalIndexDetails * details)

Count of explicitly maintained index names.

◆ lance_mem_wal_index_details_num_shards()

LANCE_API uint32_t lance_mem_wal_index_details_num_shards ( const LanceMemWalIndexDetails * details)

Number of shards recorded for the MemWAL index.

◆ lance_mem_wal_index_details_sharding_spec_at()

LANCE_API int32_t lance_mem_wal_index_details_sharding_spec_at ( const LanceMemWalIndexDetails * details,
size_t index,
LanceMemWalShardingSpec ** out_spec )

Clone one sharding spec. The caller owns *out_spec and frees it with lance_mem_wal_sharding_spec_free().

◆ lance_mem_wal_index_details_sharding_spec_count()

LANCE_API size_t lance_mem_wal_index_details_sharding_spec_count ( const LanceMemWalIndexDetails * details)

Count of sharding specs recorded for the index.

◆ lance_mem_wal_index_details_writer_config_default_at()

LANCE_API int32_t lance_mem_wal_index_details_writer_config_default_at ( const LanceMemWalIndexDetails * details,
size_t index,
const char ** out_key,
const char ** out_value )

Borrow one recorded writer-configuration default.

Entries iterate in lexicographic key order. Both strings remain valid until the details handle is freed.

◆ lance_mem_wal_index_details_writer_config_default_count()

LANCE_API size_t lance_mem_wal_index_details_writer_config_default_count ( const LanceMemWalIndexDetails * details)

Count of recorded writer-configuration defaults.

◆ lance_mem_wal_initialize()

LANCE_API int32_t lance_mem_wal_initialize ( LanceDataset * dataset,
LanceMemWalShardingMode mode,
const char * column,
uint32_t num_buckets,
int32_t has_maintained_indexes,
const char *const * maintained_indexes,
size_t num_maintained_indexes,
const LanceShardWriterConfig * config )

Initialize MemWAL on a dataset.

Commits the native MemWAL system index. mode selects manual, unsharded, bucket or identity sharding; bucket ranges and column suitability are validated by native code. column is required for bucket and identity modes, and must be NULL for manual and unsharded modes. num_buckets is used only for bucket mode and must be 0 otherwise.

A non-NULL config records the resulting native writer defaults in the MemWAL index; NULL records none. maintained_indexes is read only when has_maintained_indexes != 0; zero entries then means "maintain none", while a zero flag means "maintain every index".

Returns
0 on success, -1 on error.

◆ lance_mem_wal_plan_dataset_schema()

LANCE_API int32_t lance_mem_wal_plan_dataset_schema ( const LanceMemWalPlan * plan,
struct ArrowSchema * out )

Export the dataset schema captured by the planner as Arrow. out is caller-owned.

◆ lance_mem_wal_plan_explain()

LANCE_API int32_t lance_mem_wal_plan_explain ( const LanceMemWalPlan * plan,
char ** out )

Format the native DataFusion plan tree without executing it. The returned string is NUL-terminated, owned by the caller, and must be freed with lance_free_string(). Returns -1 on error.

◆ lance_mem_wal_plan_free()

LANCE_API void lance_mem_wal_plan_free ( LanceMemWalPlan * plan)

Free an execution plan. Safe to call with NULL.

◆ lance_mem_wal_plan_schema()

LANCE_API int32_t lance_mem_wal_plan_schema ( const LanceMemWalPlan * plan,
struct ArrowSchema * out )

Export the plan's output schema as Arrow. out is caller-owned and its non-NULL release callback must be invoked exactly once.

◆ lance_mem_wal_plan_to_arrow_stream()

LANCE_API int32_t lance_mem_wal_plan_to_arrow_stream ( const LanceMemWalPlan * plan,
struct ArrowArrayStream * out )

Execute the plan and export an Arrow stream. Execution errors are reported with the prefix "Plan execution failed: ". The plan remains valid.

◆ lance_mem_wal_plan_to_batch()

LANCE_API int32_t lance_mem_wal_plan_to_batch ( const LanceMemWalPlan * plan,
LanceBatch ** out )

Execute the plan and concatenate its batches into one. The caller owns *out and frees it with lance_batch_free().

◆ lance_mem_wal_shard_snapshot_clone()

LANCE_API int32_t lance_mem_wal_shard_snapshot_clone ( const LanceMemWalShardSnapshot * snapshot,
LanceMemWalShardSnapshot ** out )

Clone a shard snapshot. The clone is independently owned.

◆ lance_mem_wal_shard_snapshot_current_generation()

LANCE_API uint64_t lance_mem_wal_shard_snapshot_current_generation ( const LanceMemWalShardSnapshot * snapshot)

Native current generation.

◆ lance_mem_wal_shard_snapshot_free()

LANCE_API void lance_mem_wal_shard_snapshot_free ( LanceMemWalShardSnapshot * snapshot)

Free a shard snapshot. Safe to call with NULL.

◆ lance_mem_wal_shard_snapshot_new()

LANCE_API int32_t lance_mem_wal_shard_snapshot_new ( const char * shard_id,
LanceMemWalShardSnapshot ** out )

Create a shard snapshot value.

shard_id is a canonical UUID string. Native starts with spec id 0 and current generation 1, matching ShardSnapshot::new().

◆ lance_mem_wal_shard_snapshot_shard_id()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_shard_snapshot_shard_id ( const LanceMemWalShardSnapshot * snapshot)

Borrow the shard UUID string in canonical form.

◆ lance_mem_wal_shard_snapshot_spec_id()

LANCE_API uint32_t lance_mem_wal_shard_snapshot_spec_id ( const LanceMemWalShardSnapshot * snapshot)

Native spec id.

◆ lance_mem_wal_shard_snapshot_sstable_at()

LANCE_API int32_t lance_mem_wal_shard_snapshot_sstable_at ( const LanceMemWalShardSnapshot * snapshot,
size_t index,
uint64_t * out_generation,
const char ** out_path )

Borrow one SSTable reference: writes its generation and a borrowed path that remains valid until the snapshot is freed or mutated.

◆ lance_mem_wal_shard_snapshot_sstable_count()

LANCE_API size_t lance_mem_wal_shard_snapshot_sstable_count ( const LanceMemWalShardSnapshot * snapshot)

Count of referenced SSTables.

◆ lance_mem_wal_shard_snapshot_with_current_generation()

LANCE_API int32_t lance_mem_wal_shard_snapshot_with_current_generation ( LanceMemWalShardSnapshot * snapshot,
uint64_t generation )

Set the native current generation.

◆ lance_mem_wal_shard_snapshot_with_spec_id()

LANCE_API int32_t lance_mem_wal_shard_snapshot_with_spec_id ( LanceMemWalShardSnapshot * snapshot,
uint32_t spec_id )

Set the native spec id.

◆ lance_mem_wal_shard_snapshot_with_sstable()

LANCE_API int32_t lance_mem_wal_shard_snapshot_with_sstable ( LanceMemWalShardSnapshot * snapshot,
uint64_t generation,
const char * path )

Append an SSTable reference.

path is copied and is relative to the shard directory. The native optional measurements are left unmeasured, matching a snapshot built from an external path. The caller owns the string for the duration of the call.

◆ lance_mem_wal_sharding_field_clone()

LANCE_API int32_t lance_mem_wal_sharding_field_clone ( const LanceMemWalShardingField * field,
LanceMemWalShardingField ** out )

Clone a sharding field. The caller owns the result.

◆ lance_mem_wal_sharding_field_expression()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_expression ( const LanceMemWalShardingField * field)

Borrow the transform expression, or NULL when native holds None.

◆ lance_mem_wal_sharding_field_free()

LANCE_API void lance_mem_wal_sharding_field_free ( LanceMemWalShardingField * field)

Free a sharding field handle. Safe to call with NULL.

◆ lance_mem_wal_sharding_field_id()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_id ( const LanceMemWalShardingField * field)

Borrow the field id.

◆ lance_mem_wal_sharding_field_new()

LANCE_API int32_t lance_mem_wal_sharding_field_new ( const char * field_id,
const int32_t * source_ids,
size_t num_source_ids,
const char * transform,
const char * expression,
const char * result_type,
const char *const * parameter_keys,
const char *const * parameter_values,
size_t num_parameters,
LanceMemWalShardingField ** out )

Create a sharding field value.

field_id, result_type (when non-NULL), parameter keys and parameter values must be UTF-8. transform and expression are NULL for native None; a non-NULL result_type is copied, and NULL means the empty string. Parameters follow map last-write-wins. source_ids is required to be non-NULL when num_source_ids > 0.

◆ lance_mem_wal_sharding_field_parameter_at()

LANCE_API int32_t lance_mem_wal_sharding_field_parameter_at ( const LanceMemWalShardingField * field,
size_t index,
const char ** out_key,
const char ** out_value )

Borrow one transform parameter in lexicographic key order. Both strings remain valid until the field handle is freed.

◆ lance_mem_wal_sharding_field_parameter_count()

LANCE_API size_t lance_mem_wal_sharding_field_parameter_count ( const LanceMemWalShardingField * field)

Count of transform parameters.

◆ lance_mem_wal_sharding_field_result_type()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_result_type ( const LanceMemWalShardingField * field)

Borrow the result type; never NULL for a valid handle (may be "").

◆ lance_mem_wal_sharding_field_source_ids()

LANCE_NODISCARD LANCE_API const int32_t * lance_mem_wal_sharding_field_source_ids ( const LanceMemWalShardingField * field,
size_t * out_count )

Borrow the source field ids. Writes the count to out_count and returns NULL when the count is zero. The pointer remains valid until the handle is freed.

◆ lance_mem_wal_sharding_field_transform()

LANCE_NODISCARD LANCE_API const char * lance_mem_wal_sharding_field_transform ( const LanceMemWalShardingField * field)

Borrow the transform name, or NULL when native holds None.

◆ lance_mem_wal_sharding_spec_clone()

LANCE_API int32_t lance_mem_wal_sharding_spec_clone ( const LanceMemWalShardingSpec * spec,
LanceMemWalShardingSpec ** out )

Clone a sharding spec. The caller owns the result.

◆ lance_mem_wal_sharding_spec_field_at()

LANCE_API int32_t lance_mem_wal_sharding_spec_field_at ( const LanceMemWalShardingSpec * spec,
size_t index,
LanceMemWalShardingField ** out_field )

Clone one field from the spec. The caller owns *out_field and frees it with lance_mem_wal_sharding_field_free().

◆ lance_mem_wal_sharding_spec_field_count()

LANCE_API size_t lance_mem_wal_sharding_spec_field_count ( const LanceMemWalShardingSpec * spec)

Count of fields in the spec.

◆ lance_mem_wal_sharding_spec_free()

LANCE_API void lance_mem_wal_sharding_spec_free ( LanceMemWalShardingSpec * spec)

Free a sharding spec handle. Safe to call with NULL.

◆ lance_mem_wal_sharding_spec_id()

LANCE_API uint32_t lance_mem_wal_sharding_spec_id ( const LanceMemWalShardingSpec * spec)

Native spec id.

◆ lance_mem_wal_sharding_spec_new()

LANCE_API int32_t lance_mem_wal_sharding_spec_new ( uint32_t spec_id,
const LanceMemWalShardingField *const * fields,
size_t num_fields,
LanceMemWalShardingSpec ** out )

Create a sharding spec from field handles. Fields are cloned; the caller keeps ownership of each input handle. fields is required to be non-NULL when num_fields > 0.

◆ lance_namespace_call()

LANCE_API int32_t lance_namespace_call ( const LanceNamespace * ns,
const char * operation,
const char * request_json,
const uint8_t * request_bytes,
size_t request_bytes_len,
LanceNamespaceResult * out_result )

Invoke one of the 54 native namespace trait operations.

operation is the exact native snake_case method name. Requests are JSON encodings of the native request models; NULL or empty means {}. request_bytes is the request body for create_table, insert_into_table and merge_insert_into_table and is ignored otherwise. query_table returns its native Arrow IPC bytes in the result.

Successful unit operations leave result_json NULL. Model responses use JSON. On failure the native NamespaceError code/message are copied into the result, separately from the returned generic LanceErrorCode.

Returns
0 on success, -1 on failure. out_result must not be NULL and must not already own resources.

◆ lance_namespace_close()

LANCE_API void lance_namespace_close ( LanceNamespace * ns)

Close a namespace handle. Datasets, storage providers and adapters retain their own native Arc ownership; foreign contexts are released after the final native owner drops.

◆ lance_namespace_connect_new()

LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_connect_new ( const char * impl_name,
const char * properties_json,
const LanceSession * session,
const LanceNamespaceContextProviderSpec * context_provider )

Connect through native ConnectBuilder, for example impl_name "dir" or "rest". The selected properties are native impl properties.

◆ lance_namespace_custom_dispatch_new()

LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_custom_dispatch_new ( const LanceNamespaceCustomClientDispatchSpec * spec)

◆ lance_namespace_custom_new()

LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_custom_new ( const LanceNamespaceCustomClientSpec * spec)

◆ lance_namespace_directory_new()

LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_directory_new ( const char * properties_json,
const LanceSession * session,
const LanceNamespaceContextProviderSpec * context_provider )

Create a directory namespace from native DirectoryNamespaceBuilder.

properties_json is a JSON object of string values; NULL or an empty string uses native defaults. session may be NULL. Native keys, defaults and validation follow the selected Lance core. context_provider may be NULL.

◆ lance_namespace_id()

LANCE_NODISCARD LANCE_API char * lance_namespace_id ( const LanceNamespace * ns)

Copy the native namespace identifier. Free with lance_free_string().

◆ lance_namespace_reset_ops_metrics()

LANCE_API int32_t lance_namespace_reset_ops_metrics ( const LanceNamespace * ns)

Reset the native operation counters.

◆ lance_namespace_rest_new()

LANCE_NODISCARD LANCE_API LanceNamespace * lance_namespace_rest_new ( const char * properties_json,
const LanceNamespaceContextProviderSpec * context_provider )

Create a REST namespace from native RestNamespaceBuilder.

Native properties include uri, delimiter, header.*, tls.* and ops_metrics_enabled. TLS and validation behavior are native.

◆ lance_namespace_result_close()

LANCE_API void lance_namespace_result_close ( LanceNamespaceResult * result)

◆ lance_namespace_retrieve_ops_metrics()

LANCE_NODISCARD LANCE_API char * lance_namespace_retrieve_ops_metrics ( const LanceNamespace * ns)

Retrieve native operation counters as a JSON object of integer values. Free with lance_free_string(). Directory and REST handles use the selected native implementation's counters. Connected and custom handles return LANCE_ERR_NOT_SUPPORTED because they have no concrete native counter store.

◆ lance_namespace_storage_options_provider_new()

LANCE_NODISCARD LANCE_API LanceStorageOptionsProvider * lance_namespace_storage_options_provider_new ( const LanceNamespace * ns,
const char * table_id_json )

Native namespace storage-options provider.

The provider calls describe_table with vend_credentials=true and retains the namespace. Table identity refreshes and lifetime are native. Close with lance_storage_options_provider_close. table_id_json is a JSON array of strings.

◆ lance_native_write_options_close()

LANCE_API void lance_native_write_options_close ( LanceNativeWriteOptions * options)

Close an owned native write-options handle.

Native writes clone the values they need. Close the handle only after all calls that borrowed it have returned. Closing drops the retained session, storage accessors, commit lock and progress context; the progress release callback may run from this call. NULL-safe.

◆ lance_native_write_options_new()

LANCE_NODISCARD LANCE_API LanceNativeWriteOptions * lance_native_write_options_new ( const LanceNativeWriteOptionsSpec * spec)

Create an owned native-backed dataset write-options handle.

spec == NULL selects native WriteParams::default(). The write mode is supplied by the later entry point, not by this handle.

Ownership of spec->progress->callback_ctx transfers only on success. On failure the caller retains it and release is not called. On success the callback context is released exactly once when the final native owner drops; this may happen inside lance_native_write_options_close or later on a native worker thread.

Native validation of option combinations remains authoritative. This constructor rejects only values that cannot be parsed or represented at the C boundary. Returns NULL on error.

◆ lance_operation_append_fragment_at()

LANCE_API int32_t lance_operation_append_fragment_at ( const LanceOperation * operation,
size_t index,
LanceFragment ** out_fragment )

Clone one Append fragment as an independently owned detached handle.

The clone owns the complete native Fragment metadata and remains valid after the operation and every source dataset are closed. It supports metadata inspection and operation construction but rejects dataset-dependent reads. Returns 0 on success, -1 on error; the output slot is unchanged on error.

◆ lance_operation_append_fragment_count()

LANCE_API int32_t lance_operation_append_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of fragments in an Append operation. Returns 0 on success, -1 on error; other variants return LANCE_ERR_NOT_SUPPORTED.

◆ lance_operation_append_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_append_new ( const LanceFragment *const * fragments,
size_t fragment_count )

Construct an owned native Append operation.

fragments is an array of borrowed fragment handles; each handle is required when the count is non-zero and its complete native metadata, including pre-assigned IDs, row ID metadata and data files, is copied. A NULL array is valid only with a zero count.

Native commit validation owns schema coverage, fragment ID assignment and row-ID assignment. Explicit fields and non-zero reserved IDs pass through unchanged; this constructor adds no binding-side policy. Returns an owned operation, or NULL on error.

◆ lance_operation_clone_branch_name()

LANCE_API int32_t lance_operation_clone_branch_name ( const LanceOperation * operation,
bool * out_present,
const char ** out_value )

Read the borrowed native branch_name. *out_present distinguishes None from Some, including Some(""). Both output slots are unchanged on error.

◆ lance_operation_clone_is_shallow()

LANCE_API int32_t lance_operation_clone_is_shallow ( const LanceOperation * operation,
bool * out_value )

Read whether a Clone operation is shallow.

◆ lance_operation_clone_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_clone_new ( bool is_shallow,
const char * ref_name,
uint64_t ref_version,
const char * ref_path,
const char * branch_name )

Construct an owned native Clone operation.

ref_name == NULL maps to native None; a non-NULL pointer, including an empty string, maps to Some(name). ref_path must be non-NULL UTF-8 and is copied; an empty path is accepted. branch_name follows the same NULL/Some mapping as ref_name.

Native commit code owns shallow-clone publication and rejects a deep clone unless the core copied the source files itself. This constructor adds no binding-side policy. Returns an owned operation, or NULL on error.

◆ lance_operation_clone_ref_name()

LANCE_API int32_t lance_operation_clone_ref_name ( const LanceOperation * operation,
bool * out_present,
const char ** out_value )

Read the borrowed native ref_name. *out_present distinguishes None from Some, including Some(""). Both output slots are unchanged on error; the pointer remains valid until the operation is closed.

◆ lance_operation_clone_ref_path()

LANCE_NODISCARD LANCE_API const char * lance_operation_clone_ref_path ( const LanceOperation * operation)

Read the borrowed native ref_path. The pointer remains valid until the operation is closed. Returns NULL on error.

◆ lance_operation_clone_ref_version()

LANCE_API int32_t lance_operation_clone_ref_version ( const LanceOperation * operation,
uint64_t * out_version )

Read the native ref_version of a Clone operation.

◆ lance_operation_close()

LANCE_API void lance_operation_close ( LanceOperation * operation)

Close an operation handle. NULL-safe. Close exactly once.

◆ lance_operation_create_index_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_create_index_new ( const LanceIndexSegmentMetadata *const * new_indices,
size_t new_index_count,
const LanceIndexSegmentMetadata *const * removed_indices,
size_t removed_index_count )

Construct an owned native CreateIndex operation.

new_indices and removed_indices are arrays of borrowed metadata handles whose complete native IndexMetadata values are copied. A NULL array is valid only when its count is zero; a non-NULL array with a zero count is ignored. Each non-NULL entry is required when the count is non-zero.

Native Operation::CreateIndex owns index replacement, name handling and coverage validation. This constructor does not add binding-side non-empty, sorting, de-duplication, name or coverage checks. Returns an owned operation, or NULL on error.

◆ lance_operation_create_index_new_at()

LANCE_API int32_t lance_operation_create_index_new_at ( const LanceOperation * operation,
size_t index,
LanceIndexSegmentMetadata ** out_metadata )

Clone one new metadata entry from a CreateIndex operation.

On success *out_metadata receives an independently owned handle that remains valid after the operation is closed. Returns 0 on success, -1 on error; the output slot is unchanged on error.

◆ lance_operation_create_index_new_count()

LANCE_API int32_t lance_operation_create_index_new_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of new metadata entries in a CreateIndex operation. Returns 0 on success, -1 on error (including a different operation kind).

◆ lance_operation_create_index_removed_at()

LANCE_API int32_t lance_operation_create_index_removed_at ( const LanceOperation * operation,
size_t index,
LanceIndexSegmentMetadata ** out_metadata )

Clone one removed metadata entry from a CreateIndex operation.

On success *out_metadata receives an independently owned handle that remains valid after the operation is closed. Returns 0 on success, -1 on error; the output slot is unchanged on error.

◆ lance_operation_create_index_removed_count()

LANCE_API int32_t lance_operation_create_index_removed_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of removed metadata entries in a CreateIndex operation. Returns 0 on success, -1 on error (including a different operation kind).

◆ lance_operation_data_overlay_group_at()

LANCE_API int32_t lance_operation_data_overlay_group_at ( const LanceOperation * operation,
size_t index,
LanceDataOverlayGroup ** out_group )

Clone one data overlay group. A wrong operation variant returns LANCE_ERR_NOT_SUPPORTED; an out-of-range index returns LANCE_ERR_INVALID_ARGUMENT. The output is written only on success and must be closed independently. Returns 0 on success, -1 on error.

◆ lance_operation_data_overlay_group_count()

LANCE_API int32_t lance_operation_data_overlay_group_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of data overlay groups. A non-DataOverlay operation returns LANCE_ERR_NOT_SUPPORTED. Returns 0 on success, -1 on error.

◆ lance_operation_data_overlay_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_data_overlay_new ( const LanceDataOverlayGroup *const * groups,
size_t group_count )

Construct an owned native DataOverlay operation.

Group handles are borrowed and cloned in input order. A NULL array is accepted only with a zero count. Empty group lists are retained because the native operation permits them. Native commit owns fragment existence, coverage validity, layout and ordering checks. Returns NULL on error.

Native overlays are experimental. For release builds, set LANCE_ENABLE_UNSTABLE_DATA_OVERLAY_FILES=1 in every process that reads or modifies an overlay dataset, including before publication.

◆ lance_operation_data_replacement_at()

LANCE_API int32_t lance_operation_data_replacement_at ( const LanceOperation * operation,
size_t index,
LanceDataReplacementGroup ** out_group )

Clone one data replacement group. A wrong operation variant returns LANCE_ERR_NOT_SUPPORTED; an out-of-range index returns LANCE_ERR_INVALID_ARGUMENT. The output is written only on success and must be closed independently. Returns 0 on success, -1 on error.

◆ lance_operation_data_replacement_count()

LANCE_API int32_t lance_operation_data_replacement_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of data replacement groups. A non-DataReplacement operation returns LANCE_ERR_NOT_SUPPORTED. Returns 0 on success, -1 on error.

◆ lance_operation_data_replacement_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_data_replacement_new ( const LanceDataReplacementGroup *const * replacements,
size_t replacement_count )

Construct an owned native DataReplacement operation.

Group handles are borrowed and copied in input order. A NULL array is accepted only with a zero count. Empty replacement lists are retained because the native operation permits them. No sorting, deduplication, non-empty, field-ID or coverage policy is added. Returns NULL on error.

◆ lance_operation_delete_deleted_fragment_count()

LANCE_API int32_t lance_operation_delete_deleted_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of fully deleted fragment IDs in a Delete operation. Returns 0 on success, -1 on error (including wrong operation kind).

◆ lance_operation_delete_deleted_fragment_id_at()

LANCE_API int32_t lance_operation_delete_deleted_fragment_id_at ( const LanceOperation * operation,
size_t index,
uint64_t * out_id )

Read one fully deleted fragment ID from a Delete operation. Returns 0 on success, -1 on error. out_id is unchanged on error.

◆ lance_operation_delete_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_delete_new ( const LanceFragment *const * updated_fragments,
size_t updated_fragment_count,
const uint64_t * deleted_fragment_ids,
size_t deleted_fragment_count,
const char * predicate )

Construct an owned native Delete operation.

updated_fragments is an array of borrowed fragment handles whose complete native metadata is copied. Each pointer must be non-NULL when the count is non-zero. deleted_fragment_ids is copied. predicate must be non-NULL UTF-8 and is copied; an empty predicate is accepted.

Native constructors and commit own fragment existence, uniqueness, overlap and predicate validation. This function adds no binding-side policy. Returns an owned operation, or NULL on error.

◆ lance_operation_delete_predicate()

LANCE_NODISCARD LANCE_API const char * lance_operation_delete_predicate ( const LanceOperation * operation)

Return a newly allocated copy of a Delete operation's predicate. Caller frees with lance_free_string(). Returns NULL on error.

◆ lance_operation_delete_updated_fragment_count()

LANCE_API int32_t lance_operation_delete_updated_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of updated fragments in a Delete operation. Returns 0 on success, -1 on error (including wrong operation kind).

◆ lance_operation_delete_updated_fragment_metadata_json_at()

LANCE_NODISCARD LANCE_API const char * lance_operation_delete_updated_fragment_metadata_json_at ( const LanceOperation * operation,
size_t index )

Serialize one updated Delete fragment's native metadata as JSON.

The JSON is the same native Fragment serialization returned by lance_fragment_metadata_json(). Caller frees with lance_free_string(). Returns NULL on error, including a wrong operation kind or bad index.

◆ lance_operation_fragment_count()

LANCE_API int32_t lance_operation_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the fragment count for an Append or Overwrite operation. Returns 0 on success, -1 on error. Other variants return LANCE_ERR_NOT_SUPPORTED; use the typed operation getters for other variants.

◆ lance_operation_kind()

LANCE_API int32_t lance_operation_kind ( const LanceOperation * operation,
LanceOperationKind * out_kind )

Read the operation variant. Returns 0 on success, -1 on error; the output slot is success-only.

◆ lance_operation_merge_fragment_at()

LANCE_API int32_t lance_operation_merge_fragment_at ( const LanceOperation * operation,
size_t index,
LanceFragment ** out_fragment )

Clone one Merge fragment as an independent detached handle.

◆ lance_operation_merge_fragment_count()

LANCE_API int32_t lance_operation_merge_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of fragments in a Merge operation.

◆ lance_operation_merge_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_merge_new ( const LanceSchema * schema,
const LanceFragment *const * fragments,
size_t fragment_count,
bool preserves_nullability )

Construct an owned native Merge operation.

The schema is cloned and every fragment handle is borrowed while its complete native metadata is copied. fragments is the complete final fragment list; dropping a fragment removes it, and adding a fragment adds it. A NULL array is accepted only with a zero count. preserves_nullability is stored unchanged as the caller's assertion about the merge's schema change.

Native commit code owns schema-change and concurrent-nullability conflict validation. Returns an owned operation, or NULL on error.

◆ lance_operation_merge_preserves_nullability()

LANCE_API int32_t lance_operation_merge_preserves_nullability ( const LanceOperation * operation,
bool * out_value )

Read the native preserves_nullability assertion from a Merge operation.

◆ lance_operation_merge_schema_clone()

LANCE_API int32_t lance_operation_merge_schema_clone ( const LanceOperation * operation,
LanceSchema ** out_schema )

Clone the in-memory native schema of a Merge operation.

◆ lance_operation_overwrite_config_upsert_count()

LANCE_API int32_t lance_operation_overwrite_config_upsert_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of config upsert entries; native None reports 0.

◆ lance_operation_overwrite_config_upsert_key_at()

LANCE_NODISCARD LANCE_API const char * lance_operation_overwrite_config_upsert_key_at ( const LanceOperation * operation,
size_t index )

Read one borrowed config upsert key. The pointer remains valid until the operation is closed. Returns NULL on error.

◆ lance_operation_overwrite_config_upsert_value_at()

LANCE_NODISCARD LANCE_API const char * lance_operation_overwrite_config_upsert_value_at ( const LanceOperation * operation,
size_t index )

Read one borrowed config upsert value. The pointer remains valid until the operation is closed. Returns NULL on error.

◆ lance_operation_overwrite_fragment_at()

LANCE_API int32_t lance_operation_overwrite_fragment_at ( const LanceOperation * operation,
size_t index,
LanceFragment ** out_fragment )

Clone one Overwrite fragment as an independent detached handle carrying its complete native metadata. The output slot is unchanged on error.

◆ lance_operation_overwrite_fragment_count()

LANCE_API int32_t lance_operation_overwrite_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of fragments in an Overwrite operation. Other variants return LANCE_ERR_NOT_SUPPORTED. The generic lance_operation_fragment_count() keeps its Append/Overwrite behavior.

◆ lance_operation_overwrite_has_config_upsert_values()

LANCE_API int32_t lance_operation_overwrite_has_config_upsert_values ( const LanceOperation * operation,
bool * out_has )

Report whether the Overwrite carries native Some config upserts. Some(empty) is distinct from None. Returns 0 on success, -1 on error.

◆ lance_operation_overwrite_has_initial_bases()

LANCE_API int32_t lance_operation_overwrite_has_initial_bases ( const LanceOperation * operation,
bool * out_has )

Report whether the Overwrite carries native Some initial bases. Some(empty) is distinct from None.

◆ lance_operation_overwrite_initial_base_at()

LANCE_API int32_t lance_operation_overwrite_initial_base_at ( const LanceOperation * operation,
size_t index,
LanceBasePathView * out_base )

Read one borrowed initial base path view. name == NULL means native None. The output slot is unchanged on error.

◆ lance_operation_overwrite_initial_base_count()

LANCE_API int32_t lance_operation_overwrite_initial_base_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of initial base paths; native None reports 0.

◆ lance_operation_overwrite_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_overwrite_new ( const LanceSchema * schema,
const LanceFragment *const * fragments,
size_t fragment_count,
const LanceStringMap * config_upsert_values,
const LanceBasePathList * initial_bases )

Construct an owned native Overwrite operation.

The schema is cloned and every fragment handle is borrowed while its complete native metadata is copied. A NULL fragment array is accepted only with a zero count. config_upsert_values == NULL maps to native None; a non-NULL map with zero entries maps to native Some(empty). initial_bases == NULL maps to native None; a non-NULL list with zero entries maps to native Some(empty list).

Native commit code owns fragment ID reassignment, deletion-file rejection, schema and config replacement. This constructor adds no binding-side policy. Returns an owned operation, or NULL on error. Close it with lance_operation_close().

◆ lance_operation_overwrite_schema_clone()

LANCE_API int32_t lance_operation_overwrite_schema_clone ( const LanceOperation * operation,
LanceSchema ** out_schema )

Clone the in-memory native schema of an Overwrite operation.

◆ lance_operation_preserves_nullability()

LANCE_API int32_t lance_operation_preserves_nullability ( const LanceOperation * operation,
bool * out_preserves_nullability )

Read the native preserves_nullability assertion from a Merge or Project operation.

On success writes *out_preserves_nullability and returns 0. Other operation kinds return LANCE_ERR_NOT_SUPPORTED and leave the output untouched.

◆ lance_operation_project_new()

LANCE_API int32_t lance_operation_project_new ( const LanceSchema * schema,
bool preserves_nullability,
LanceOperation ** out_operation )

Construct an owned native Project operation from a native schema.

preserves_nullability is the caller's explicit declaration that the projection does not tighten field nullability. It is stored in the native operation unchanged; conflict resolution and rebase semantics belong to Lance core. The schema is cloned, so schema may be closed immediately after this call. No binding-side schema validation is added.

On success writes *out_operation and returns 0. On error the output slot is untouched. Close the result with lance_operation_close().

◆ lance_operation_project_preserves_nullability()

LANCE_API int32_t lance_operation_project_preserves_nullability ( const LanceOperation * operation,
bool * out_value )

Read the native preserves_nullability assertion from a Project operation.

◆ lance_operation_project_schema_clone()

LANCE_API int32_t lance_operation_project_schema_clone ( const LanceOperation * operation,
LanceSchema ** out_schema )

Clone the in-memory native schema of a Project operation.

◆ lance_operation_reserve_fragments_count()

LANCE_API int32_t lance_operation_reserve_fragments_count ( const LanceOperation * operation,
uint32_t * out_count )

Read the reserved fragment count of a ReserveFragments operation. Returns 0 on success, -1 on error; other variants return LANCE_ERR_NOT_SUPPORTED.

◆ lance_operation_reserve_fragments_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_reserve_fragments_new ( uint32_t num_fragments)

Construct an owned native ReserveFragments operation.

num_fragments == 0 is a native no-op version; larger values advance the manifest maximum fragment ID for later native allocation. Returns an owned operation, or NULL on error.

◆ lance_operation_restore_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_restore_new ( uint64_t version)

Construct an owned native Restore operation.

version passes through unchanged. Native commit validation owns whether the version exists and is restorable. Returns an owned operation, or NULL on error.

◆ lance_operation_restore_version()

LANCE_API int32_t lance_operation_restore_version ( const LanceOperation * operation,
uint64_t * out_version )

Read the target version of a Restore operation. Returns 0 on success, -1 on error; other variants return LANCE_ERR_NOT_SUPPORTED.

◆ lance_operation_rewrite_frag_reuse_index()

LANCE_API int32_t lance_operation_rewrite_frag_reuse_index ( const LanceOperation * operation,
bool * out_present,
LanceIndexSegmentMetadata ** out_metadata )

Clone the in-memory fragment-reuse index of a Rewrite operation.

When the native field is None, writes *out_present = false and a NULL handle. Otherwise writes 1 and an independently owned metadata snapshot, including fragment bitmap, index details and files. Both outputs are written only on success.

Returns
0 on success, -1 on error.

◆ lance_operation_rewrite_group_at()

LANCE_API int32_t lance_operation_rewrite_group_at ( const LanceOperation * operation,
size_t index,
LanceRewriteGroup ** out_group )

Clone one Rewrite group by position.

Returns
0 on success, -1 on error.

◆ lance_operation_rewrite_group_count()

LANCE_API int32_t lance_operation_rewrite_group_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of groups in a Rewrite operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_rewrite_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_rewrite_new ( const LanceRewriteGroup *const * groups,
size_t group_count,
const LanceRewrittenIndex *const * rewritten_indices,
size_t rewritten_index_count,
const LanceIndexSegmentMetadata * frag_reuse_index )

Construct an owned native Rewrite operation.

Groups and rewritten indices are cloned from their handles. frag_reuse_index may be NULL for native None; otherwise its complete native index metadata is copied.

The fragment-reuse index is in-memory only. Native serialization never writes it, so an explicit protobuf round trip yields None even when the in-memory operation carries one.

Returns
the new operation, or NULL on error.

◆ lance_operation_rewrite_rewritten_index_at()

LANCE_API int32_t lance_operation_rewrite_rewritten_index_at ( const LanceOperation * operation,
size_t index,
LanceRewrittenIndex ** out_index )

Clone one rewritten index by position.

Returns
0 on success, -1 on error.

◆ lance_operation_rewrite_rewritten_index_count()

LANCE_API int32_t lance_operation_rewrite_rewritten_index_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of rewritten indices in a Rewrite operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_schema()

LANCE_API int32_t lance_operation_schema ( const LanceOperation * operation,
struct ArrowSchema * out )

Export an Overwrite operation's schema as an Arrow C Data Interface view.

This is the existing lossy interoperability view; use lance_operation_schema_clone() when native field identities matter. The caller owns and releases the output ArrowSchema exactly once. Append has no schema; other variants return LANCE_ERR_NOT_SUPPORTED. Returns 0 on success, -1 on error.

◆ lance_operation_schema_clone()

LANCE_API int32_t lance_operation_schema_clone ( const LanceOperation * operation,
LanceSchema ** out_schema )

Clone the in-memory native schema of an Overwrite, Merge, or Project operation.

The clone preserves field and parent IDs, nested metadata, encodings, dictionary values, order, and nullability. It remains valid after the operation is closed. Other operation kinds return LANCE_ERR_NOT_SUPPORTED and leave *out_schema untouched.

Returns
0 on success, -1 on error. Close the result with lance_schema_close().

◆ lance_operation_update_bases_at()

LANCE_API int32_t lance_operation_update_bases_at ( const LanceOperation * operation,
size_t index,
LanceBasePathView * out_base )

Read one borrowed new base path from an UpdateBases operation.

path and name point into the operation handle and remain valid until it is closed. name == NULL means native None; an empty string is an explicit empty name. Returns 0 on success, -1 on error; the output slot is unchanged on error.

◆ lance_operation_update_bases_count()

LANCE_API int32_t lance_operation_update_bases_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of new base paths in an UpdateBases operation. Returns 0 on success, -1 on error; other variants return LANCE_ERR_NOT_SUPPORTED.

◆ lance_operation_update_bases_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_bases_new ( const LanceBasePath * new_bases,
size_t new_base_count )

Construct an owned native UpdateBases operation.

Each entry is parsed into native BasePath storage owned by the returned operation. A NULL array is valid only with a zero count; every non-NULL entry requires a non-NULL UTF-8 path, while name == NULL means native None.

Native commit validation owns path/name conflict detection and zero-ID allocation. This constructor adds no binding-side policy. Returns an owned operation, or NULL on error.

◆ lance_operation_update_compacted_sstable_at()

LANCE_API int32_t lance_operation_update_compacted_sstable_at ( const LanceOperation * operation,
size_t index,
LanceCompactedSsTable * out_sstable )

Copy one compacted SSTable entry by position.

Returns
0 on success, -1 on error.

◆ lance_operation_update_compacted_sstable_count()

LANCE_API int32_t lance_operation_update_compacted_sstable_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of compacted SSTable entries in an Update operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_config_config_updates()

LANCE_API int32_t lance_operation_update_config_config_updates ( const LanceOperation * operation,
LanceUpdateMap ** out_map )

Clone one UpdateConfig metadata map. On success, a NULL output means native None; an owned handle means Some, including Some(empty). Close a non-NULL result with lance_update_map_close().

◆ lance_operation_update_config_field_metadata_at()

LANCE_API int32_t lance_operation_update_config_field_metadata_at ( const LanceOperation * operation,
size_t index,
int32_t * out_field_id,
LanceUpdateMap ** out_map )

Clone one per-field UpdateMap entry. On success both outputs are written; the map must be closed independently. Both output slots are unchanged on error.

◆ lance_operation_update_config_field_metadata_count()

LANCE_API int32_t lance_operation_update_config_field_metadata_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of per-field UpdateMap entries.

◆ lance_operation_update_config_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_config_new ( const LanceUpdateConfigOperationOptions * options)

Construct an owned native UpdateConfig operation.

Each non-NULL map is cloned; NULL maps to native None and a non-NULL handle maps to Some, including an explicitly empty map. Field metadata entries are copied in input order into the native map; duplicate field IDs keep the last complete map. A NULL field array is accepted only with a zero count.

Native commit code owns replacement, incremental and None-entry semantics. Returns an owned operation, or NULL on error.

◆ lance_operation_update_config_schema_metadata_updates()

LANCE_API int32_t lance_operation_update_config_schema_metadata_updates ( const LanceOperation * operation,
LanceUpdateMap ** out_map )

Same ownership as config_updates, for schema metadata.

◆ lance_operation_update_config_table_metadata_updates()

LANCE_API int32_t lance_operation_update_config_table_metadata_updates ( const LanceOperation * operation,
LanceUpdateMap ** out_map )

Same ownership as config_updates, for table metadata.

◆ lance_operation_update_fields_for_preserving_frag_bitmap_at()

LANCE_API int32_t lance_operation_update_fields_for_preserving_frag_bitmap_at ( const LanceOperation * operation,
size_t index,
uint32_t * out_field_id )

Read one preserved-fragment-bitmap field ID by position.

Returns
0 on success, -1 on error.

◆ lance_operation_update_fields_for_preserving_frag_bitmap_count()

LANCE_API int32_t lance_operation_update_fields_for_preserving_frag_bitmap_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of preserved-fragment-bitmap field IDs in an Update.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_fields_modified_at()

LANCE_API int32_t lance_operation_update_fields_modified_at ( const LanceOperation * operation,
size_t index,
uint32_t * out_field_id )

Read one modified field ID by position.

Returns
0 on success, -1 on error.

◆ lance_operation_update_fields_modified_count()

LANCE_API int32_t lance_operation_update_fields_modified_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of modified field IDs in an Update operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_inserted_rows_filter()

LANCE_API int32_t lance_operation_update_inserted_rows_filter ( const LanceOperation * operation,
bool * out_present,
LanceKeyExistenceFilter ** out_filter )

Clone the inserted-rows key-existence filter of an Update operation.

When the native field is None, writes *out_present = false and a NULL handle. Otherwise writes 1 and an independently owned filter that the caller closes with lance_key_existence_filter_close(). Both outputs are written only on success.

Returns
0 on success, -1 on error.

◆ lance_operation_update_mem_wal_dir_id()

LANCE_API int32_t lance_operation_update_mem_wal_dir_id ( const LanceOperation * operation,
bool * out_present,
const char ** out_dir_id )

Borrow the MemWAL directory identifier named by an Update operation.

Writes *out_present = false and a NULL string when the native field is None. An empty string is a present identifier for a legacy MemWAL. *out_dir_id remains valid until the operation is closed. Both outputs are written only on success.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_mem_wal_state_compacted_sstable_at()

LANCE_API int32_t lance_operation_update_mem_wal_state_compacted_sstable_at ( const LanceOperation * operation,
size_t index,
LanceCompactedSsTable * out_sstable )

Copy one compacted SSTable entry of an UpdateMemWalState operation.

Returns
0 on success, -1 on error.

◆ lance_operation_update_mem_wal_state_compacted_sstable_count()

LANCE_API int32_t lance_operation_update_mem_wal_state_compacted_sstable_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of compacted SSTables in an UpdateMemWalState operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_mem_wal_state_dir_id()

LANCE_API int32_t lance_operation_update_mem_wal_state_dir_id ( const LanceOperation * operation,
const char ** out_dir_id )

Borrow the MemWAL directory identifier of an UpdateMemWalState operation.

An empty string denotes the legacy _mem_wal directory. The string remains valid until the operation is closed.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_mem_wal_state_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_mem_wal_state_new ( const LanceCompactedSsTable * compacted_sstables,
size_t compacted_sstable_count )

Construct an owned native UpdateMemWalState operation.

compacted_sstables uses the shared LanceCompactedSsTable value and the same native conversion as merge-insert compaction, so a caller can record flushed generations as an explicit operation. Native merge-insert validation owns shard existence, generation ordering and atomicity. A NULL array is accepted only with a zero count.

Returns
the new operation, or NULL on error.

◆ lance_operation_update_mem_wal_state_new_with_dir_id()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_mem_wal_state_new_with_dir_id ( const LanceCompactedSsTable * compacted_sstables,
size_t compacted_sstable_count,
const char * dir_id )

Construct an UpdateMemWalState operation for a specific MemWAL directory.

dir_id is required and must be valid UTF-8. Pass an empty string for a legacy MemWAL created before directory identifiers existed. Native commit rejects a stale or removed identifier.

Returns
the new operation, or NULL on error.

◆ lance_operation_update_mode()

LANCE_API int32_t lance_operation_update_mode ( const LanceOperation * operation,
bool * out_present,
int32_t * out_mode )

Read the native update mode, distinguishing absent from both variants.

Writes *out_present and, when present, the LanceUpdateMode code.

Returns
0 on success, -1 on error.

◆ lance_operation_update_new()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_new ( const LanceUpdateOperationOptions * options)

Construct an owned native Update operation.

options is required. Every fragment handle is borrowed and its complete native metadata is copied, including pre-assigned IDs, data files and deletion files. Native commit validation owns schema coverage, conflict detection and row-version behavior; this function only maps values.

Returns
the new operation, or NULL on error.

◆ lance_operation_update_new_fragment_at()

LANCE_API int32_t lance_operation_update_new_fragment_at ( const LanceOperation * operation,
size_t index,
LanceFragment ** out_fragment )

Clone one new fragment by position.

Returns
0 on success, -1 on error.

◆ lance_operation_update_new_fragment_count()

LANCE_API int32_t lance_operation_update_new_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of new fragments in an Update operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_new_with_mem_wal_dir_id()

LANCE_NODISCARD LANCE_API LanceOperation * lance_operation_update_new_with_mem_wal_dir_id ( const LanceUpdateOperationOptions * options,
const char * mem_wal_dir_id )

Construct an Update operation that names its MemWAL directory.

Identical to lance_operation_update_new() except that mem_wal_dir_id maps to native Some(...); NULL maps to None. Since Lance 15 native code requires the identifier when compacted_sstables carries compaction progress, and later rejects a stale or removed identifier at commit.

Returns
the new operation, or NULL on error.

◆ lance_operation_update_removed_fragment_count()

LANCE_API int32_t lance_operation_update_removed_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of removed fragment IDs in an Update operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_removed_fragment_id_at()

LANCE_API int32_t lance_operation_update_removed_fragment_id_at ( const LanceOperation * operation,
size_t index,
uint64_t * out_fragment_id )

Read one removed fragment ID by position.

Returns
0 on success, -1 on error.

◆ lance_operation_update_updated_fragment_at()

LANCE_API int32_t lance_operation_update_updated_fragment_at ( const LanceOperation * operation,
size_t index,
LanceFragment ** out_fragment )

Clone one updated fragment by position.

The returned handle owns a complete native fragment snapshot and remains valid after the operation handle is closed.

Returns
0 on success, -1 on error.

◆ lance_operation_update_updated_fragment_count()

LANCE_API int32_t lance_operation_update_updated_fragment_count ( const LanceOperation * operation,
uint64_t * out_count )

Read the number of updated fragments in an Update operation.

Returns
0 on success, -1 on error or a different operation kind.

◆ lance_operation_update_updated_fragment_offsets()

LANCE_API int32_t lance_operation_update_updated_fragment_offsets ( const LanceOperation * operation,
bool * out_present,
LanceUpdatedFragmentOffsets ** out_offsets )

Clone the updated-fragment offsets of an Update operation.

When the native field is None, writes *out_present = 0 and a NULL handle; otherwise writes 1 and an independently owned value, preserving the None/Some(empty)/populated distinction. Both outputs are written only on success.

Returns
0 on success, -1 on error.

◆ lance_optimize_index_merge_close()

LANCE_API void lance_optimize_index_merge_close ( LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_execute()

LANCE_API int32_t lance_optimize_index_merge_execute ( const LanceDataset * dataset,
const LanceOptimizeIndexMerge * merge,
const LanceIndexSegmentResult *const * task_results,
size_t task_result_count,
LanceIndexSegmentResult ** out_result )

Native plan/group/version checks remain authoritative.

◆ lance_optimize_index_merge_from_json()

LANCE_NODISCARD LANCE_API LanceOptimizeIndexMerge * lance_optimize_index_merge_from_json ( const char * json)

◆ lance_optimize_index_merge_group()

LANCE_API uint32_t lance_optimize_index_merge_group ( const LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_json()

LANCE_NODISCARD LANCE_API const char * lance_optimize_index_merge_json ( const LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_old_segment_at()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_merge_old_segment_at ( const LanceOptimizeIndexMerge * merge,
size_t index )

◆ lance_optimize_index_merge_old_segment_count()

LANCE_API size_t lance_optimize_index_merge_old_segment_count ( const LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_plan_id()

LANCE_API int32_t lance_optimize_index_merge_plan_id ( const LanceOptimizeIndexMerge * merge,
uint8_t out_uuid[16] )

◆ lance_optimize_index_merge_read_version()

LANCE_API uint64_t lance_optimize_index_merge_read_version ( const LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_replace_count()

LANCE_API size_t lance_optimize_index_merge_replace_count ( const LanceOptimizeIndexMerge * merge)

◆ lance_optimize_index_merge_replace_uuid_at()

LANCE_API int32_t lance_optimize_index_merge_replace_uuid_at ( const LanceOptimizeIndexMerge * merge,
size_t index,
uint8_t out_uuid[16] )

◆ lance_optimize_index_task_close()

LANCE_API void lance_optimize_index_task_close ( LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_enable_partition_rebalancing()

LANCE_API int32_t lance_optimize_index_task_enable_partition_rebalancing ( const LanceOptimizeIndexTask * task,
bool * out_value )

◆ lance_optimize_index_task_execute()

LANCE_API int32_t lance_optimize_index_task_execute ( const LanceDataset * dataset,
const LanceOptimizeIndexTask * task,
LanceIndexSegmentResult ** out_result )

*out_result receives NULL when native returns None; untouched on error.

◆ lance_optimize_index_task_fragment_count()

LANCE_API size_t lance_optimize_index_task_fragment_count ( const LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_fragment_id_at()

LANCE_API int32_t lance_optimize_index_task_fragment_id_at ( const LanceOptimizeIndexTask * task,
size_t index,
uint32_t * out_id )

◆ lance_optimize_index_task_from_json()

LANCE_NODISCARD LANCE_API LanceOptimizeIndexTask * lance_optimize_index_task_from_json ( const char * json)

◆ lance_optimize_index_task_group()

LANCE_API uint32_t lance_optimize_index_task_group ( const LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_json()

LANCE_NODISCARD LANCE_API const char * lance_optimize_index_task_json ( const LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_num_indices_to_merge()

LANCE_API int32_t lance_optimize_index_task_num_indices_to_merge ( const LanceOptimizeIndexTask * task,
bool * out_has_value,
uint64_t * out_value )

◆ lance_optimize_index_task_old_segment_at()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_task_old_segment_at ( const LanceOptimizeIndexTask * task,
size_t index )

◆ lance_optimize_index_task_old_segment_count()

LANCE_API size_t lance_optimize_index_task_old_segment_count ( const LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_plan_id()

LANCE_API int32_t lance_optimize_index_task_plan_id ( const LanceOptimizeIndexTask * task,
uint8_t out_uuid[16] )

◆ lance_optimize_index_task_read_version()

LANCE_API uint64_t lance_optimize_index_task_read_version ( const LanceOptimizeIndexTask * task)

◆ lance_optimize_index_task_reference()

LANCE_NODISCARD LANCE_API LanceIndexSegmentMetadata * lance_optimize_index_task_reference ( const LanceOptimizeIndexTask * task)

Owned LanceIndexSegmentMetadata; free with its existing free function.

◆ lance_optimize_index_task_retrain()

LANCE_API int32_t lance_optimize_index_task_retrain ( const LanceOptimizeIndexTask * task,
bool * out_value )

◆ lance_optimize_indices_options_clone()

LANCE_NODISCARD LANCE_API LanceOptimizeIndicesOptions * lance_optimize_indices_options_clone ( const LanceOptimizeIndicesOptions * options)

◆ lance_optimize_indices_options_free()

LANCE_API void lance_optimize_indices_options_free ( LanceOptimizeIndicesOptions * options)

◆ lance_optimize_indices_options_new()

LANCE_NODISCARD LANCE_API LanceOptimizeIndicesOptions * lance_optimize_indices_options_new ( void )

Create options from native OptimizeOptions::default().

◆ lance_optimize_indices_options_set_enable_partition_rebalancing()

LANCE_API int32_t lance_optimize_indices_options_set_enable_partition_rebalancing ( LanceOptimizeIndicesOptions * options,
bool value )

◆ lance_optimize_indices_options_set_index_names()

LANCE_API int32_t lance_optimize_indices_options_set_index_names ( LanceOptimizeIndicesOptions * options,
bool has_value,
const char *const * names,
size_t count )

false = native None; true + count=0 = native Some(empty).

◆ lance_optimize_indices_options_set_max_rows_per_segment()

LANCE_API int32_t lance_optimize_indices_options_set_max_rows_per_segment ( LanceOptimizeIndicesOptions * options,
bool has_value,
uint64_t value )

◆ lance_optimize_indices_options_set_max_rows_per_task()

LANCE_API int32_t lance_optimize_indices_options_set_max_rows_per_task ( LanceOptimizeIndicesOptions * options,
bool has_value,
uint64_t value )

◆ lance_optimize_indices_options_set_num_indices_to_merge()

LANCE_API int32_t lance_optimize_indices_options_set_num_indices_to_merge ( LanceOptimizeIndicesOptions * options,
bool has_value,
uint64_t value )

◆ lance_optimize_indices_options_set_retrain()

LANCE_API int32_t lance_optimize_indices_options_set_retrain ( LanceOptimizeIndicesOptions * options,
bool value )

◆ lance_optimize_indices_options_set_transaction_properties()

LANCE_API int32_t lance_optimize_indices_options_set_transaction_properties ( LanceOptimizeIndicesOptions * options,
const LanceTransactionProperties * properties )

◆ lance_optimize_indices_plan_close()

LANCE_API void lance_optimize_indices_plan_close ( LanceOptimizeIndicesPlan * plan)

◆ lance_optimize_indices_plan_from_json()

LANCE_NODISCARD LANCE_API LanceOptimizeIndicesPlan * lance_optimize_indices_plan_from_json ( const char * json)

◆ lance_optimize_indices_plan_id()

LANCE_API int32_t lance_optimize_indices_plan_id ( const LanceOptimizeIndicesPlan * plan,
uint8_t out_uuid[16] )

Copy a native UUID as 16 raw RFC 4122 bytes.

◆ lance_optimize_indices_plan_json()

LANCE_NODISCARD LANCE_API const char * lance_optimize_indices_plan_json ( const LanceOptimizeIndicesPlan * plan)

◆ lance_optimize_indices_plan_merge_at()

LANCE_NODISCARD LANCE_API LanceOptimizeIndexMerge * lance_optimize_indices_plan_merge_at ( const LanceOptimizeIndicesPlan * plan,
size_t index )

◆ lance_optimize_indices_plan_merge_count()

LANCE_API size_t lance_optimize_indices_plan_merge_count ( const LanceOptimizeIndicesPlan * plan)

◆ lance_optimize_indices_plan_read_version()

LANCE_API uint64_t lance_optimize_indices_plan_read_version ( const LanceOptimizeIndicesPlan * plan)

◆ lance_optimize_indices_plan_task_at()

LANCE_NODISCARD LANCE_API LanceOptimizeIndexTask * lance_optimize_indices_plan_task_at ( const LanceOptimizeIndicesPlan * plan,
size_t index )

◆ lance_optimize_indices_plan_task_count()

LANCE_API size_t lance_optimize_indices_plan_task_count ( const LanceOptimizeIndicesPlan * plan)

◆ lance_packed_blob_writer_blob_id()

LANCE_API uint32_t lance_packed_blob_writer_blob_id ( const LancePackedBlobWriter * writer)

Return the native packed writer blob ID.

Returns 0 and sets the thread-local error for a NULL, finished, or otherwise invalid handle. Blob ID zero is reserved, so 0 is never a success value.

◆ lance_packed_blob_writer_close()

LANCE_API void lance_packed_blob_writer_close ( LancePackedBlobWriter * writer)

Free a packed writer allocation. NULL is a no-op. Close never calls native finish; an unfinished writer is dropped with native cleanup semantics.

◆ lance_packed_blob_writer_finish_array()

LANCE_API int32_t lance_packed_blob_writer_finish_array ( LancePackedBlobWriter * writer,
const char * field_name,
struct ArrowArray * out_array,
struct ArrowSchema * out_schema )

Consume the native packed writer and export its prepared descriptor parts.

Preflight requires an active writer, a non-NULL UTF-8 field_name (empty is allowed), and non-NULL output pointers. Preflight failure leaves the writer active. Once native finish starts, the writer is consumed on every return.

On error both outputs are unchanged. On success out_array is an owned ArrowArray and out_schema is the complete native prepared field. Release each non-NULL output exactly once. The C writer allocation remains valid until close; later calls report its finished state.

Returns
0 on success, -1 on error.

◆ lance_packed_blob_writer_path()

LANCE_NODISCARD LANCE_API const char * lance_packed_blob_writer_path ( const LancePackedBlobWriter * writer)

Return a library-allocated copy of the native packed sidecar path.

Release the returned string with lance_free_string(). Returns NULL on error.

◆ lance_packed_blob_writer_write_blob()

LANCE_API int32_t lance_packed_blob_writer_write_blob ( LancePackedBlobWriter * writer,
const uint8_t * data,
size_t len )

Append one payload to the packed sidecar.

data == NULL && len == 0 is a valid empty payload. A NULL data pointer with non-zero len is rejected before native invocation. Foreign bytes are copied by the native writer before this call returns.

Native packed write failures can leave the writer without an active upload. The binding forwards that state without adding a second poison flag.

Returns
0 on success, -1 on error.

◆ lance_packed_blob_writer_write_blobs()

LANCE_API int32_t lance_packed_blob_writer_write_blobs ( LancePackedBlobWriter * writer,
struct ArrowArray * payloads,
const struct ArrowSchema * schema )

Append one packed row per payload array element.

Ownership of a non-NULL payloads transfers on every return path, including writer, schema, type, data, and native-write failures. The source slot is left in canonical released state. schema is borrowed and describes one Binary, LargeBinary, BinaryView, or FixedSizeBinary field.

Arrow null rows become native Null descriptors. Empty non-null rows become zero-size Packed descriptors. Slices, row order, and repeated calls are preserved. A C ArrowArray represents one chunk; pass chunk arrays in order.

Returns
0 on success, -1 on error.

◆ lance_path_list_at()

LANCE_NODISCARD LANCE_API const char * lance_path_list_at ( const LancePathList * list,
size_t index )

◆ lance_path_list_close()

LANCE_API void lance_path_list_close ( LancePathList * list)

◆ lance_path_list_count()

LANCE_API uint64_t lance_path_list_count ( const LancePathList * list)

◆ lance_process_bytes_read_counter()

LANCE_API uint64_t lance_process_bytes_read_counter ( void )

Native process-wide object-store bytes-read counter. This reads the same native counter as lance::io::bytes_read_counter() and has no reset semantics.

◆ lance_process_iops_counter()

LANCE_API uint64_t lance_process_iops_counter ( void )

Native process-wide object-store IOPS counter. This reads the same native counter as lance::io::iops_counter() and has no reset semantics.

◆ lance_ref_close()

LANCE_API void lance_ref_close ( LanceRef * reference)

Close and free a native reference. Safe to call with NULL.

◆ lance_ref_tag()

LANCE_NODISCARD LANCE_API LanceRef * lance_ref_tag ( const char * tag_name)

Construct Ref::Tag(tag_name). A NULL name is rejected; an empty name is passed through to the native operation for its normal validation.

◆ lance_ref_version()

LANCE_NODISCARD LANCE_API LanceRef * lance_ref_version ( const char * branch,
bool has_version,
uint64_t version )

Construct the native Ref::Version variant.

branch == NULL maps to None. has_version == false maps the version to None; otherwise version is used. The native tuple conversion normalizes "main" to the default branch. No C-side validation policy is applied here; the native operation that consumes the ref validates it.

◆ lance_ref_version_number()

LANCE_NODISCARD LANCE_API LanceRef * lance_ref_version_number ( uint64_t version)

Construct Ref::VersionNumber(version). Caller frees with lance_ref_close().

◆ lance_rest_adapter_close()

LANCE_API void lance_rest_adapter_close ( LanceRestAdapter * adapter)

Stop and destroy the adapter.

◆ lance_rest_adapter_port()

LANCE_API uint16_t lance_rest_adapter_port ( const LanceRestAdapter * adapter)

Bound port, or 0 when the adapter is not running.

◆ lance_rest_adapter_shutdown()

LANCE_API void lance_rest_adapter_shutdown ( LanceRestAdapter * adapter)

Gracefully stop the server. Idempotent; in-flight requests complete.

◆ lance_rest_adapter_start()

LANCE_API int32_t lance_rest_adapter_start ( const LanceNamespace * ns,
const char * host,
uint16_t port,
LanceRestAdapter ** out_adapter )

Start a native REST adapter over an existing namespace backend.

host NULL or empty uses the native default. port 0 binds an ephemeral port; read it with lance_rest_adapter_port. The native adapter retains the backend and its server task; close or shutdown releases them.

◆ lance_rewrite_group_clone()

LANCE_NODISCARD LANCE_API LanceRewriteGroup * lance_rewrite_group_clone ( const LanceRewriteGroup * group)

Clone an owned RewriteGroup into independent native storage.

Returns
the new group, or NULL on error.

◆ lance_rewrite_group_close()

LANCE_API void lance_rewrite_group_close ( LanceRewriteGroup * group)

Free a RewriteGroup. Safe to call with NULL.

◆ lance_rewrite_group_new()

LANCE_NODISCARD LANCE_API LanceRewriteGroup * lance_rewrite_group_new ( const LanceFragment *const * old_fragments,
size_t old_fragment_count,
const LanceFragment *const * new_fragments,
size_t new_fragment_count )

Construct an owned native RewriteGroup from two fragment arrays.

Both arrays are borrowed and every fragment's complete native metadata is copied. NULL arrays are accepted only with a zero count.

Returns
the new group, or NULL on error.

◆ lance_rewrite_group_new_fragment_at()

LANCE_API int32_t lance_rewrite_group_new_fragment_at ( const LanceRewriteGroup * group,
size_t index,
LanceFragment ** out_fragment )

Clone one replacement fragment of a RewriteGroup by position.

Returns
0 on success, -1 on error.

◆ lance_rewrite_group_new_fragment_count()

LANCE_API int32_t lance_rewrite_group_new_fragment_count ( const LanceRewriteGroup * group,
uint64_t * out_count )

Read the number of replacement fragments in a RewriteGroup.

Returns
0 on success, -1 on error.

◆ lance_rewrite_group_old_fragment_at()

LANCE_API int32_t lance_rewrite_group_old_fragment_at ( const LanceRewriteGroup * group,
size_t index,
LanceFragment ** out_fragment )

Clone one replaced fragment of a RewriteGroup by position.

Returns
0 on success, -1 on error.

◆ lance_rewrite_group_old_fragment_count()

LANCE_API int32_t lance_rewrite_group_old_fragment_count ( const LanceRewriteGroup * group,
uint64_t * out_count )

Read the number of replaced fragments in a RewriteGroup.

Returns
0 on success, -1 on error.

◆ lance_rewrite_result_close()

LANCE_API void lance_rewrite_result_close ( LanceRewriteResult * result)

◆ lance_rewrite_result_from_json()

LANCE_NODISCARD LANCE_API LanceRewriteResult * lance_rewrite_result_from_json ( const char * json)

◆ lance_rewrite_result_json()

LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_json ( const LanceRewriteResult * result)

◆ lance_rewrite_result_metrics()

LANCE_API int32_t lance_rewrite_result_metrics ( const LanceRewriteResult * result,
LanceCompactionMetrics * out_metrics )

◆ lance_rewrite_result_new_fragment_at()

LANCE_NODISCARD LANCE_API LanceFragment * lance_rewrite_result_new_fragment_at ( const LanceRewriteResult * result,
size_t index )

Clone one new fragment of a rewrite result as an owned native snapshot.

These are the staged fragments native compaction produced, so a caller can build a Rewrite group from them. The handle owns complete native metadata and remains valid after the rewrite result is closed. Returns NULL on error.

◆ lance_rewrite_result_new_fragment_count()

LANCE_API size_t lance_rewrite_result_new_fragment_count ( const LanceRewriteResult * result)

◆ lance_rewrite_result_new_fragment_metadata_json_at()

LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_new_fragment_metadata_json_at ( const LanceRewriteResult * result,
size_t index )

◆ lance_rewrite_result_original_fragment_at()

LANCE_NODISCARD LANCE_API LanceFragment * lance_rewrite_result_original_fragment_at ( const LanceRewriteResult * result,
size_t index )

Clone one original fragment of a rewrite result as an owned native snapshot.

The handle owns complete native fragment metadata and remains valid after the rewrite result is closed. Returns NULL on error.

◆ lance_rewrite_result_original_fragment_count()

LANCE_API size_t lance_rewrite_result_original_fragment_count ( const LanceRewriteResult * result)

◆ lance_rewrite_result_original_fragment_metadata_json_at()

LANCE_NODISCARD LANCE_API const char * lance_rewrite_result_original_fragment_metadata_json_at ( const LanceRewriteResult * result,
size_t index )

◆ lance_rewrite_result_read_version()

LANCE_API uint64_t lance_rewrite_result_read_version ( const LanceRewriteResult * result)

◆ lance_rewritten_index_clone()

LANCE_NODISCARD LANCE_API LanceRewrittenIndex * lance_rewritten_index_clone ( const LanceRewrittenIndex * index)

Clone an owned RewrittenIndex into independent native storage.

Returns
the new value, or NULL on error.

◆ lance_rewritten_index_close()

LANCE_API void lance_rewritten_index_close ( LanceRewrittenIndex * index)

Free a RewrittenIndex. Safe to call with NULL.

◆ lance_rewritten_index_details_type_url()

LANCE_NODISCARD LANCE_API const char * lance_rewritten_index_details_type_url ( const LanceRewrittenIndex * index)

Copy the index-details type URL.

The string is allocated with malloc and must be released with lance_free_string. Returns NULL on error or when the URL contains a NUL byte, which the native string can hold but a C string cannot.

◆ lance_rewritten_index_details_value()

LANCE_API int32_t lance_rewritten_index_details_value ( const LanceRewrittenIndex * index,
uint8_t ** out_bytes,
size_t * out_len )

Copy the index-details value bytes.

The buffer is allocated with malloc and must be released with lance_free_bytes; a zero-length value yields a NULL pointer.

Returns
0 on success, -1 on error.

◆ lance_rewritten_index_file_count()

LANCE_API int32_t lance_rewritten_index_file_count ( const LanceRewrittenIndex * index,
uint64_t * out_count )

Read the number of index files; 0 also when the native list is None.

Use lance_rewritten_index_has_files() to distinguish None from Some(empty).

Returns
0 on success, -1 on error.

◆ lance_rewritten_index_file_path_at()

LANCE_NODISCARD LANCE_API const char * lance_rewritten_index_file_path_at ( const LanceRewrittenIndex * index,
size_t position )

Copy one index-file path.

The string is allocated with malloc and must be released with lance_free_string. Returns NULL on error or when the native list is None.

◆ lance_rewritten_index_file_size_at()

LANCE_API int32_t lance_rewritten_index_file_size_at ( const LanceRewrittenIndex * index,
size_t position,
uint64_t * out_size )

Read one index-file size by position.

Returns
0 on success, -1 on error or when the native list is None.

◆ lance_rewritten_index_has_files()

LANCE_API int32_t lance_rewritten_index_has_files ( const LanceRewrittenIndex * index,
bool * out_present )

Report whether the rewritten index carries an index-file list.

Returns
0 on success, -1 on error.

◆ lance_rewritten_index_new()

LANCE_NODISCARD LANCE_API LanceRewrittenIndex * lance_rewritten_index_new ( const uint8_t * old_id,
const uint8_t * new_id,
const char * details_type_url,
const uint8_t * details_value,
size_t details_value_len,
uint32_t index_version,
bool has_index_files,
const LanceIndexFile * index_files,
size_t index_file_count )

Construct an owned native RewrittenIndex.

old_id and new_id must each point to 16 canonical UUID bytes. details_type_url is required but may be empty, matching the native prost_types::Any field; details_value may be NULL only with a zero length.

has_index_files == false maps to native None and requires a zero count. has_index_files == true with a zero count is the distinct Some(empty) state that older writers persisted, so both must be preserved. Index-file paths are copied and must be non-NULL and valid UTF-8.

Returns
the new value, or NULL on error.

◆ lance_rewritten_index_new_id()

LANCE_API int32_t lance_rewritten_index_new_id ( const LanceRewrittenIndex * index,
uint8_t * out_uuid )

Copy the new index UUID as 16 bytes into out_uuid.

Returns
0 on success, -1 on error.

◆ lance_rewritten_index_old_id()

LANCE_API int32_t lance_rewritten_index_old_id ( const LanceRewrittenIndex * index,
uint8_t * out_uuid )

Copy the old index UUID as 16 bytes into out_uuid.

Returns
0 on success, -1 on error.

◆ lance_rewritten_index_version()

LANCE_API int32_t lance_rewritten_index_version ( const LanceRewrittenIndex * index,
uint32_t * out_version )

Read the new index version.

Returns
0 on success, -1 on error.

◆ lance_scanner_full_text_search()

LANCE_API int32_t lance_scanner_full_text_search ( LanceScanner * scanner,
const char * query,
const char *const * columns,
uint32_t max_fuzzy_distance )

Set a BM25 full-text search query on the scanner.

Mutually exclusive with lance_scanner_nearest: calling either after the other returns LANCE_ERR_INVALID_ARGUMENT.

Parameters
scannerScanner handle. Must not be NULL.
queryQuery string (terms).
columnsNULL-terminated array of columns, or NULL for all FTS-indexed columns.
max_fuzzy_distance0 = exact match; >0 = MatchQuery::with_fuzziness.
Returns
0 on success, -1 on error.

◆ lance_scanner_nearest()

LANCE_API int32_t lance_scanner_nearest ( LanceScanner * scanner,
const char * column,
const void * query_data,
size_t query_len,
LanceDataType element_type,
uint32_t k )

Set the k-NN query on the scanner.

Parameters
scannerScanner handle. Must not be NULL.
columnVector column (FixedSizeList<element_type>).
query_dataPointer to a single query vector of length query_len.
query_lenNumber of elements in the query (= column dim).
element_typeElement type of the query (must match column).
kNumber of nearest neighbors to return.
Returns
0 on success, -1 on error.

◆ lance_scanner_nearest_batch()

LANCE_API int32_t lance_scanner_nearest_batch ( LanceScanner * scanner,
const char * column,
const void * query_data,
size_t dimension,
size_t num_queries,
LanceDataType element_type,
uint32_t k )

Set independent k-NN queries on a FixedSizeList<element_type, dimension> column. query_data contains dimension * num_queries aligned, row-major elements, copied before returning. Supported element types: Float16/32/64, Int8, and UInt8 (Hamming). Floating-point values must be finite and the type/dimension must match the column.

Every query returns up to k rows with a zero-based int32 query_index column and _distance, including batches of one query. Duplicate queries retain separate indices. A dataset column named query_index is rejected. No output row order is guaranteed. Index, metric, filter and search settings are shared by all queries.

dimension and k must be positive; num_queries must be in 1..=128. Copied values are bounded to 64 MiB; num_queries * k * refine_factor must be <= 100000, using 1 when refinement is unset. Explicit refinement must be positive. These are request bounds, not a total index/payload-memory limit.

Must be configured before scanning. Replaces a previous nearest query atomically; an invalid request preserves it. Mutually exclusive with FTS and global scanner limit/offset, in either configuration order. Apply per-query windows in the caller. Streams retain the existing ownership, error and early-release/cancellation contract. Returns 0 on success, -1 on error; use lance_last_error_code/message for details.

◆ lance_scanner_nearest_multivector()

LANCE_API int32_t lance_scanner_nearest_multivector ( LanceScanner * scanner,
const char * column,
const void * query_data,
size_t dimension,
size_t num_vectors,
LanceDataType element_type,
uint32_t k )

Set one multi-vector query on a List<FixedSizeList<float16|float32|float64>> column. Inner vectors must be non-nullable and contain no null elements; the outer list may be nullable. query_data contains dimension * num_vectors aligned elements in row-major order. Both sizes and k must be positive. At most 128 query subvectors are accepted; num_vectors * k and refine_factor * k must each be at most 100000. Values are copied before returning. The default metric is L2 on every fragment. Scores sum each query vector's minimum distance; refinement defaults to 1. Returns 0 on success, -1 on error. Stored invalid elements fail during execution.

◆ lance_scanner_set_approx_mode()

LANCE_API int32_t lance_scanner_set_approx_mode ( LanceScanner * scanner,
LanceApproxMode approx_mode )

Configure the speed / accuracy tradeoff for approximate vector search. Must be set before scanning starts.

◆ lance_scanner_set_distance_range()

LANCE_API int32_t lance_scanner_set_distance_range ( LanceScanner * scanner,
const float * lower_bound,
const float * upper_bound )

Restrict a single-vector nearest query to lower_bound <= _distance < upper_bound.

Call after lance_scanner_nearest and before starting the scan. Both bounds are copied before returning; NULL means unbounded on that side. Passing NULL for both clears the range. A successful replacement nearest query also clears the range. Batch/multi-vector queries and scans without nearest are rejected.

Bounds must be finite; negative distances are allowed. When both are present, lower_bound must be strictly smaller than upper_bound. Invalid calls leave the previous range unchanged. Distances use the configured metric's units (L2 is squared Euclidean distance). Results still have the nearest query's k cap; index-based search remains approximate, not an exhaustive range enumeration.

Parameters
scannerScanner with a single-vector nearest query.
lower_boundInclusive lower bound, or NULL.
upper_boundExclusive upper bound, or NULL.
Returns
0 on success, -1 on error (check lance_last_error_*).

◆ lance_scanner_set_ef()

LANCE_API int32_t lance_scanner_set_ef ( LanceScanner * scanner,
uint32_t e )

◆ lance_scanner_set_fast_search()

LANCE_API int32_t lance_scanner_set_fast_search ( LanceScanner * scanner,
bool enable )

Configure native indexed-only fast search.

This weak-consistency mode applies to vector queries, scalar-indexed filters, full-text search and MinHash search. Index-backed paths can omit unindexed data; for MinHash search it omits appended/unindexed fragments. Ordinary scans and expressions without an indexable path follow the native planner's behavior.

Lance's native fast_search() is applied before the nearest query and explicit use_index setting. For vector queries, unindexed fragments are omitted and the result is empty when no usable index is selected, including when use_index=false. Disabling restores the default native behavior. Disabled by default. Must be set before the scan starts.

Passing NULL scanner or setting this after scanning starts returns -1 and leaves the prior state unchanged.

Parameters
scannerScanner handle. Must not be NULL.
enableTrue for indexed-only search, false for native default.
Returns
0 on success, -1 on error (check lance_last_error_*).

◆ lance_scanner_set_fts_index_segments()

LANCE_API int32_t lance_scanner_set_fts_index_segments ( LanceScanner * scanner,
const uint8_t * segment_uuids,
size_t len )

Restrict a context-backed FTS scan to len context segment UUIDs supplied by the caller's planner. Pass len == 0 to clear the restriction and search all context segments. Duplicate or unknown UUIDs are rejected.

◆ lance_scanner_set_fts_query()

LANCE_API int32_t lance_scanner_set_fts_query ( LanceScanner * scanner,
const LanceFtsQuery * query )

Attach an immutable typed full-text query tree to the scanner.

The scanner snapshots the query value, so the query handle and every source child handle may be closed after this function returns successfully.

This is mutually exclusive with nearest search and with lance_scanner_set_fts_query_context(). Calling it again replaces the currently attached query. Invalid input returns an error without changing the previously attached configuration. Query-tree validation that requires planning (for example a Boolean tree with no positive clause) is reported when the scan starts.

Returns
0 on success, -1 on error.

◆ lance_scanner_set_fts_query_context()

LANCE_API int32_t lance_scanner_set_fts_query_context ( LanceScanner * scanner,
const LanceFtsQueryContext * context )

Attach a prepared process-local FTS query context. The scanner must have been created from the exact LanceDataset snapshot used to prepare the context; URI and manifest version equality is not sufficient. The scanner retains shared ownership, so the caller may close context after success. This is mutually exclusive with nearest and lance_scanner_full_text_search because the context already owns the FTS query.

◆ lance_scanner_set_index_segments()

LANCE_API int32_t lance_scanner_set_index_segments ( LanceScanner * scanner,
const uint8_t * segment_uuids,
size_t len )

Restrict the next k-NN query to a specific subset of vector index segments.

Used by distributed query engines (e.g. Velox) to fan a single k-NN query out across workers, each handling a slice of segments. The coordinator gets the segment list via lance_dataset_index_segments().

Parameters
scannerScanner handle. Must not be NULL.
segment_uuidsPointer to len 16-byte UUIDs concatenated end-to-end (total byte length = len * 16). Each UUID identifies one physical segment of a logical index.
lenNumber of UUIDs. Pass 0 (and segment_uuids may be NULL) to clear any previously-set segment restriction.
Returns
0 on success, -1 on error.

◆ lance_scanner_set_maximum_nprobes()

LANCE_API int32_t lance_scanner_set_maximum_nprobes ( LanceScanner * scanner,
uint32_t maximum_nprobes )

Set the maximum number of vector-index partitions to search. This replaces only the maximum bound; the current minimum is preserved. Must be greater than zero and no less than an explicitly configured minimum_nprobes. A conflict with only a fixed nprobes value is reported when the nearest scan is prepared. This only affects prefiltered searches that need more candidates. An invalid explicit range is rejected without changing either bound. Must be set before scanning starts.

◆ lance_scanner_set_metric()

LANCE_API int32_t lance_scanner_set_metric ( LanceScanner * scanner,
LanceMetricType metric )

◆ lance_scanner_set_minhash_query()

LANCE_API int32_t lance_scanner_set_minhash_query ( LanceScanner * scanner,
const char * column,
const char * text )

Set a native MinHash LSH text-similarity query on the scanner.

The column and text are copied and may be released after this call. A valid earlier query remains attached when this call fails. An empty column is rejected by the native query builder; an empty text is accepted by native Lance and produces no matching signatures.

The scanner limit is required when planning this query and controls the number of returned rows. Native planning searches rows with the column's MinHash LSH index, covers unindexed fragments by default, and adds _distance, equal to one minus the estimated Jaccard similarity. Filters, prefiltering, fast search, fragment scope, row masks, projection, offset, and query-combination errors follow native Lance behavior.

Parameters
scannerScanner handle. Must not be NULL.
columnText column with a MinHash LSH index. Must not be NULL or empty after native validation.
textQuery text. Must not be NULL; empty text is allowed.
Returns
0 on success, -1 on error (check lance_last_error_*).

◆ lance_scanner_set_minimum_nprobes()

LANCE_API int32_t lance_scanner_set_minimum_nprobes ( LanceScanner * scanner,
uint32_t minimum_nprobes )

Set the minimum number of vector-index partitions to search. This replaces only the minimum bound; the current maximum is preserved. Must be greater than zero and no greater than an explicitly configured maximum_nprobes. A conflict with only a fixed nprobes value is reported when the nearest scan is prepared. An invalid explicit range is rejected without changing either bound. Must be set before scanning starts.

◆ lance_scanner_set_nprobes()

LANCE_API int32_t lance_scanner_set_nprobes ( LanceScanner * scanner,
uint32_t nprobes )

Set both the minimum and maximum vector-index partition-search bounds.

This replaces both bounds configured by earlier calls to any nprobes setter. The value must be greater than zero. Must be set before scanning.

◆ lance_scanner_set_prefilter()

LANCE_API int32_t lance_scanner_set_prefilter ( LanceScanner * scanner,
bool enable )

Choose when scanner filter expressions are applied during vector or MinHash search. When enabled, filters constrain candidates before ranking; when disabled, they refine the ranked candidates afterward and may produce fewer than the configured limit. This does not change the fragment search domain set by lance_scanner_set_fragment_ids().

◆ lance_scanner_set_query_parallelism()

LANCE_API int32_t lance_scanner_set_query_parallelism ( LanceScanner * scanner,
int32_t query_parallelism )

Set vector index partition-search concurrency for each query.

A value of -1 uses the CPU pool size, 0 selects Lance's automatic policy, 1 uses the sequential path, and values greater than 1 request parallel partition search. The effective value is capped by available parallelism. Values below -1 are rejected. Must be set before scanning starts.

◆ lance_scanner_set_refine_factor()

LANCE_API int32_t lance_scanner_set_refine_factor ( LanceScanner * scanner,
uint32_t f )

◆ lance_scanner_set_scalar_index_auto_selection()

LANCE_API int32_t lance_scanner_set_scalar_index_auto_selection ( LanceScanner * scanner,
bool enabled )

◆ lance_scanner_set_scalar_index_segment()

LANCE_API int32_t lance_scanner_set_scalar_index_segment ( LanceScanner * scanner,
const uint8_t * segment_uuid )

Accelerate an ordinary scalar-filtered scan with one physical index segment. segment_uuid points to 16 UUID bytes in RFC 4122 order; NULL clears the setting. Must be configured before scanning. Requires explicit nonempty fragment_ids, which define BOTH the read and fallback domain, independently of the segment. Missing snapshot UUIDs / fragment IDs are errors. Extra segment coverage is excluded by fragment_ids; incomplete coverage falls back to a full filtered scan of those fragment_ids. Callers distributing work must assign disjoint fragment domains and separately include any unindexed data they wish to read. The segment metadata must identify one key field present in the schema.

BTree/Bitmap/LabelList searches evaluate a candidate expression on the selected logical index, including AND, OR, IN and NULL-aware NOT, and require an Exact result. LabelList supports Lance array_has/array_contains, array_has_all and array_has_any through SQL or Substrait filters with matching list element types. These functions retain Lance semantics, including for NULL search values. An AND may retain only its supported necessary conditions. OR needs candidates for both branches; NOT requires its complete indexed subtree. Expressions exceeding 128 nodes or depth 32 use the scoped fallback. Filters containing IS [NOT] TRUE/FALSE also use that fallback until the Lance planner dependency preserves their NULL semantics under negation. use_scalar_index=false skips segment search and uses the scoped fallback; snapshot UUID and fragment validation still applies. AtMost/AtLeast results fall back to a full filtered scan of fragment_ids. All predicates are reapplied during candidate reads; other scalar indices are disabled. Legacy storage, expressions without safe scoped candidates, overlays, fragment reuse, unsupported index types / result domains and missing coverage use the same domain without an index. No filter also falls back. LIMIT/OFFSET apply after the complete scanner filter, never to the unfiltered candidate set. Vector/MinHash/FTS queries and include_deleted_rows=true are rejected even when use_scalar_index=false; segment mode is live-row-only.

UUID bytes are copied. Metadata and final option compatibility are validated when creating the stream. Index corruption or I/O failures remain errors.

◆ lance_scanner_set_search_effort()

LANCE_API int32_t lance_scanner_set_search_effort ( LanceScanner * scanner,
double effort )

Set the native continuous IVF search effort.

The value must be finite and in [0, 1]. Any explicit value, including 0.5, ignores a fixed nprobes count while explicit minimum and maximum bounds remain effective, regardless of setter order. Invalid values are rejected without changing the previous configuration. Must be set before scanning. A scanner without nearest() fails when materialized.

◆ lance_scanner_set_use_index()

LANCE_API int32_t lance_scanner_set_use_index ( LanceScanner * scanner,
bool enable )

◆ lance_schema_clone()

LANCE_NODISCARD LANCE_API LanceSchema * lance_schema_clone ( const LanceSchema * schema)

Clone a native schema handle into an independently owned handle.

The clone preserves the complete native schema value, including field IDs, nested metadata, encodings, and dictionary values. It does not pass through Arrow. Returns NULL on error.

◆ lance_schema_close()

LANCE_API void lance_schema_close ( LanceSchema * schema)

Close and free a native schema handle. Safe to call with NULL.

Closing the dataset, fragment, or operation that produced the schema does not invalidate an independently cloned handle.

◆ lance_schema_field_id()

LANCE_API int32_t lance_schema_field_id ( const LanceSchema * schema,
const char * column,
int32_t * out_field_id )

Resolve a column path to its native Lance field ID.

Nested paths use native field-path syntax. On success writes *out_field_id and returns 0. On error the output slot is untouched.

◆ lance_schema_from_arrow()

LANCE_API int32_t lance_schema_from_arrow ( const struct ArrowSchema * schema,
LanceSchema ** out_schema )

Create a native schema from an Arrow C Data Interface schema.

The input schema is borrowed and not consumed. Native conversion preserves lance:field_id metadata when present and assigns fresh consecutive field IDs to fields without one, starting at one greater than the highest existing field ID (0 when none), following native Schema::try_from. The resulting schema is validated for duplicate and unknown field IDs, encodings, and primary-key metadata.

On success writes an independently owned handle to *out_schema and returns 0. On error the output slot is untouched.

◆ lance_schema_project()

LANCE_API int32_t lance_schema_project ( const LanceSchema * schema,
const char *const * columns,
size_t num_columns,
LanceSchema ** out_schema )

Project a native schema onto an ordered list of column paths.

Field paths, ordering, unknown-column errors, nested projection, and empty selection all follow native Schema::project. A NULL columns array is accepted only when num_columns == 0. Every non-NULL entry must be UTF-8. This function does not rebuild the schema through Arrow.

On success writes an independently owned handle to *out_schema and returns 0. On error the output slot is untouched.

Parameters
schemaNative schema handle. Must not be NULL.
columnsArray of column paths, or NULL when num_columns is 0.
num_columnsNumber of entries in columns.
out_schemaReceives the projected handle on success.
Returns
0 on success, -1 on error. Close the result with lance_schema_close().

◆ lance_schema_to_arrow()

LANCE_API int32_t lance_schema_to_arrow ( const LanceSchema * schema,
struct ArrowSchema * out )

Export a native schema as an Arrow C Data Interface view.

This is an interoperability view only: Arrow does not represent every native detail, including Lance field IDs and encodings. Use lance_schema_clone() or the dataset/fragment/operation schema-clone functions when the native value must be preserved. out is caller-allocated and remains caller-owned; invoke its non-NULL release callback exactly once.

Returns
0 on success, -1 on error.

◆ lance_session_close()

LANCE_API void lance_session_close ( LanceSession * session)

Close a session handle. Safe to call with NULL. Datasets previously opened with the session remain valid and retain the shared cache state.

◆ lance_session_get_approx_num_items()

LANCE_API int32_t lance_session_get_approx_num_items ( const LanceSession * session,
uint64_t * out_num_items )

Copy the approximate number of items in the session to out_num_items.

This is the native explicitly approximate inspection value. It can differ from the exact cache entry counts and may change as cache maintenance runs. The output is written only on success.

Returns
0 on success, -1 on error

◆ lance_session_get_cache_stats()

LANCE_API int32_t lance_session_get_cache_stats ( const LanceSession * session,
LanceSessionCacheStats * out_stats )

Copy current cache statistics to out_stats.

Returns
0 on success, -1 on error

◆ lance_session_get_size_bytes()

LANCE_API int32_t lance_session_get_size_bytes ( const LanceSession * session,
uint64_t * out_size_bytes )

Copy the current deep size of the session to out_size_bytes.

This walks live cache contents and includes retained session state. It is not an RSS measurement or a configured capacity limit. The output is written only on success.

Returns
0 on success, -1 on error

◆ lance_session_new()

LANCE_NODISCARD LANCE_API LanceSession * lance_session_new ( uint64_t index_cache_size_bytes,
uint64_t metadata_cache_size_bytes )

Create a session that can share metadata and index caches across datasets.

Cache limits are specified in bytes. Pass 0 to request zero capacity.

Returns
Session handle, or NULL on error

◆ lance_session_new_with_cache_specs()

LANCE_NODISCARD LANCE_API LanceSession * lance_session_new_with_cache_specs ( const LanceSessionCacheSpec * index_cache,
const LanceSessionCacheSpec * metadata_cache )

Create a session with independent cache configuration for each tier.

Each spec maps to the native Lance CacheSpec: DEFAULT uses the tier default, SIZE uses the native default in-memory backend with an explicit capacity, and URI/CONFIG build a backend through the native cache registry. Backend URI parsing, kind normalization, option validation, and unknown-kind errors come from Lance core.

Both spec pointers must be non-NULL. The specs and all buffers they reference are borrowed only for this call.

Returns
Session handle, or NULL on error

◆ lance_shard_writer_close()

LANCE_API int32_t lance_shard_writer_close ( LanceShardWriter * writer)

Flush and close the native writer.

The native writer is consumed on every result. A later close succeeds, even after an earlier failure; the first call reports its own native error. Pending WAL and MemTable failures surface from this call. stats remains available afterwards; MemTable-only operations do not.

◆ lance_shard_writer_delete()

LANCE_API int32_t lance_shard_writer_delete ( LanceShardWriter * writer,
struct ArrowArrayStream * stream,
LanceShardWriteResult * out_result )

Delete rows by primary key from an Arrow stream.

Same stream ownership and result rules as lance_shard_writer_put().

◆ lance_shard_writer_free()

LANCE_API void lance_shard_writer_free ( LanceShardWriter * writer)

Stop a live writer's native background tasks and free its allocation. Waits for in-progress native work to settle. Close first for durability; free requests native abort without a final flush. NULL-safe.

◆ lance_shard_writer_lsm_scanner()

LANCE_API int32_t lance_shard_writer_lsm_scanner ( LanceShardWriter * writer,
const LanceMemWalShardSnapshot *const * snapshots,
size_t num_snapshots,
LanceLsmScanner ** out )

Create an LSM scanner over the supplied snapshots plus this writer's latest manifest, and attach the writer's active plus frozen-awaiting-flush MemTables. A snapshot with the same shard id is replaced by the writer's latest state. The scanner retains the captured native owners after the writer closes.

◆ lance_shard_writer_memtable_stats()

LANCE_API int32_t lance_shard_writer_memtable_stats ( const LanceShardWriter * writer,
LanceShardMemTableStats * out )

Snapshot live MemTable and memory statistics.

Requires a live native writer; after close this returns LANCE_ERR_INVALID_ARGUMENT "ShardWriter is already closed". Unsupported in WAL-only writers, where native returns its own error.

◆ lance_shard_writer_open()

LANCE_API int32_t lance_shard_writer_open ( LanceDataset * dataset,
const char * shard_id,
const LanceShardWriterConfig * config,
LanceShardWriter ** out )

Open a native shard writer for one shard.

Resolves the MemWAL index, sharding spec, maintained index set, store parameters and session from the dataset. A NULL config selects native ShardWriterConfig::default(). out is written only on success; the caller owns the writer and frees it with lance_shard_writer_free().

◆ lance_shard_writer_put()

LANCE_API int32_t lance_shard_writer_put ( LanceShardWriter * writer,
struct ArrowArrayStream * stream,
LanceShardWriteResult * out_result )

Write batches from an Arrow stream.

The stream is consumed on every return once writer is non-NULL, including error paths. An empty stream is rejected by native code. out_result is optional; when non-NULL it is written only on success.

◆ lance_shard_writer_shard_id()

LANCE_NODISCARD LANCE_API const char * lance_shard_writer_shard_id ( const LanceShardWriter * writer)

Borrow the writer's canonical shard UUID string.

◆ lance_shard_writer_snapshot()

LANCE_API int32_t lance_shard_writer_snapshot ( const LanceShardWriter * writer,
LanceMemWalShardSnapshot ** out )

Build a snapshot from the writer's latest manifest.

Returns 0 with *out == NULL when the shard has no manifest yet. On success with a value, the caller owns *out.

◆ lance_shard_writer_stats()

LANCE_API int32_t lance_shard_writer_stats ( const LanceShardWriter * writer,
LanceShardWriterStats * out )

Snapshot native write counters.

Available after a successful close because the native SharedWriteStats owner is retained by the handle.

◆ lance_simd_info_json()

LANCE_NODISCARD LANCE_API const char * lance_simd_info_json ( void )

Return native lance_core::utils::cpu::simd_info() as a JSON object with exactly tier (native Display string), target_arch, and host_features (native order). No C-side detection or cache is involved. The returned string is owned by the caller; free it with lance_free_string().

◆ lance_sql_query_builder_build()

LANCE_API int32_t lance_sql_query_builder_build ( LanceSqlQueryBuilder * builder,
LanceSqlQuery ** out_query )

Plan the configured query and consume builder on every return path, including foreign-pointer errors and native planning failures. The caller must not use the builder after this call. On success *out_query receives an independently owned query handle (close it with lance_sql_query_close); on error the slot is left unchanged.

Native planning classifies malformed SQL as invalid input. Batch-size validation happens here.

Returns 0 on success, -1 on error.

◆ lance_sql_query_builder_close()

LANCE_API void lance_sql_query_builder_close ( LanceSqlQueryBuilder * builder)

Close a SQL builder handle. NULL-safe. Close exactly once. lance_sql_query_builder_build consumes the allocation, so a consumed builder must not be closed.

◆ lance_sql_query_builder_set_batch_size()

LANCE_API int32_t lance_sql_query_builder_set_batch_size ( LanceSqlQueryBuilder * builder,
uint64_t batch_size )

Set the native target output batch size (rows). The native builder validates the value's range when the query is built; a value that does not fit the native usize is rejected here and the builder keeps its prior value.

Returns 0 on success, -1 on error.

◆ lance_sql_query_builder_set_batch_size_bytes()

LANCE_API int32_t lance_sql_query_builder_set_batch_size_bytes ( LanceSqlQueryBuilder * builder,
uint64_t batch_size_bytes )

Set the native target output batch size in bytes. Not set (native None) until called; the native builder owns the value's interpretation and validation.

Returns 0 on success, -1 on error.

◆ lance_sql_query_builder_set_blob_handling()

LANCE_API int32_t lance_sql_query_builder_set_blob_handling ( LanceSqlQueryBuilder * builder,
LanceBlobHandling handling )

Set how blob columns are materialized, as a LanceBlobHandling value: LANCE_BLOB_HANDLING_BLOBS_DESCRIPTIONS (0, the native default), ALL_BINARY (1) or ALL_DESCRIPTIONS (2). Other values are rejected and the builder keeps its prior handling. Passed to the native builder unchanged.

Returns 0 on success, -1 on error.

◆ lance_sql_query_builder_set_table_name()

LANCE_API int32_t lance_sql_query_builder_set_table_name ( LanceSqlQueryBuilder * builder,
const char * table_name )

Name the table in the SELECT statement. The string is copied. An empty name is passed to native unchanged. The native default is "dataset".

Returns 0 on success, -1 on error. A NULL name is rejected and the builder keeps its prior table name.

◆ lance_sql_query_builder_set_with_row_addr()

LANCE_API int32_t lance_sql_query_builder_set_with_row_addr ( LanceSqlQueryBuilder * builder,
bool enabled )

Ask the native planner to inject the _rowaddr system column into the scan output where it is safe to do so. Passed to the native builder unchanged.

Returns 0 on success, -1 on error.

◆ lance_sql_query_builder_set_with_row_id()

LANCE_API int32_t lance_sql_query_builder_set_with_row_id ( LanceSqlQueryBuilder * builder,
bool enabled )

Ask the native planner to inject the _rowid system column into the scan output where it is safe to do so. Passed to the native builder unchanged.

Returns 0 on success, -1 on error.

◆ lance_sql_query_close()

LANCE_API void lance_sql_query_close ( LanceSqlQuery * query)

Close a SQL query handle. NULL-safe. Close exactly once. lance_sql_query_into_stream consumes the allocation, so a consumed query must not be closed.

◆ lance_sql_query_into_stream()

LANCE_API int32_t lance_sql_query_into_stream ( LanceSqlQuery * query,
struct ArrowArrayStream * out_stream )

Move the query's native stream into *out_stream, consuming query on every return path. The caller must not use the query after this call. On success *out_stream is an Arrow C stream owned by the caller (release it exactly once); it keeps the query's dataset snapshot alive and remains valid after the query, builder and dataset handles close. On error the stream slot is left unchanged.

The stream is not materialized here; batches are produced lazily by the native execution plan. Malformed queries can also fail at this native physical-planning stage.

Returns 0 on success, -1 on error.

◆ lance_storage_options_accessor_close()

LANCE_API void lance_storage_options_accessor_close ( LanceStorageOptionsAccessor * accessor)

◆ lance_storage_options_accessor_new()

LANCE_NODISCARD LANCE_API LanceStorageOptionsAccessor * lance_storage_options_accessor_new ( const LanceStorageOptionsInput * initial,
const LanceStorageOptionsProvider * provider )

◆ lance_storage_options_accessor_snapshot()

LANCE_NODISCARD LANCE_API LanceStorageOptionsSnapshot * lance_storage_options_accessor_snapshot ( const LanceStorageOptionsAccessor * accessor)

Resolve and copy the accessor's current options.

Native StorageOptionsAccessor owns caching and expiration policy. The binding keeps no second refresh cache. A NULL accessor or provider error returns NULL and sets the thread-local error.

◆ lance_storage_options_provider_close()

LANCE_API void lance_storage_options_provider_close ( LanceStorageOptionsProvider * provider)

◆ lance_storage_options_provider_id()

LANCE_NODISCARD LANCE_API char * lance_storage_options_provider_id ( const LanceStorageOptionsProvider * provider)

Return the native provider identity as a copied string.

Free with lance_free_string. Returns NULL on invalid input or allocation failure.

◆ lance_storage_options_provider_new()

LANCE_NODISCARD LANCE_API LanceStorageOptionsProvider * lance_storage_options_provider_new ( const LanceStorageOptionsProviderSpec * spec)

◆ lance_storage_options_snapshot_close()

LANCE_API void lance_storage_options_snapshot_close ( LanceStorageOptionsSnapshot * snapshot)

◆ lance_storage_options_snapshot_count()

LANCE_API uint64_t lance_storage_options_snapshot_count ( const LanceStorageOptionsSnapshot * snapshot)

◆ lance_storage_options_snapshot_has_options()

LANCE_API int32_t lance_storage_options_snapshot_has_options ( const LanceStorageOptionsSnapshot * snapshot)

1 = Some, 0 = None, -1 = invalid handle with thread-local error.

◆ lance_storage_options_snapshot_key_at()

LANCE_NODISCARD LANCE_API const char * lance_storage_options_snapshot_key_at ( const LanceStorageOptionsSnapshot * snapshot,
size_t index )

◆ lance_storage_options_snapshot_value_at()

LANCE_NODISCARD LANCE_API const char * lance_storage_options_snapshot_value_at ( const LanceStorageOptionsSnapshot * snapshot,
size_t index )

◆ lance_tag_branch()

LANCE_API int32_t lance_tag_branch ( const LanceTag * tag,
const char ** out_branch )

Report the tag's optional branch.

Returns 1 and writes a borrowed branch when present, 0 and writes NULL when absent, or -1 on error. The branch remains valid until the tag is closed.

◆ lance_tag_close()

LANCE_API void lance_tag_close ( LanceTag * tag)

Close and free one tag handle. Safe to call with NULL.

◆ lance_tag_created_at_ns()

LANCE_API int32_t lance_tag_created_at_ns ( const LanceTag * tag,
int64_t * out_timestamp_ns )

Report the optional creation timestamp as Unix epoch nanoseconds. Returns 1 when present, 0 when absent, or -1 on error. A present timestamp outside the i64 nanosecond range returns -1 with LANCE_ERR_INVALID_ARGUMENT. On absence or error, the output is unchanged.

◆ lance_tag_manifest_size()

LANCE_API uint64_t lance_tag_manifest_size ( const LanceTag * tag)

Manifest size recorded in the tag, or 0 on error.

◆ lance_tag_metadata_count()

LANCE_API uint64_t lance_tag_metadata_count ( const LanceTag * tag)

Number of tag metadata entries, or 0 on error. Missing metadata and an empty map both produce zero entries, matching native TagContents deserialization.

◆ lance_tag_metadata_key_at()

LANCE_NODISCARD LANCE_API const char * lance_tag_metadata_key_at ( const LanceTag * tag,
size_t index )

Metadata key at index, borrowed until the tag is closed. NULL on error.

◆ lance_tag_metadata_value_at()

LANCE_NODISCARD LANCE_API const char * lance_tag_metadata_value_at ( const LanceTag * tag,
size_t index )

Metadata value at index, borrowed until the tag is closed. NULL on error.

◆ lance_tag_name()

LANCE_NODISCARD LANCE_API const char * lance_tag_name ( const LanceTag * tag)

Tag name, borrowed until the tag handle is closed. NULL on error.

◆ lance_tag_updated_at_ns()

LANCE_API int32_t lance_tag_updated_at_ns ( const LanceTag * tag,
int64_t * out_timestamp_ns )

Report the optional update timestamp as Unix epoch nanoseconds. Returns 1 when present, 0 when absent, or -1 on error. A present timestamp outside the i64 nanosecond range returns -1 with LANCE_ERR_INVALID_ARGUMENT. On absence or error, the output is unchanged.

◆ lance_tag_version()

LANCE_API uint64_t lance_tag_version ( const LanceTag * tag)

Tagged version id, or 0 on error.

◆ lance_tags_at()

LANCE_NODISCARD LANCE_API const LanceTag * lance_tags_at ( const LanceTags * tags,
size_t index )

Borrowed tag at index (0 <= index < count), or NULL on error. The pointer remains valid until lance_tags_close().

◆ lance_tags_close()

LANCE_API void lance_tags_close ( LanceTags * tags)

Close and free a tag-list snapshot. Safe to call with NULL.

◆ lance_tags_count()

LANCE_API uint64_t lance_tags_count ( const LanceTags * tags)

Number of tags, or 0 on error (check lance_last_error_code()).

◆ lance_transaction_array_free()

LANCE_API void lance_transaction_array_free ( LanceTransaction ** transactions,
size_t count )

Free a transaction array produced by lance_dataset_delta_list_transactions, closing each non-NULL transaction handle and the array allocation. NULL and zero-length arrays are no-ops. Call exactly once with the exact pointer and count returned by list_transactions.

◆ lance_transaction_close()

LANCE_API void lance_transaction_close ( LanceTransaction * transaction)

Close a transaction handle. NULL-safe. Close exactly once.

◆ lance_transaction_commit()

LANCE_API int32_t lance_transaction_commit ( const char * uri,
const LanceTransaction * transaction,
const LanceCommitOptions * options,
const char *const * storage_opts,
const LanceSession * session,
LanceDataset ** out_dataset )

Publish one native transaction through CommitBuilder::execute.

transaction is borrowed and cloned by the native builder; closing it after a successful or failed call is the caller's choice and never invalidates a returned dataset. options may be NULL for native commit defaults. storage_opts and session configure URI resolution and caches.

On success *out_dataset receives an independently owned dataset at the committed version and is written only on success. Commit eligibility, conflict resolution, retries, detached versions, cleanup and normalization are native.

A failed publish performs no binding-side rollback. Uncommitted data files may remain, and an I/O failure can leave the resulting version uncertain. Reopen the URI to establish the actual committed state before retrying.

Returns
0 on success, -1 on error.

◆ lance_transaction_commit_batch()

LANCE_API int32_t lance_transaction_commit_batch ( const char * uri,
const LanceTransaction *const * transactions,
size_t transaction_count,
const LanceCommitOptions * options,
const char *const * storage_opts,
const LanceSession * session,
LanceDataset ** out_dataset,
LanceTransaction ** out_merged_transaction )

Publish append transactions through CommitBuilder::execute_batch.

Each input transaction is borrowed and cloned. Native batch rules determine eligibility, merge order, conflicts, retries and the merged read version. Non-append batches return LANCE_ERR_NOT_SUPPORTED; an empty batch returns the native invalid-input error. Both output pointers are required.

On success the actual merged transaction and an independently owned dataset are written to the output slots. Both slots are unchanged on error.

Parameters
uriDataset URI. Must not be NULL or empty.
transactionsArray of transaction_count non-NULL handles.
transaction_countNumber of handles in transactions.
optionsCommit options, or NULL for native defaults.
storage_optsNULL-terminated key/value storage options, or NULL for native defaults.
sessionShared session, or NULL for the default session.
out_datasetReceives the committed dataset; must not be NULL.
out_merged_transactionReceives the merged transaction; must not be NULL.
Returns
0 on success, -1 on error.

◆ lance_transaction_commit_batch_with_accessor()

LANCE_API int32_t lance_transaction_commit_batch_with_accessor ( const char * uri,
const LanceTransaction *const * transactions,
size_t transaction_count,
const LanceCommitOptions * options,
const LanceStorageOptionsAccessor * storage_options_accessor,
const LanceSession * session,
LanceDataset ** out_dataset,
LanceTransaction ** out_merged_transaction )

Same as lance_transaction_commit_batch but attaches a native dynamic storage-options accessor instead of static storage_opts. The returned dataset retains the accessor and provider; the merged transaction carries transaction metadata only. A NULL accessor uses native defaults. All eligibility, merge and output rules match lance_transaction_commit_batch.

◆ lance_transaction_commit_batch_with_commit_lock()

LANCE_API int32_t lance_transaction_commit_batch_with_commit_lock ( const char * uri,
const LanceTransaction *const * transactions,
size_t transaction_count,
const LanceCommitOptions * options,
const LanceStorageOptionsAccessor * storage_accessor,
const LanceSession * session,
const LanceCommitLock * commit_lock,
LanceDataset ** out_dataset,
LanceTransaction ** out_merged_transaction )

Publish append transactions through a foreign commit lock and an optional dynamic storage-options accessor.

Eligibility, merge order, conflicts, retries and the merged read version stay native. Both output pointers are required and written only on success.

Returns
0 on success, -1 on error

◆ lance_transaction_commit_namespace_uri()

LANCE_API int32_t lance_transaction_commit_namespace_uri ( const LanceNamespace * ns,
const char * table_id_json,
const char * uri,
const LanceTransaction * transaction,
const LanceCommitOptions * options,
const char *const * storage_opts,
const LanceSession * session,
LanceDataset ** out_dataset )

Commit a transaction to a namespace-managed table URI.

Uses LanceNamespaceExternalManifestStore::for_table_uri and the native ExternalManifestCommitHandler, then reuses CommitBuilder option conversion, storage options, session, retries and transaction semantics. Use the namespace open/write entry points for normal access; a namespace-opened dataset keeps its native commit handler.

◆ lance_transaction_commit_with_accessor()

LANCE_API int32_t lance_transaction_commit_with_accessor ( const char * uri,
const LanceTransaction * transaction,
const LanceCommitOptions * options,
const LanceStorageOptionsAccessor * storage_options_accessor,
const LanceSession * session,
LanceDataset ** out_dataset )

Same as lance_transaction_commit but attaches a native dynamic storage-options accessor instead of static storage_opts. The returned dataset retains the accessor and provider; later I/O follows native refresh, error and cache semantics. A NULL accessor uses native defaults. Static options belong in the accessor's initial options. Transaction ownership and failure/rollback behavior match lance_transaction_commit.

◆ lance_transaction_commit_with_commit_lock()

LANCE_API int32_t lance_transaction_commit_with_commit_lock ( const char * uri,
const LanceTransaction * transaction,
const LanceCommitOptions * options,
const LanceStorageOptionsAccessor * storage_accessor,
const LanceSession * session,
const LanceCommitLock * commit_lock,
LanceDataset ** out_dataset )

Publish one native transaction through a foreign commit lock and an optional dynamic storage-options accessor.

Conflict detection, retries, manifest construction, cancellation and the final version stay native. A NULL lock or a NULL/empty accessor keeps the corresponding native default. session may be NULL.

Output and failure semantics match lance_transaction_commit: the dataset is written only on success, and the caller must reopen the URI to establish the committed state after an I/O failure.

Returns
0 on success, -1 on error

◆ lance_transaction_from_proto()

LANCE_NODISCARD LANCE_API LanceTransaction * lance_transaction_from_proto ( const uint8_t * bytes,
size_t len )

Parse one complete protobuf Transaction through the selected core's native conversion.

Empty input decodes to the native default transaction with an Unknown operation. NULL bytes with a non-zero length is invalid. The length must fit a Rust slice (at most PTRDIFF_MAX). Unknown protobuf oneof variants become Operation::Unknown: they can be inspected but cannot be serialized again or committed. The returned handle must be closed exactly once. Returns NULL on error.

◆ lance_transaction_has_properties()

LANCE_API int32_t lance_transaction_has_properties ( const LanceTransaction * transaction,
bool * out_has_properties )

Report whether native transaction properties are Some, including Some(empty). An absent map is distinct from an empty map. Returns 0 on success, -1 on error.

◆ lance_transaction_new()

LANCE_NODISCARD LANCE_API LanceTransaction * lance_transaction_new ( uint64_t read_version,
const LanceOperation * operation,
const LanceTransactionOptions * options )

Construct an owned native transaction from an operation.

The operation is cloned and remains usable. options == NULL selects a generated UUID, no tag and no transaction properties. A non-NULL options value applies its documented UUID/tag/property mapping. Native TransactionBuilder construction and later commit validation remain authoritative. Returns an owned transaction, or NULL on error.

◆ lance_transaction_operation()

LANCE_API int32_t lance_transaction_operation ( const LanceTransaction * transaction,
LanceOperation ** out_operation )

Clone the transaction operation into an independent owned handle. Returns 0 on success, -1 on error; the output slot is success-only.

◆ lance_transaction_property_count()

LANCE_API int32_t lance_transaction_property_count ( const LanceTransaction * transaction,
uint64_t * out_count )

Read the transaction property count. The count is 0 for both None and Some(empty); use lance_transaction_has_properties() to distinguish. Returns 0 on success, -1 on error.

◆ lance_transaction_property_key_at()

LANCE_NODISCARD LANCE_API const char * lance_transaction_property_key_at ( const LanceTransaction * transaction,
size_t index )

Return a newly allocated property key at index. Map order is unspecified but stable for the handle. Caller frees with lance_free_string(). Returns NULL on error, including an out-of-range index.

◆ lance_transaction_property_value_at()

LANCE_NODISCARD LANCE_API const char * lance_transaction_property_value_at ( const LanceTransaction * transaction,
size_t index )

Return a newly allocated property value at index. Map order is unspecified but stable for the handle. Caller frees with lance_free_string(). Returns NULL on error, including an out-of-range index.

◆ lance_transaction_read_version()

LANCE_API int32_t lance_transaction_read_version ( const LanceTransaction * transaction,
uint64_t * out_read_version )

Read the native transaction read version. Returns 0 on success, -1 on error. Zero is valid for an uncommitted create.

◆ lance_transaction_tag()

LANCE_API int32_t lance_transaction_tag ( const LanceTransaction * transaction,
const char ** out_tag )

Copy the optional native transaction tag.

Returns 1 and a newly allocated string through out_tag when present, 0 and NULL when absent, or -1 on error. The caller frees a present string with lance_free_string(). Absent and empty are distinct native Option values, though native protobuf decoding normalizes an encoded empty tag to absent.

◆ lance_transaction_to_proto()

LANCE_API int32_t lance_transaction_to_proto ( const LanceTransaction * transaction,
uint8_t ** out_bytes,
size_t * out_len )

Serialize a transaction through the selected core's TryFrom<&Transaction> for pb.Transaction conversion.

On success, *out_bytes receives a malloc-compatible allocation and *out_len its length; free with lance_free_bytes(). Both output slots are unchanged on error.

Conversion boundaries are the native contract: Operation::Unknown cannot be encoded and returns LANCE_ERR_NOT_SUPPORTED. Empty tags/property maps normalize to absent on decode. The selected core does not carry Overwrite schema metadata through its separate protobuf field. Consumers must treat this as native transport, not a lossless object serialization.

Returns
0 on success, -1 on error.

◆ lance_transaction_uuid()

LANCE_NODISCARD LANCE_API const char * lance_transaction_uuid ( const LanceTransaction * transaction)

Return a newly allocated copy of the native transaction UUID. Caller frees with lance_free_string(). Returns NULL on error.

◆ lance_update_map_clone()

LANCE_NODISCARD LANCE_API LanceUpdateMap * lance_update_map_clone ( const LanceUpdateMap * map)

Clone an update map into an independent snapshot. The clone stays valid after the source is closed. Returns NULL on error; close the result exactly once.

◆ lance_update_map_close()

LANCE_API void lance_update_map_close ( LanceUpdateMap * map)

Close an update map handle. NULL-safe. Close exactly once.

◆ lance_update_map_count()

LANCE_API size_t lance_update_map_count ( const LanceUpdateMap * map)

Read the number of native update entries. Returns 0 on error; check lance_last_error_code(). Zero is also a valid entry count.

◆ lance_update_map_key_at()

LANCE_NODISCARD LANCE_API const char * lance_update_map_key_at ( const LanceUpdateMap * map,
size_t index )

Read one borrowed entry key. The pointer remains valid until the map handle is closed. Returns NULL on error, including a key that is not representable as a C string.

◆ lance_update_map_new()

LANCE_NODISCARD LANCE_API LanceUpdateMap * lance_update_map_new ( const char *const * keys,
const char *const * values,
size_t count,
bool replace )

Construct an owned native update map.

keys and values are parallel arrays of length count; count == 0 accepts a NULL array for either. Every key must be non-NULL UTF-8. A NULL value entry represents native None (remove the key); a non-NULL value, including an empty string, is native Some. Duplicate keys and entry order are retained; native commit code interprets them.

Returns an owned map, or NULL on error.

◆ lance_update_map_replace()

LANCE_API bool lance_update_map_replace ( const LanceUpdateMap * map)

Read the native replacement flag: true replaces the target map, false applies entries incrementally. Returns false on error; check lance_last_error_code().

◆ lance_update_map_value_at()

LANCE_API int32_t lance_update_map_value_at ( const LanceUpdateMap * map,
size_t index,
bool * out_has_value,
const char ** out_value )

Read one borrowed entry value. Both output pointers are required. On success *out_has_value reports native Some/None; *out_value is a borrowed pointer when present and NULL otherwise. Both outputs are unchanged on error. Returns 0 on success, -1 on error.

◆ lance_updated_fragment_offsets_clone()

LANCE_NODISCARD LANCE_API LanceUpdatedFragmentOffsets * lance_updated_fragment_offsets_clone ( const LanceUpdatedFragmentOffsets * offsets)

Clone an owned UpdatedFragmentOffsets into independent native storage.

Returns
the new value, or NULL on error.

◆ lance_updated_fragment_offsets_close()

LANCE_API void lance_updated_fragment_offsets_close ( LanceUpdatedFragmentOffsets * offsets)

Free an UpdatedFragmentOffsets value. Safe to call with NULL.

◆ lance_updated_fragment_offsets_copy_at()

LANCE_API int32_t lance_updated_fragment_offsets_copy_at ( const LanceUpdatedFragmentOffsets * offsets,
size_t index,
uint32_t * out_offsets,
size_t count )

Copy all offsets for one entry in ascending native bitmap order.

The caller owns out_offsets, with count writable uint32_t elements. count must equal the value written by lance_updated_fragment_offsets_offset_count_at() for the same index. NULL out_offsets is valid for a valid empty entry with count == 0. Repeated input offsets remain collapsed into the native set, and values remain valid after the source handle is closed.

Returns
0 on success, -1 on error. The output buffer is unchanged on error.

◆ lance_updated_fragment_offsets_count()

LANCE_API int32_t lance_updated_fragment_offsets_count ( const LanceUpdatedFragmentOffsets * offsets,
uint64_t * out_count )

Read the number of fragment entries.

Returns
0 on success, -1 on error.

◆ lance_updated_fragment_offsets_fragment_id_at()

LANCE_API int32_t lance_updated_fragment_offsets_fragment_id_at ( const LanceUpdatedFragmentOffsets * offsets,
size_t index,
uint64_t * out_fragment_id )

Read one fragment ID by entry index. Entry order is unspecified.

Returns
0 on success, -1 on error.

◆ lance_updated_fragment_offsets_new()

LANCE_NODISCARD LANCE_API LanceUpdatedFragmentOffsets * lance_updated_fragment_offsets_new ( const LanceFragmentOffsetsView * entries,
size_t entry_count )

Construct owned native UpdatedFragmentOffsets from ordered entries.

Entries and their offset arrays are copied before this function returns, and the result does not borrow from them. A repeated fragment_id keeps the last entry, matching the native HashMap representation. Some(empty) and an empty bitmap entry are both representable; only an explicit protobuf round trip normalizes an all-empty value to native None.

Returns
the new value, or NULL on error.

◆ lance_updated_fragment_offsets_offset_at()

LANCE_API int32_t lance_updated_fragment_offsets_offset_at ( const LanceUpdatedFragmentOffsets * offsets,
size_t index,
size_t position,
uint32_t * out_offset )

Read one offset by entry index and ascending offset position.

Native bitmaps are ordered, so position 0 is the smallest offset of that fragment entry. For all offsets, prefer lance_updated_fragment_offsets_copy_at() to avoid restarting the bitmap traversal for each index.

Returns
0 on success, -1 on error.

◆ lance_updated_fragment_offsets_offset_count_at()

LANCE_API int32_t lance_updated_fragment_offsets_offset_count_at ( const LanceUpdatedFragmentOffsets * offsets,
size_t index,
uint64_t * out_count )

Read the number of offsets recorded at one entry index.

Returns
0 on success, -1 on error.

◆ lance_write_fragments()

LANCE_API int32_t lance_write_fragments ( const char * uri,
const struct ArrowSchema * schema,
struct ArrowArrayStream * stream,
const char *const * storage_opts )

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

Designed for embedded / robotics C++ pipelines: write Lance fragment files locally with minimal overhead. A separate Rust finalizer process later reconstructs Fragment metadata from the file footers and commits them into a dataset on a remote data lake via CommitBuilder.

The data is written but NOT committed — no dataset manifest is created or updated. The written .lance files under <uri>/data/ contain full metadata in their footers (schema with field IDs, row counts, format version).

Parameters
uriDirectory URI for fragment files (file://, s3://, etc.)
schemaRequired Arrow schema. The stream schema must match or the call fails with LANCE_ERR_INVALID_ARGUMENT.
streamArrow C Data Interface stream; consumed by this call — do not use the stream after returning.
storage_optsNULL-terminated key-value pairs ["k","v",NULL], or NULL.
Returns
0 on success, -1 on error

Variable Documentation

◆ column

const char* column

Definition at line 6236 of file lance.h.

◆ coverage_mode

const char const char uint32_t int32_t coverage_mode

Definition at line 6239 of file lance.h.

◆ max_fuzzy_distance

const char const char uint32_t max_fuzzy_distance

Definition at line 6238 of file lance.h.

◆ query

const char const char* query

Definition at line 6237 of file lance.h.