Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 60 additions & 31 deletions website/docs/user-guide/cpp/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>` | 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`

Expand Down Expand Up @@ -286,15 +288,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<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 |
| `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<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() -> TableDescriptor` | Build the table descriptor |

## `DataType`

Expand Down Expand Up @@ -336,22 +339,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<std::string>` | Primary key columns |
| `bucket_keys` | `std::vector<std::string>` | Bucket key columns |
| `partition_keys` | `std::vector<std::string>` | 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<std::string, std::string>` | 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<std::string>` | Primary key columns |
| `bucket_keys` | `std::vector<std::string>` | Bucket key columns |
| `partition_keys` | `std::vector<std::string>` | 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<std::string, std::string>` | Table properties |
| `custom_properties` | `std::unordered_map<std::string, std::string>` | Custom properties |
| `comment` | `std::string` | Table comment |
| `schema` | `Schema` | Table schema |

## Temporal Types

Expand Down Expand Up @@ -448,6 +452,31 @@ 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 |

You may 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 |
Expand Down
39 changes: 21 additions & 18 deletions website/docs/user-guide/rust/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>` | 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<String, String>` | Get all table properties |
| `fn custom_properties(&self) -> &HashMap<String, String>` | 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<i32>, bucket_keys: Vec<String>) -> Self` | Set bucket distribution |
| `fn comment(comment: &str) -> Self` | Set table comment |
| `fn build() -> Result<TableDescriptor>` | 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<String>, value: impl Into<String>) -> Self` | Set a single custom property |
| `fn custom_properties(properties: HashMap<impl Into<String>, impl Into<String>>) -> Self` | Set custom properties |
| `fn partitioned_by(keys: Vec<&str>) -> Self` | Set partition columns |
| `fn distributed_by(bucket_count: Option<i32>, bucket_keys: Vec<String>) -> Self` | Set bucket distribution |
| `fn comment(comment: &str) -> Self` | Set table comment |
| `fn build() -> Result<TableDescriptor>` | Build the table descriptor |

## `TablePath`

Expand Down
Loading