From 3069f12a1d89d6062243899243782d1a9f70235e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20S=C3=B8ndergaard?= Date: Fri, 17 Nov 2023 10:13:48 +0100 Subject: [PATCH] Update documention --- source/Databricks/documents/documentation.md | 18 ++++++++++++++++++ .../documents/release-notes/release-notes.md | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/source/Databricks/documents/documentation.md b/source/Databricks/documents/documentation.md index 1c986088a..41e55c6a7 100644 --- a/source/Databricks/documents/documentation.md +++ b/source/Databricks/documents/documentation.md @@ -79,6 +79,24 @@ await foreach (var record in records) allSheldons.Add(new Person(record.name, record.date)); ``` +A query can contain arrays. When used with Apache Arrow the array is encoded as object[]. If the format is JsonArray the array is encoded as Json string array. + +```c# +var statement = DatabricksStatement.FromRawSql( + @"SELECT a, b FROM VALUES + ('one', array(0, 1)), + ('two', array(2, 3)) AS data(a, b);").Build(); + +var result = client.ExecuteStatementAsync(statement, Format.ApacheArrow); +var row = await result.FirstAsync(); + +// Apache arrow +var values = ((object[])row.b).OfType(); + +// JsonArray +var values = JsonConvert.DeserializeObject((string)row.b).Select(int.Parse); +``` + #### Adhoc queries It's possible to create adhoc queries from `DatabricksStatement` class. diff --git a/source/Databricks/documents/release-notes/release-notes.md b/source/Databricks/documents/release-notes/release-notes.md index 9ce049c80..a5fe1af44 100644 --- a/source/Databricks/documents/release-notes/release-notes.md +++ b/source/Databricks/documents/release-notes/release-notes.md @@ -1,5 +1,10 @@ # Databricks Release Notes +## Version 8.2.0 + +- Add support for ListArray in Apache Arrow format +- Update documentation with usage guide for Apache Arrow format and JsonArray format for arrays + ## Version 8.1.0 - Create objects from statements as an alternative to dynamic