Skip to main content
Version: Next

API Reference

Complete API reference for the Fluss C++ client.

Result​

Field / MethodTypeDescription
error_codeint32_t0 for success, non-zero for errors
error_messagestd::stringHuman-readable error description
Ok()boolReturns true if operation succeeded (error_code == 0)

Configuration​

FieldTypeDefaultDescription
bootstrap_serversstd::string"127.0.0.1:9123"Coordinator server address
writer_request_max_sizeint32_t10485760 (10 MB)Maximum request size in bytes
writer_acksstd::string"all"Acknowledgment setting ("all", "0", "1", or "-1")
writer_retriesint32_tINT32_MAXNumber of retries on failure
writer_batch_sizeint32_t2097152 (2 MB)Batch size for writes in bytes. Upper bound when dynamic sizing is on; fixed batch size when off
writer_dynamic_batch_size_enabledbooltrueEnable per-table dynamic batch sizing: target grows 10% above 80% fill, shrinks 5% below 50%
writer_dynamic_batch_size_minint32_t262144 (256 KB)Lower bound for the dynamic batch size estimator (ignored when disabled)
writer_batch_timeout_msint64_t100Maximum time in ms to wait for a writer batch to fill up before sending
writer_bucket_no_key_assignerstd::string"sticky"Bucket assignment strategy for tables without bucket keys: "sticky" or "round_robin"
writer_dynamic_create_partition_enabledbooltrueCreate a partition that a write targets but that does not exist yet. When false, such writes fail with PARTITION_NOT_EXISTS
scanner_remote_log_prefetch_numsize_t4Number of remote log segments to prefetch
remote_file_download_thread_numsize_t3Number of threads for remote log downloads
scanner_remote_log_read_concurrencysize_t4Streaming read concurrency within a remote log file
scanner_io_tmp_dirstd::string""Parent for remote log downloads; empty uses the OS temporary directory plus /fluss
scanner_log_max_poll_recordssize_t500Maximum number of records returned in a single Poll()
scanner_log_fetch_max_bytesint32_t16777216 (16 MB)Maximum bytes per fetch response for LogScanner
scanner_log_fetch_min_bytesint32_t1Minimum bytes the server must accumulate before returning a fetch response
scanner_log_fetch_wait_max_time_msint32_t500Maximum time (ms) the server may wait to satisfy min-bytes
scanner_log_fetch_max_bytes_for_bucketint32_t1048576 (1 MB)Maximum bytes per fetch response per bucket for LogScanner
scanner_log_check_crcbooltrueCheck the CRC of fetched log batches, so a corrupted batch fails the scan. Batches the server projected are not checked
lookup_queue_sizesize_t25600Send queue capacity; new lookups wait when it is full. Each bucket also holds up to this many lookups while waiting for a leader; additional lookups for that bucket fail immediately with a buffer exhaustion error
lookup_max_retriesint32_tINT32_MAXMaximum number of times a lookup is resent after a retriable error. Waiting for a bucket's leader is not a retry, so this is not a lookup timeout
lookup_retry_backoff_msuint64_t100Initial delay in ms before a lookup that failed with a retriable error is resent, doubling with each retry of that lookup; also before a bucket without a known leader is refreshed again, doubling with each refresh of that bucket and shared by its lookups. ±20% jitter; 0 resends and refreshes immediately
lookup_retry_max_backoff_msuint64_t1000Cap in ms for the lookup retry delay and the refresh delay of a bucket without a known leader, applied before jitter; must be >= lookup_retry_backoff_ms
connect_timeout_msuint64_t15000Connection establishment timeout in milliseconds, including TCP connect, API negotiation and SASL authentication
connection_max_idle_time_msuint64_t600000 (10 min)Idle cached connections are closed after this many milliseconds, failing the requests still waiting on them with a retriable error; 0 disables closing idle connections
security_protocolstd::string"PLAINTEXT""PLAINTEXT" (default) or "sasl" for SASL auth
security_sasl_mechanismstd::string"PLAIN"SASL mechanism (only "PLAIN" is supported)
security_sasl_usernamestd::string(empty)SASL username (required when protocol is "sasl")
security_sasl_passwordstd::string(empty)SASL password (required when protocol is "sasl")

Connection​

MethodDescription
static Create(const Configuration& config, Connection& out) -> ResultCreate a connection to a Fluss cluster
GetAdmin(Admin& out) -> ResultGet the admin interface
GetTable(const TablePath& table_path, Table& out) -> ResultGet a table for read/write operations
Available() -> boolCheck if the connection is valid and initialized

Admin​

Database Operations​

MethodDescription
CreateDatabase(const std::string& database_name, const DatabaseDescriptor& descriptor, bool ignore_if_exists) -> ResultCreate a database
DropDatabase(const std::string& name, bool ignore_if_not_exists, bool cascade) -> ResultDrop a database
ListDatabases(std::vector<std::string>& out) -> ResultList all databases
DatabaseExists(const std::string& name, bool& out) -> ResultCheck if a database exists
GetDatabaseInfo(const std::string& name, DatabaseInfo& out) -> ResultGet database metadata

Table Operations​

MethodDescription
CreateTable(const TablePath& path, const TableDescriptor& descriptor, bool ignore_if_exists) -> ResultCreate a table
DropTable(const TablePath& path, bool ignore_if_not_exists) -> ResultDrop a table
GetTableInfo(const TablePath& path, TableInfo& out) -> ResultGet table metadata
ListTables(const std::string& database_name, std::vector<std::string>& out) -> ResultList tables in a database
TableExists(const TablePath& path, bool& out) -> ResultCheck if a table exists

Partition Operations​

MethodDescription
CreatePartition(const TablePath& path, const std::unordered_map<std::string, std::string>& partition_spec, bool ignore_if_exists) -> ResultCreate a partition
DropPartition(const TablePath& path, const std::unordered_map<std::string, std::string>& partition_spec, bool ignore_if_not_exists) -> ResultDrop a partition
ListPartitionInfos(const TablePath& path, std::vector<PartitionInfo>& out) -> ResultList partition metadata

Offset Operations​

MethodDescription
ListOffsets(const TablePath& path, const std::vector<int32_t>& bucket_ids, const OffsetSpec& query, std::unordered_map<int32_t, int64_t>& out) -> ResultGet offsets for buckets
ListPartitionOffsets(const TablePath& path, const std::string& partition_name, const std::vector<int32_t>& bucket_ids, const OffsetSpec& query, std::unordered_map<int32_t, int64_t>& out) -> ResultGet offsets for a partition's buckets

Lake Operations​

MethodDescription
GetLatestLakeSnapshot(const TablePath& path, LakeSnapshot& out) -> ResultGet the latest lake snapshot

Cluster Operations​

MethodDescription
GetServerNodes(std::vector<ServerNode>& out) -> ResultGet all alive server nodes (coordinator + tablets)

ServerNode​

FieldTypeDescription
idint32_tServer node ID
hoststd::stringHostname of the server
portuint32_tPort number
server_typestd::stringServer type ("CoordinatorServer", "TabletServer", or "Unknown")
uidstd::stringUnique identifier (e.g. "cs-0", "ts-1")

"Unknown" is used when the client has not yet determined the endpoint type, such as bootstrap endpoints.

Table​

MethodDescription
NewRow() -> GenericRowCreate a schema-aware row for this table
NewAppend() -> TableAppendCreate an append builder for log tables
NewUpsert() -> TableUpsertCreate an upsert builder for PK tables
NewLookup() -> TableLookupCreate a lookup builder for PK tables
NewPrefixLookup(std::vector<std::string> cols, PrefixLookuper& out) -> ResultCreate a prefix (bucket-key) lookuper
NewScan() -> TableScanCreate a scan builder
GetTableInfo() -> TableInfoGet table metadata
GetArrowSchema(std::shared_ptr<arrow::Schema>& out) -> ResultThe Arrow schema AppendArrowBatch expects
GetTablePath() -> TablePathGet the table path
HasPrimaryKey() -> boolCheck if the table has a primary key

TableAppend​

MethodDescription
CreateWriter(AppendWriter& out) -> ResultCreate an append writer

TableUpsert​

MethodDescription
PartialUpdateByIndex(std::vector<size_t> column_indices) -> TableUpsert&Configure partial update by column indices
PartialUpdateByName(std::vector<std::string> column_names) -> TableUpsert&Configure partial update by column names
CreateWriter(UpsertWriter& out) -> ResultCreate an upsert writer

TableLookup​

MethodDescription
CreateLookuper(Lookuper& out) -> ResultCreate a lookuper for point lookups

TableScan​

MethodDescription
ProjectByIndex(std::vector<size_t> column_indices) -> TableScan&Project columns by index
ProjectByName(std::vector<std::string> column_names) -> TableScan&Project columns by name
Limit(int32_t row_number) -> TableScan&Set a positive row limit (enables CreateBucketBatchScanner; rejected by log scanners)
CreateLogScanner(LogScanner& out) -> ResultCreate a record-based log scanner; on a primary-key table, subscribes to its CDC changelog (per-record change_type)
CreateRecordBatchLogScanner(LogScanner& out) -> ResultCreate an Arrow RecordBatch-based log scanner (log tables only — no per-record change types)
CreateBucketBatchScanner(const TableBucket& bucket, BatchScanner& out) -> ResultBounded scan of one bucket (requires Limit)

AppendWriter​

MethodDescription
Append(const GenericRow& row) -> ResultAppend a row (fire-and-forget)
Append(const GenericRow& row, WriteResult& out) -> ResultAppend a row with write acknowledgment
Flush() -> ResultFlush all pending writes

UpsertWriter​

MethodDescription
Upsert(const GenericRow& row) -> ResultUpsert a row (fire-and-forget)
Upsert(const GenericRow& row, WriteResult& out) -> ResultUpsert a row with write acknowledgment
Delete(const GenericRow& row) -> ResultDelete a row by primary key (fire-and-forget)
Delete(const GenericRow& row, WriteResult& out) -> ResultDelete a row with write acknowledgment
Flush() -> ResultFlush all pending operations

WriteResult​

MethodDescription
Wait() -> ResultWait for server acknowledgment of the write

Lookuper​

Performs point lookups by primary key. Obtained from TableLookup::CreateLookuper(). Each call blocks until its result arrives. Threads can share one Lookuper, and their concurrent lookups go out to the server in the same batches.

MethodDescription
Lookup(const GenericRow& pk_row, LookupResult& out) const -> ResultLookup a row by primary key
Lookup(const GenericRow& pk_row, PendingLookup& out) const -> ResultStart a lookup without blocking; out waits for its row

Each blocking lookup waits for its batch, up to lookup_batch_timeout_ms. To look up many keys from one thread, start them all, then wait for each:

std::vector<fluss::PendingLookup> pending(keys.size());
for (size_t i = 0; i < keys.size(); ++i) {
if (!lookuper.Lookup(keys[i], pending[i]).Ok()) {
// This lookup did not start.
}
}
for (auto& lookup : pending) {
fluss::LookupResult result;
if (lookup.Available() && lookup.Wait(result).Ok() && result.Found()) {
// Use result.
}
}

PendingLookup​

A lookup started by Lookuper::Lookup(pk_row, PendingLookup&). Move-only. Destroying it before Wait returns abandons the lookup.

MethodDescription
Wait(LookupResult& out) -> ResultBlock until the row arrives
Wait(LookupResult& out, int64_t timeout_ms) -> ResultBlock for at most timeout_ms. If the wait runs out, it returns REQUEST_TIME_OUT and the lookup keeps running. The lookup itself can also fail with REQUEST_TIME_OUT, which ends it, so check Available() before waiting again
Available() const -> boolTrue while the lookup is running. False once Wait has returned its outcome, which can be an error with any code, REQUEST_TIME_OUT included

PrefixLookuper​

Performs prefix (bucket-key) lookups, returning all rows whose primary key starts with the given prefix. Obtained from Table::NewPrefixLookup(). Like a Lookuper, it can be shared by threads, and it can start a lookup without blocking. PendingPrefixLookup has the same methods as PendingLookup. See the Prefix Lookup example.

MethodDescription
PrefixLookup(const GenericRow& prefix_row, PrefixLookupResult& out) const -> ResultLook up all rows matching the prefix columns
PrefixLookup(const GenericRow& prefix_row, PendingPrefixLookup& out) const -> ResultStart a lookup without blocking; out waits for its rows

LogScanner​

MethodDescription
Subscribe(int32_t bucket_id, int64_t offset) -> ResultSubscribe to a single bucket at an offset
Subscribe(const std::vector<BucketSubscription>& bucket_offsets) -> ResultSubscribe to multiple buckets
SubscribePartitionBuckets(int64_t partition_id, int32_t bucket_id, int64_t start_offset) -> ResultSubscribe to a single partition bucket
SubscribePartitionBuckets(const std::vector<PartitionBucketSubscription>& subscriptions) -> ResultSubscribe to multiple partition buckets
Unsubscribe(int32_t bucket_id) -> ResultUnsubscribe from a non-partitioned bucket
UnsubscribePartition(int64_t partition_id, int32_t bucket_id) -> ResultUnsubscribe from a partition bucket
Poll(int64_t timeout_ms, ScanRecords& out) -> ResultPoll individual records
PollRecordBatch(int64_t timeout_ms, ArrowRecordBatches& out) -> ResultPoll Arrow RecordBatches

BatchScanner​

One-shot bounded scan of a single bucket. Obtained from TableScan::CreateBucketBatchScanner(). The scan runs on the first call below, yields its single batch once, then is spent.

MethodDescription
NextBatch(ArrowRecordBatches& out) -> ResultRun the scan; returns the batch once, then empty
CollectAllBatches(ArrowRecordBatches& out) -> ResultDrain the scanner into all of its batches

GenericRow​

GenericRow is a write-only row used for append, upsert, delete, and lookup key construction. For reading field values from scan or lookup results, see RowView and LookupResult.

Index-Based Setters​

MethodDescription
SetNull(size_t idx)Set field to null
SetBool(size_t idx, bool value)Set boolean value
SetInt32(size_t idx, int32_t value)Set 32-bit integer
SetInt64(size_t idx, int64_t value)Set 64-bit integer
SetFloat32(size_t idx, float value)Set 32-bit float
SetFloat64(size_t idx, double value)Set 64-bit float
SetString(size_t idx, const std::string& value)Set string value
SetBytes(size_t idx, const std::vector<uint8_t>& value)Set binary data
SetDate(size_t idx, const Date& value)Set date value
SetTime(size_t idx, const Time& value)Set time value
SetTimestampNtz(size_t idx, const Timestamp& value)Set timestamp without timezone
SetTimestampLtz(size_t idx, const Timestamp& value)Set timestamp with timezone
SetDecimal(size_t idx, const std::string& value)Set decimal from string
SetArray(size_t idx, ArrayWriter&& writer)Set array value (consumes the writer)
SetMap(size_t idx, MapWriter&& writer)Set map value (consumes the writer)
SetRow(size_t idx, GenericRow&& nested)Set ROW value from a nested row (consumes it)

Name-Based Setters​

When using table.NewRow(), the Set() method auto-routes to the correct type based on the schema:

MethodDescription
Set(const std::string& name, std::nullptr_t)Set field to null by column name
Set(const std::string& name, bool value)Set boolean by column name
Set(const std::string& name, int32_t value)Set integer by column name
Set(const std::string& name, int64_t value)Set big integer by column name
Set(const std::string& name, float value)Set float by column name
Set(const std::string& name, double value)Set double by column name
Set(const std::string& name, const std::string& value)Set string/decimal by column name
Set(const std::string& name, const Date& value)Set date by column name
Set(const std::string& name, const Time& value)Set time by column name
Set(const std::string& name, const Timestamp& value)Set timestamp by column name
Set(const std::string& name, ArrayWriter&& writer)Set array value by column name
Set(const std::string& name, MapWriter&& writer)Set map value by column name
Set(const std::string& name, GenericRow&& nested)Set ROW value by column name

RowView​

Read-only row view for scan results. Provides zero-copy access to string and bytes data. RowView shares ownership of the underlying scan data via reference counting, so it can safely outlive the ScanRecords that produced it.

string_view Lifetime

GetString() returns std::string_view that borrows from the underlying data. The string_view is valid as long as any RowView (or ScanRecord) referencing the same poll result is alive. Copy to std::string if you need the value after all references are gone.

Index-Based Getters​

MethodDescription
FieldCount() -> size_tGet the number of fields
GetType(size_t idx) -> TypeIdGet the type at index
IsNull(size_t idx) -> boolCheck if field is null
GetBool(size_t idx) -> boolGet boolean value at index
GetInt32(size_t idx) -> int32_tGet 32-bit integer at index
GetInt64(size_t idx) -> int64_tGet 64-bit integer at index
GetFloat32(size_t idx) -> floatGet 32-bit float at index
GetFloat64(size_t idx) -> doubleGet 64-bit float at index
GetString(size_t idx) -> std::string_viewGet string at index (zero-copy)
GetBytes(size_t idx) -> std::pair<const uint8_t*, size_t>Get binary data at index (zero-copy)
GetDate(size_t idx) -> DateGet date at index
GetTime(size_t idx) -> TimeGet time at index
GetTimestamp(size_t idx) -> TimestampGet timestamp at index
IsDecimal(size_t idx) -> boolCheck if field is a decimal type
GetDecimalString(size_t idx) -> std::stringGet decimal as string at index

Complex Getters (ARRAY / MAP / ROW)​

MethodDescription
GetValue(size_t idx) -> ValueGet a complex column as a recursive Value handle
GetValue(const std::string& name) -> ValueSame, by column name

Navigate the returned Value with At / KeyAt / ValueAt / Field and read leaves with its Get*() methods.

Name-Based Getters​

MethodDescription
IsNull(const std::string& name) -> boolCheck if field is null by name
GetBool(const std::string& name) -> boolGet boolean by column name
GetInt32(const std::string& name) -> int32_tGet 32-bit integer by column name
GetInt64(const std::string& name) -> int64_tGet 64-bit integer by column name
GetFloat32(const std::string& name) -> floatGet 32-bit float by column name
GetFloat64(const std::string& name) -> doubleGet 64-bit float by column name
GetString(const std::string& name) -> std::string_viewGet string by column name
GetBytes(const std::string& name) -> std::pair<const uint8_t*, size_t>Get binary data by column name
GetDate(const std::string& name) -> DateGet date by column name
GetTime(const std::string& name) -> TimeGet time by column name
GetTimestamp(const std::string& name) -> TimestampGet timestamp by column name
GetDecimalString(const std::string& name) -> std::stringGet decimal as string by column name

ScanRecord​

ScanRecord is a value type that can be freely copied, stored, and accumulated across multiple Poll() calls. It shares ownership of the underlying scan data via reference counting.

FieldTypeDescription
offsetint64_tRecord offset in the log
timestampint64_tRecord timestamp
change_typeChangeTypeChange type (AppendOnly, Insert, UpdateBefore, UpdateAfter, Delete)
rowRowViewRow data (value type, shares ownership via reference counting)

ScanRecords​

Flat Access​

MethodDescription
Count() -> size_tTotal number of records across all buckets
IsEmpty() -> boolCheck if empty
begin() / end()Iterator support for range-based for loops

Flat iteration over all records (regardless of bucket):

for (const auto& rec : records) {
std::cout << "offset=" << rec.offset << std::endl;
}

Per-Bucket Access​

MethodDescription
BucketCount() -> size_tNumber of distinct buckets
Buckets() -> std::vector<TableBucket>List of distinct buckets
Records(const TableBucket& bucket) -> BucketRecordsRecords for a specific bucket (empty if bucket not present)
BucketAt(size_t idx) -> BucketRecordsRecords by bucket index (0-based, O(1))

BucketRecords​

A bundle of scan records belonging to a single bucket. Obtained from ScanRecords::Records() or ScanRecords::BucketAt(). BucketRecords is a value type — it shares ownership of the underlying scan data via reference counting, so it can safely outlive the ScanRecords that produced it.

MethodDescription
Size() -> size_tNumber of records in this bucket
Empty() -> boolCheck if empty
Bucket() -> const TableBucket&Get the bucket
operator[](size_t idx) -> ScanRecordAccess record by index within this bucket
begin() / end()Iterator support for range-based for loops

TableBucket​

Field / MethodDescription
table_id -> int64_tTable ID
bucket_id -> int32_tBucket ID
partition_id -> std::optional<int64_t>Partition ID (empty if non-partitioned)
operator==(const TableBucket&) -> boolEquality comparison

LookupResult​

Read-only result for lookup operations. Provides zero-copy access to field values.

Metadata​

MethodDescription
Found() -> boolWhether a matching row was found
FieldCount() -> size_tGet the number of fields

Index-Based Getters​

MethodDescription
GetType(size_t idx) -> TypeIdGet the type at index
IsNull(size_t idx) -> boolCheck if field is null
GetBool(size_t idx) -> boolGet boolean value at index
GetInt32(size_t idx) -> int32_tGet 32-bit integer at index
GetInt64(size_t idx) -> int64_tGet 64-bit integer at index
GetFloat32(size_t idx) -> floatGet 32-bit float at index
GetFloat64(size_t idx) -> doubleGet 64-bit float at index
GetString(size_t idx) -> std::string_viewGet string at index (zero-copy)
GetBytes(size_t idx) -> std::pair<const uint8_t*, size_t>Get binary data at index (zero-copy)
GetDate(size_t idx) -> DateGet date at index
GetTime(size_t idx) -> TimeGet time at index
GetTimestamp(size_t idx) -> TimestampGet timestamp at index
IsDecimal(size_t idx) -> boolCheck if field is a decimal type
GetDecimalString(size_t idx) -> std::stringGet decimal as string at index

Complex Getters (ARRAY / MAP / ROW)​

GetValue(size_t idx) -> Value and GetValue(const std::string& name) -> Value, same as on RowView. Navigate the returned Value.

Name-Based Getters​

MethodDescription
IsNull(const std::string& name) -> boolCheck if field is null by name
GetBool(const std::string& name) -> boolGet boolean by column name
GetInt32(const std::string& name) -> int32_tGet 32-bit integer by column name
GetInt64(const std::string& name) -> int64_tGet 64-bit integer by column name
GetFloat32(const std::string& name) -> floatGet 32-bit float by column name
GetFloat64(const std::string& name) -> doubleGet 64-bit float by column name
GetString(const std::string& name) -> std::string_viewGet string by column name
GetBytes(const std::string& name) -> std::pair<const uint8_t*, size_t>Get binary data by column name
GetDate(const std::string& name) -> DateGet date by column name
GetTime(const std::string& name) -> TimeGet time by column name
GetTimestamp(const std::string& name) -> TimestampGet timestamp by column name
GetDecimalString(const std::string& name) -> std::stringGet decimal as string by column name

PrefixLookupResult​

Read-only result of a prefix lookup — zero or more matched rows. Each row is a PrefixRowView exposing the same scalar getters as RowView (index- and name-based) plus GetValue(...) for complex (ARRAY / MAP / ROW) columns.

MethodDescription
Size() -> size_tNumber of matched rows
IsEmpty() -> boolWhether the result has no rows
GetRow(size_t index) -> PrefixRowViewGet the row at index (throws if out of range)

ArrowRecordBatch​

MethodDescription
GetArrowRecordBatch() -> std::shared_ptr<arrow::RecordBatch>Get the underlying Arrow RecordBatch
Available() -> boolCheck if the batch is valid
NumRows() -> int64_tNumber of rows in the batch
GetTableId() -> int64_tTable ID
GetPartitionId() -> int64_tPartition ID
GetBucketId() -> int32_tBucket ID
GetBaseOffset() -> int64_tFirst record offset
GetLastOffset() -> int64_tLast record offset
GetCommitTimestamp() -> int64_tCommit time in epoch milliseconds
GetSchemaId() -> int32_tSchema ID from the source log batch

GetCommitTimestamp() returns ArrowRecordBatch::NO_COMMIT_TIMESTAMP (-1) when the batch carries no single timestamp, which is the case for a limit scan because it merges several log batches into one Arrow batch.

GetSchemaId() returns the ID of the schema the log batch was written with. It can differ from the schema of the batch's columns, because the scanner aligns every batch to the table schema it was created with. It returns ArrowRecordBatch::NO_SCHEMA_ID (-1) for a limit scan, which merges several log batches into one.

ArrowRecordBatches​

MethodDescription
Size() -> size_tNumber of batches
Empty() -> boolCheck if empty
operator[](size_t idx)Access batch by index
begin() / end()Iterator support for range-based for loops

Schema​

MethodDescription
NewBuilder() -> Schema::BuilderCreate a new schema builder
FromArrow(std::shared_ptr<arrow::Schema> schema, std::vector<std::string> primary_keys = {}) -> SchemaBuild a schema from an existing Arrow schema (escape hatch; prefer DataType::Map / DataType::Row)

Schema::Builder​

MethodDescription
AddColumn(const std::string& name, const DataType& type) -> Builder&Add a column
SetPrimaryKeys(const std::vector<std::string>& keys) -> Builder&Set primary key columns
SetAutoIncrementColumn(std::string column) -> Builder&Set the auto increment column. Must be an INT or BIGINT column of a primary-key table, and not a primary-key column itself.
Build() -> SchemaBuild the schema

TableDescriptor​

MethodDescription
NewBuilder() -> TableDescriptor::BuilderCreate a new table descriptor builder

TableDescriptor::Builder​

MethodDescription
SetSchema(const Schema& schema) -> Builder&Set the table schema
SetPartitionKeys(const std::vector<std::string>& keys) -> Builder&Set partition key columns
SetBucketCount(int32_t count) -> Builder&Set the number of buckets
SetBucketKeys(const std::vector<std::string>& keys) -> Builder&Set bucket key columns
SetProperty(const std::string& key, const std::string& value) -> Builder&Set a table property
SetCustomProperty(const std::string& key, const std::string& value) -> Builder&Set a custom property
SetComment(const std::string& comment) -> Builder&Set a table comment
Build() -> TableDescriptorBuild the table descriptor

DataType​

Factory Methods​

MethodDescription
DataType::Boolean()Boolean type
DataType::TinyInt()8-bit signed integer
DataType::SmallInt()16-bit signed integer
DataType::Int()32-bit signed integer
DataType::BigInt()64-bit signed integer
DataType::Float()32-bit floating point
DataType::Double()64-bit floating point
DataType::String()UTF-8 string
DataType::Bytes()Binary data
DataType::Date()Date (days since epoch)
DataType::Time()Time (milliseconds since midnight)
DataType::Timestamp(int precision)Timestamp without timezone
DataType::TimestampLtz(int precision)Timestamp with timezone
DataType::Decimal(int precision, int scale)Decimal with precision and scale
DataType::Array(DataType element)Array of the given element type
DataType::Map(DataType key, DataType value)Map of key/value types (either may be complex)
DataType::Row(std::vector<std::pair<std::string, DataType>> fields)Row of named fields (types may be complex)

MAP / ROW (and arrays nesting them) compose to any depth; the binding lowers them to Arrow internally when the table is created or a writer is built.

Accessors​

MethodDescription
id() -> TypeIdGet the type ID
precision() -> intGet precision (for Decimal/Timestamp types)
scale() -> intGet scale (for Decimal type)
nullable() -> boolReturns true if this type is nullable (default), false if NOT NULL
element_type() -> const DataType*Get element type (for Array type, nullptr otherwise)
key_type() / value_type() -> const DataType*MAP key / value types (nullptr otherwise)
field_count() -> size_tROW field count (0 otherwise)
field_name(size_t i) -> const std::string&ROW field name at i
field_type(size_t i) -> const DataType*ROW field type at i
NotNull() -> DataTypeReturns a copy of this type with nullable set to false

ArrayWriter​

Write-only builder for array column values. Constructed with a fixed size and element type, then populated element-by-element. Move-only — consumed by GenericRow::SetArray() or ArrayWriter::SetArray() for nested arrays. For arrays whose element is a ROW / MAP, construct from an Arrow element type (arrow::struct_(...) / arrow::map(...)).

MethodDescription
ArrayWriter(size_t size, DataType element_type)Create an array writer; element may be complex (DataType::Map/Row)
ArrayWriter(size_t size, std::shared_ptr<arrow::DataType> element_type)Arrow escape hatch for the element type
SetNull(size_t idx)Set element to null
SetBool(size_t idx, bool value)Set boolean element
SetInt32(size_t idx, int32_t value)Set 32-bit integer element
SetInt64(size_t idx, int64_t value)Set 64-bit integer element
SetFloat32(size_t idx, float value)Set 32-bit float element
SetFloat64(size_t idx, double value)Set 64-bit float element
SetString(size_t idx, const std::string& value)Set string element
SetBytes(size_t idx, const std::vector<uint8_t>& value)Set binary element
SetDate(size_t idx, const Date& value)Set date element
SetTime(size_t idx, const Time& value)Set time element
SetTimestampNtz(size_t idx, const Timestamp& value)Set timestamp without timezone element
SetTimestampLtz(size_t idx, const Timestamp& value)Set timestamp with timezone element
SetDecimal(size_t idx, const std::string& value)Set decimal element from string
SetArray(size_t idx, ArrayWriter&& nested)Set nested array element (consumes nested)
SetRow(size_t idx, GenericRow&& row)Set ROW element (consumes the row)
SetMap(size_t idx, MapWriter&& map)Set MAP element (consumes the map)

MapWriter​

Write-only builder for map column values. Construct with the key/value types, then for each entry set the key and value and call Commit(). Keys cannot be null; an unset value defaults to null. Move-only — consumed by GenericRow::SetMap(), ArrayWriter::SetMap(), and MapWriter::SetValueMap(). For a key/value that is itself a ROW / MAP / ARRAY, construct from Arrow types and use the SetValue{Row,Map,Array} setters.

MethodDescription
MapWriter(size_t capacity, DataType key_type, DataType value_type)Create a map writer; key/value may be complex (DataType::Map/Row/Array)
MapWriter(size_t capacity, std::shared_ptr<arrow::DataType> key_type, std::shared_ptr<arrow::DataType> value_type)Arrow escape hatch for key/value types
SetKey{Bool,Int32,Int64,Float32,Float64,String,Bytes,Date,Time,Timestamp,Decimal}(...)Stage the entry key (NTZ vs LTZ chosen from the declared key type)
SetValueNull()Stage a null entry value
SetValue{Bool,Int32,Int64,Float32,Float64,String,Bytes,Date,Time,Timestamp,Decimal}(...)Stage the entry value (NTZ vs LTZ from the declared value type)
SetValueRow(GenericRow&&) / SetValueMap(MapWriter&&) / SetValueArray(ArrayWriter&&)Stage a compound entry value (consumes the writer)
Commit()Append the staged key/value as one map entry

Value​

Read-only handle for a complex (ARRAY / MAP / ROW) column value, obtained from RowView::GetValue(), LookupResult::GetValue(), or PrefixRowView::GetValue(). Navigate to children with At / KeyAt / ValueAt / Field (each returns a child Value); read a leaf with the Get*() methods. A typed read on a null or wrong-typed value throws. Move-only; owns a Rust handle released on destruction.

Leaf reads​

MethodDescription
Type() -> TypeIdType of this value
IsNull() -> boolWhether this value is null
GetBool() -> boolRead a boolean leaf
GetInt32() -> int32_tRead a 32-bit integer leaf
GetInt64() -> int64_tRead a 64-bit integer leaf
GetFloat32() -> floatRead a 32-bit float leaf
GetFloat64() -> doubleRead a 64-bit float leaf
GetString() -> std::stringRead a string leaf
GetBytes() -> std::vector<uint8_t>Read a binary leaf
GetDate() -> DateRead a date leaf
GetTime() -> TimeRead a time leaf
GetTimestamp() -> TimestampRead a timestamp leaf
GetDecimalString() -> std::stringRead a decimal leaf as string
MethodDescription
Size() -> size_tElement count (ARRAY) / entries (MAP)
FieldCount() -> size_tField count (ROW)
At(size_t i) -> ValueARRAY element i
KeyAt(size_t i) -> ValueMAP key at entry i
ValueAt(size_t i) -> ValueMAP value at entry i
Field(size_t i) -> ValueROW field i
Field(const std::string& name) -> ValueROW field by name

TablePath​

Method / FieldDescription
TablePath(const std::string& database, const std::string& table)Create a table path
database_name -> std::stringDatabase name
table_name -> std::stringTable name
ToString() -> std::stringString representation

TableInfo​

FieldTypeDescription
table_idint64_tTable ID
schema_idint32_tSchema ID
table_pathTablePathTable path
created_timeint64_tCreation timestamp
modified_timeint64_tLast modification timestamp
primary_keysstd::vector<std::string>Primary key columns
bucket_keysstd::vector<std::string>Bucket key columns
partition_keysstd::vector<std::string>Partition key columns
num_bucketsint32_tNumber of buckets
has_primary_keyboolWhether the table has a primary key
is_partitionedboolWhether the table is partitioned
propertiesstd::unordered_map<std::string, std::string>Table properties
custom_propertiesstd::unordered_map<std::string, std::string>Custom properties
commentstd::stringTable comment
schemaSchemaTable schema

Temporal Types​

Date​

MethodDescription
Date::FromDays(int32_t days)Create from days since epoch
Date::FromYMD(int year, int month, int day)Create from year, month, day
Year() -> intGet year
Month() -> intGet month
Day() -> intGet day

Time​

MethodDescription
Time::FromMillis(int32_t millis)Create from milliseconds since midnight
Time::FromHMS(int hour, int minute, int second)Create from hour, minute, second
Hour() -> intGet hour
Minute() -> intGet minute
Second() -> intGet second
Millis() -> int64_tGet sub-second millisecond component (0-999)

Timestamp​

MethodDescription
Timestamp::FromMillis(int64_t millis)Create from milliseconds since epoch
Timestamp::FromMillisNanos(int64_t millis, int32_t nanos)Create from milliseconds and nanoseconds
Timestamp::FromTimePoint(std::chrono::system_clock::time_point tp)Create from a time point

PartitionInfo​

FieldTypeDescription
partition_idint64_tPartition ID
partition_namestd::stringPartition name
bucket_countint32_tPartition bucket count

DatabaseDescriptor​

FieldTypeDescription
commentstd::stringDatabase comment
propertiesstd::unordered_map<std::string, std::string>Custom properties

DatabaseInfo​

FieldTypeDescription
database_namestd::stringDatabase name
commentstd::stringDatabase comment
propertiesstd::unordered_map<std::string, std::string>Custom properties
created_timeint64_tCreation timestamp
modified_timeint64_tLast modification timestamp

LakeSnapshot​

FieldTypeDescription
snapshot_idint64_tSnapshot ID
bucket_offsetsstd::vector<BucketOffset>All bucket offsets

BucketOffset​

FieldTypeDescription
table_idint64_tTable ID
partition_idint64_tPartition ID
bucket_idint32_tBucket ID
offsetint64_tOffset value

OffsetSpec​

MethodDescription
OffsetSpec::Earliest()Query for the earliest available offset
OffsetSpec::Latest()Query for the latest offset
OffsetSpec::Timestamp(int64_t timestamp_ms)Query offset at a specific timestamp

Constants​

ConstantValueDescription
fluss::EARLIEST_OFFSET-2Start reading from the earliest available offset

To start reading from the latest offset (only new records), resolve the current offset via ListOffsets before subscribing:

std::unordered_map<int32_t, int64_t> offsets;
admin.ListOffsets(table_path, {0}, fluss::OffsetSpec::Latest(), offsets);
scanner.Subscribe(0, offsets[0]);

Enums​

ChangeType​

ValueShort StringDescription
AppendOnly+AAppend-only record
Insert+IInserted row
UpdateBefore-UPrevious value of an updated row
UpdateAfter+UNew value of an updated row
Delete-DDeleted row

You may refer to the following example to convert ChangeType enum to its short string representation.

inline const char* ChangeTypeShortString(ChangeType ct) {
switch (ct) {
case ChangeType::AppendOnly: return "+A";
case ChangeType::Insert: return "+I";
case ChangeType::UpdateBefore: return "-U";
case ChangeType::UpdateAfter: return "+U";
case ChangeType::Delete: return "-D";
}
throw std::invalid_argument("Unknown ChangeType");
}

TypeId​

ValueDescription
BooleanBoolean type
TinyInt8-bit signed integer
SmallInt16-bit signed integer
Int32-bit signed integer
BigInt64-bit signed integer
Float32-bit floating point
Double64-bit floating point
StringUTF-8 string
BytesBinary data
DateDate
TimeTime
TimestampTimestamp without timezone
TimestampLtzTimestamp with timezone
DecimalDecimal
ArrayArray of elements
MapMap of key/value pairs
RowRow (struct) of fields

ChangeType​

ValueDescription
AppendOnlyAppend-only record (log tables)
InsertInserted row (PK tables)
UpdateBeforeRow value before an update (PK tables)
UpdateAfterRow value after an update (PK tables)
DeleteDeleted row (PK tables)

OffsetSpec​

ValueDescription
EarliestEarliest available offset
LatestLatest offset
TimestampOffset at a specific timestamp