-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable structured types and add vectors documentation
- Loading branch information
1 parent
3664e2e
commit c3e59ff
Showing
5 changed files
with
45 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Vector type | ||
|
||
Vector type represents an array of either integer or float type and a fixed size. | ||
Examples: | ||
- `[4, 5, 6]::VECTOR(INT, 3)` is a 3 elements vector of integers | ||
- `[1.1, 2.2]::VECTOR(FLOAT, 2)` is a 2 elements vector of floats | ||
|
||
More about vectors you can read here: [Vector data types](https://docs.snowflake.com/en/sql-reference/data-types-vector). | ||
|
||
The driver allows to read a vector column into `int[]` or `float[]` arrays by calling `T[] SnowflakeDbReader.GetArray<T>(int ordinal)` | ||
method for either int or float types. | ||
|
||
```csharp | ||
var reader = (SnowflakeDbDataReader) command.ExecuteReader(); | ||
Assert.IsTrue(reader.Read()); | ||
int[] intVector = reader.GetArray<int>(0); | ||
float[] floatVector = reader.GetArray<float>(1); | ||
``` |