Skip to content

Commit

Permalink
Synchronize documentation. (#328)
Browse files Browse the repository at this point in the history
Co-authored-by: Infinity Curator <[email protected]>
  • Loading branch information
infinityCurator and Infinity Curator authored Jan 24, 2025
1 parent 2155cbe commit d9c86cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
10 changes: 8 additions & 2 deletions website/docs/references/http_api_reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ curl --request POST \
- `"double"`/`"float64"`
- `"float16"`
- `"bfloat16"`
- Array: e.g., `"array,varchar"`, `"array,array,varchar"`
- `array`: The column is an array column.
- followed by the element type of the array. Can be recursive.
- for example, `"array,varchar"` is a one-dimensional array of strings, and `"array,array,varchar"` is a two-dimensional array of strings.
- `"default"`: `Any`, *Optional*
The default value for unspecified cells in that column.
- `"comment"`: `string`, *Optional*
Expand Down Expand Up @@ -1502,7 +1506,8 @@ curl --request POST \
"sparse_column": {"10":1.1, "20":2.2, "30": 3.3},
"tensor_column": [[1.0, 0.0, 0.0, 0.0], [1.1, 0.0, 0.0, 0.0]],
"tensorarray_column": [[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0]]],
"multivector_column": [[1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]
"multivector_column": [[1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]],
"array_array_varchar_column": {"array": [{"array": ["hello", "world"]}, {"array": ["!"]}, {"array": [""]}, {"array": []}]}
},
{
"name": "Neil",
Expand All @@ -1512,7 +1517,8 @@ curl --request POST \
"sparse_column": {"10":1.1, "20":2.2, "30": 3.3},
"tensor_column": [[1.0, 0.0, 0.0, 0.0], [1.1, 0.0, 0.0, 0.0]],
"tensorarray_column": [[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0]]],
"multivector_column": [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]
"multivector_column": [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]],
"array_array_varchar_column": {"array": []}
}
] '
```
Expand Down
15 changes: 15 additions & 0 deletions website/docs/references/pysdk_api_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ Definitions for all table columns as a dictionary. Each key in the dictionary is
- `"double"`/`"float64"`
- `"float16"`
- `"bfloat16"`
- Array: e.g., `"array,varchar"`, `"array,array,varchar"`
- `array`: The column is an array column.
- followed by the element type of the array. Can be recursive.
- for example, `"array,varchar"` is a one-dimensional array of strings, and `"array,array,varchar"` is a two-dimensional array of strings.
- **Default value** (`"default"`)
The default value for unspecified cells in that column.

Expand Down Expand Up @@ -1414,6 +1418,17 @@ table_object = db_object.create_table("tensor_array_table", {"tensor_array_colum
table_object.insert([{"tensor_array_column": [[[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0]]]}])
```

##### Insert arrays

```python
from infinity.common import Array
# Creat a table with only one varchar array array column:
table_object = db_object.create_table("varchar_array_array_table",
{"varchar_array_array_column": {"type": "array,array,varchar"}})
# Insert one row into the table:
table_object.insert([{"varchar_array_array_column": Array(Array("hello", "world"), Array("!"), Array())}])
```

---

### import_data
Expand Down

0 comments on commit d9c86cb

Please sign in to comment.