From a950ca90ed7b60c0f4df69592151ebabb209d771 Mon Sep 17 00:00:00 2001 From: Keith Lee Date: Tue, 17 Feb 2026 13:01:59 +0000 Subject: [PATCH 1/4] chore: add API reference for CustomProperty (#336) --- website/docs/user-guide/cpp/api-reference.md | 52 ++++++++++--------- website/docs/user-guide/rust/api-reference.md | 39 +++++++------- 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/website/docs/user-guide/cpp/api-reference.md b/website/docs/user-guide/cpp/api-reference.md index 9cba2431..681394ae 100644 --- a/website/docs/user-guide/cpp/api-reference.md +++ b/website/docs/user-guide/cpp/api-reference.md @@ -286,15 +286,16 @@ When using `table.NewRow()`, the `Set()` method auto-routes to the correct type ## `TableDescriptor::Builder` -| Method | Description | -|-----------------------------------------------------------------------------|----------------------------| -| `SetSchema(const Schema& schema) -> Builder&` | Set the table schema | -| `SetPartitionKeys(const std::vector& keys) -> Builder&` | Set partition key columns | -| `SetBucketCount(int32_t count) -> Builder&` | Set the number of buckets | -| `SetBucketKeys(const std::vector& keys) -> Builder&` | Set bucket key columns | -| `SetProperty(const std::string& key, const std::string& value) -> Builder&` | Set a table property | -| `SetComment(const std::string& comment) -> Builder&` | Set a table comment | -| `Build() -> TableDescriptor` | Build the table descriptor | +| Method | Description | +|-----------------------------------------------------------------------------------|----------------------------| +| `SetSchema(const Schema& schema) -> Builder&` | Set the table schema | +| `SetPartitionKeys(const std::vector& keys) -> Builder&` | Set partition key columns | +| `SetBucketCount(int32_t count) -> Builder&` | Set the number of buckets | +| `SetBucketKeys(const std::vector& 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() -> TableDescriptor` | Build the table descriptor | ## `DataType` @@ -336,22 +337,23 @@ When using `table.NewRow()`, the `Set()` method auto-routes to the correct type ## `TableInfo` -| Field | Type | Description | -|-------------------|------------------------------------------------|-------------------------------------| -| `table_id` | `int64_t` | Table ID | -| `schema_id` | `int32_t` | Schema ID | -| `table_path` | `TablePath` | Table path | -| `created_time` | `int64_t` | Creation timestamp | -| `modified_time` | `int64_t` | Last modification timestamp | -| `primary_keys` | `std::vector` | Primary key columns | -| `bucket_keys` | `std::vector` | Bucket key columns | -| `partition_keys` | `std::vector` | Partition key columns | -| `num_buckets` | `int32_t` | Number of buckets | -| `has_primary_key` | `bool` | Whether the table has a primary key | -| `is_partitioned` | `bool` | Whether the table is partitioned | -| `properties` | `std::unordered_map` | Table properties | -| `comment` | `std::string` | Table comment | -| `schema` | `Schema` | Table schema | +| Field | Type | Description | +|---------------------|------------------------------------------------|-------------------------------------| +| `table_id` | `int64_t` | Table ID | +| `schema_id` | `int32_t` | Schema ID | +| `table_path` | `TablePath` | Table path | +| `created_time` | `int64_t` | Creation timestamp | +| `modified_time` | `int64_t` | Last modification timestamp | +| `primary_keys` | `std::vector` | Primary key columns | +| `bucket_keys` | `std::vector` | Bucket key columns | +| `partition_keys` | `std::vector` | Partition key columns | +| `num_buckets` | `int32_t` | Number of buckets | +| `has_primary_key` | `bool` | Whether the table has a primary key | +| `is_partitioned` | `bool` | Whether the table is partitioned | +| `properties` | `std::unordered_map` | Table properties | +| `custom_properties` | `std::unordered_map` | Custom properties | +| `comment` | `std::string` | Table comment | +| `schema` | `Schema` | Table schema | ## Temporal Types diff --git a/website/docs/user-guide/rust/api-reference.md b/website/docs/user-guide/rust/api-reference.md index 0929ce68..0134fbce 100644 --- a/website/docs/user-guide/rust/api-reference.md +++ b/website/docs/user-guide/rust/api-reference.md @@ -239,27 +239,30 @@ writer.append(&row)?.await?; ## `TableDescriptor` -| Method | Description | -|----------------------------------------------------|--------------------------------------| -| `fn builder() -> TableDescriptorBuilder` | Create a table descriptor builder | -| `fn schema(&self) -> &Schema` | Get the table schema | -| `fn partition_keys(&self) -> &[String]` | Get partition key column names | -| `fn has_primary_key(&self) -> bool` | Check if the table has a primary key | -| `fn properties(&self) -> &HashMap` | Get all table properties | -| `fn comment(&self) -> Option<&str>` | Get table comment | +| Method | Description | +|-----------------------------------------------------------|--------------------------------------| +| `fn builder() -> TableDescriptorBuilder` | Create a table descriptor builder | +| `fn schema(&self) -> &Schema` | Get the table schema | +| `fn partition_keys(&self) -> &[String]` | Get partition key column names | +| `fn has_primary_key(&self) -> bool` | Check if the table has a primary key | +| `fn properties(&self) -> &HashMap` | Get all table properties | +| `fn custom_properties(&self) -> &HashMap` | Get custom properties | +| `fn comment(&self) -> Option<&str>` | Get table comment | ## `TableDescriptorBuilder` -| Method | Description | -|----------------------------------------------------------------------------------|---------------------------------------------| -| `fn schema(schema: Schema) -> Self` | Set the schema | -| `fn log_format(format: LogFormat) -> Self` | Set log format (e.g., `LogFormat::ARROW`) | -| `fn kv_format(format: KvFormat) -> Self` | Set KV format (e.g., `KvFormat::COMPACTED`) | -| `fn property(key: &str, value: &str) -> Self` | Set a table property | -| `fn partitioned_by(keys: Vec<&str>) -> Self` | Set partition columns | -| `fn distributed_by(bucket_count: Option, bucket_keys: Vec) -> Self` | Set bucket distribution | -| `fn comment(comment: &str) -> Self` | Set table comment | -| `fn build() -> Result` | Build the table descriptor | +| Method | Description | +|-------------------------------------------------------------------------------------------|---------------------------------------------| +| `fn schema(schema: Schema) -> Self` | Set the schema | +| `fn log_format(format: LogFormat) -> Self` | Set log format (e.g., `LogFormat::ARROW`) | +| `fn kv_format(format: KvFormat) -> Self` | Set KV format (e.g., `KvFormat::COMPACTED`) | +| `fn property(key: &str, value: &str) -> Self` | Set a table property | +| `fn custom_property(key: impl Into, value: impl Into) -> Self` | Set a single custom property | +| `fn custom_properties(properties: HashMap, impl Into>) -> Self` | Set custom properties | +| `fn partitioned_by(keys: Vec<&str>) -> Self` | Set partition columns | +| `fn distributed_by(bucket_count: Option, bucket_keys: Vec) -> Self` | Set bucket distribution | +| `fn comment(comment: &str) -> Self` | Set table comment | +| `fn build() -> Result` | Build the table descriptor | ## `TablePath` From d348446bf24c904096f9ba78d504680d2f8c2e51 Mon Sep 17 00:00:00 2001 From: Keith Lee Date: Tue, 17 Feb 2026 12:45:55 +0000 Subject: [PATCH 2/4] Add API Reference for C++ ChangeType --- website/docs/user-guide/cpp/api-reference.md | 24 +++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/website/docs/user-guide/cpp/api-reference.md b/website/docs/user-guide/cpp/api-reference.md index 681394ae..7c05ab62 100644 --- a/website/docs/user-guide/cpp/api-reference.md +++ b/website/docs/user-guide/cpp/api-reference.md @@ -226,12 +226,14 @@ When using `table.NewRow()`, the `Set()` method auto-routes to the correct type ## `ScanRecord` -| Field | Type | Description | -|-------------|--------------|-------------------------------| -| `bucket_id` | `int32_t` | Bucket this record belongs to | -| `offset` | `int64_t` | Record offset in the log | -| `timestamp` | `int64_t` | Record timestamp | -| `row` | `GenericRow` | Row data | +| Field | Type | Description | +|----------------|--------------------------|---------------------------------------------------------------------| +| `bucket_id` | `int32_t` | Bucket this record belongs to | +| `partition_id` | `std::optional` | Partition ID (present only for partitioned tables) | +| `offset` | `int64_t` | Record offset in the log | +| `timestamp` | `int64_t` | Record timestamp | +| `change_type` | `ChangeType` | Change type (AppendOnly, Insert, UpdateBefore, UpdateAfter, Delete) | +| `row` | `RowView` | Row data | ## `ScanRecords` @@ -450,6 +452,16 @@ scanner.Subscribe(0, offsets[0]); ## Enums +### `ChangeType` + +| Value | Short String | Description | +|----------------|--------------|----------------------------------| +| `AppendOnly` | `+A` | Append-only record | +| `Insert` | `+I` | Inserted row | +| `UpdateBefore` | `-U` | Previous value of an updated row | +| `UpdateAfter` | `+U` | New value of an updated row | +| `Delete` | `-D` | Deleted row | + ### `TypeId` | Value | Description | From 53ca24986e895c6ad96639e597ba27317924fd9e Mon Sep 17 00:00:00 2001 From: Keith Lee Date: Tue, 17 Feb 2026 20:04:43 +0000 Subject: [PATCH 3/4] Add API Reference for C++ ChangeType --- website/docs/user-guide/cpp/api-reference.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website/docs/user-guide/cpp/api-reference.md b/website/docs/user-guide/cpp/api-reference.md index 7c05ab62..71564069 100644 --- a/website/docs/user-guide/cpp/api-reference.md +++ b/website/docs/user-guide/cpp/api-reference.md @@ -462,6 +462,21 @@ scanner.Subscribe(0, offsets[0]); | `UpdateAfter` | `+U` | New value of an updated row | | `Delete` | `-D` | Deleted row | +You refer to the following example to convert ChangeType enum to its short string representation. + +```cpp +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` | Value | Description | From 84038647c155493ccb942cdf4ea2352276d5237b Mon Sep 17 00:00:00 2001 From: Keith Lee Date: Tue, 17 Feb 2026 20:08:03 +0000 Subject: [PATCH 4/4] Add API Reference for C++ ChangeType --- website/docs/user-guide/cpp/api-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/user-guide/cpp/api-reference.md b/website/docs/user-guide/cpp/api-reference.md index 71564069..3b939169 100644 --- a/website/docs/user-guide/cpp/api-reference.md +++ b/website/docs/user-guide/cpp/api-reference.md @@ -462,7 +462,7 @@ scanner.Subscribe(0, offsets[0]); | `UpdateAfter` | `+U` | New value of an updated row | | `Delete` | `-D` | Deleted row | -You refer to the following example to convert ChangeType enum to its short string representation. +You may refer to the following example to convert ChangeType enum to its short string representation. ```cpp inline const char* ChangeTypeShortString(ChangeType ct) {