From bf34928fcdfbd6e6abb64e1bd73f1ba827954853 Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Mon, 13 May 2024 11:29:18 -0700 Subject: [PATCH 1/5] Document API to update Refresh SQL --- spiceaidocs/docs/data-accelerators/index.md | 11 +++++++++++ spiceaidocs/docs/features/local-acceleration/index.md | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/spiceaidocs/docs/data-accelerators/index.md b/spiceaidocs/docs/data-accelerators/index.md index aec2348e..b56d4358 100644 --- a/spiceaidocs/docs/data-accelerators/index.md +++ b/spiceaidocs/docs/data-accelerators/index.md @@ -63,6 +63,17 @@ datasets: SELECT * FROM accelerated_dataset WHERE city = 'Seattle' ``` +`refresh_sql` can be updated on-demand via `PATCH /v1/datasets/:name/acceleration` API endpoint. This modification is non-persistent and will revert to the original value at the next runtime restart. An example query using cURL: + +```bash +curl -i -X PATCH \ + -H "Content-Type: application/json" \ + -d '{ + "refresh_sql": "SELECT * FROM accelerated_dataset WHERE city = 'Bellevue'" + }' \ + 127.0.0.1:3000/v1/datasets/accelerated_dataset/acceleration +``` + For the complete reference, view the `refresh_sql` section of [datasets](../reference/spicepod/datasets.md#accelerationrefresh_sql). :::warning[Limitations] diff --git a/spiceaidocs/docs/features/local-acceleration/index.md b/spiceaidocs/docs/features/local-acceleration/index.md index 9f2c4bdc..59bf7554 100644 --- a/spiceaidocs/docs/features/local-acceleration/index.md +++ b/spiceaidocs/docs/features/local-acceleration/index.md @@ -31,7 +31,7 @@ Dataset acceleration can be configured in `full` (the entire dataset is refreshe For accelerated datasets in `full` mode, the [`refresh_check_interval`](/reference/spicepod/datasets#accelerationrefresh_check_interval) parameter controls how often the accelerated dataset is refreshed. -Accelerated datasets can also be refreshed on-demand via the `refresh` CLI command or `POST /v1/datasets/:name/refresh` API endpoint. +Accelerated datasets can also be refreshed on-demand via the `refresh` CLI command or `POST /v1/datasets/:name/acceleration/refresh` API endpoint. An example using cURL: From 1c96c6b58d221101b2049425aa377a467338060a Mon Sep 17 00:00:00 2001 From: Sergei Grebnov Date: Mon, 13 May 2024 15:22:53 -0700 Subject: [PATCH 2/5] Update spiceaidocs/docs/data-accelerators/index.md Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com> --- spiceaidocs/docs/data-accelerators/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spiceaidocs/docs/data-accelerators/index.md b/spiceaidocs/docs/data-accelerators/index.md index b56d4358..a9bc228f 100644 --- a/spiceaidocs/docs/data-accelerators/index.md +++ b/spiceaidocs/docs/data-accelerators/index.md @@ -63,7 +63,7 @@ datasets: SELECT * FROM accelerated_dataset WHERE city = 'Seattle' ``` -`refresh_sql` can be updated on-demand via `PATCH /v1/datasets/:name/acceleration` API endpoint. This modification is non-persistent and will revert to the original value at the next runtime restart. An example query using cURL: +The `refresh_sql` parameter can be update at runtime on-demand using `PATCH /v1/datasets/:name/acceleration`. This change is temporary and will revert at the next runtime restart. ```bash curl -i -X PATCH \ From 661fa57477989e09ac9d1a4f488c46c862e3ec79 Mon Sep 17 00:00:00 2001 From: Sergei Grebnov Date: Mon, 13 May 2024 15:24:10 -0700 Subject: [PATCH 3/5] Update spiceaidocs/docs/data-accelerators/index.md Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com> --- spiceaidocs/docs/data-accelerators/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spiceaidocs/docs/data-accelerators/index.md b/spiceaidocs/docs/data-accelerators/index.md index a9bc228f..79e1a4ef 100644 --- a/spiceaidocs/docs/data-accelerators/index.md +++ b/spiceaidocs/docs/data-accelerators/index.md @@ -65,6 +65,8 @@ datasets: The `refresh_sql` parameter can be update at runtime on-demand using `PATCH /v1/datasets/:name/acceleration`. This change is temporary and will revert at the next runtime restart. +Example: + ```bash curl -i -X PATCH \ -H "Content-Type: application/json" \ @@ -72,8 +74,6 @@ curl -i -X PATCH \ "refresh_sql": "SELECT * FROM accelerated_dataset WHERE city = 'Bellevue'" }' \ 127.0.0.1:3000/v1/datasets/accelerated_dataset/acceleration -``` - For the complete reference, view the `refresh_sql` section of [datasets](../reference/spicepod/datasets.md#accelerationrefresh_sql). :::warning[Limitations] From 4d4433fea4f83e6d8510060233a610beb3ff04ce Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Mon, 13 May 2024 15:29:47 -0700 Subject: [PATCH 4/5] Update --- spiceaidocs/docs/data-accelerators/index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spiceaidocs/docs/data-accelerators/index.md b/spiceaidocs/docs/data-accelerators/index.md index 79e1a4ef..52832c9f 100644 --- a/spiceaidocs/docs/data-accelerators/index.md +++ b/spiceaidocs/docs/data-accelerators/index.md @@ -74,12 +74,15 @@ curl -i -X PATCH \ "refresh_sql": "SELECT * FROM accelerated_dataset WHERE city = 'Bellevue'" }' \ 127.0.0.1:3000/v1/datasets/accelerated_dataset/acceleration +``` + For the complete reference, view the `refresh_sql` section of [datasets](../reference/spicepod/datasets.md#accelerationrefresh_sql). :::warning[Limitations] - The refresh SQL only supports filtering data from the current dataset - joining across other datasets is not supported. - Selecting a subset of columns isn't supported - the refresh SQL needs to start with `SELECT * FROM {name}`. - Queries for data that have been filtered out will not fall back to querying against the federated table. +- Refresh SQL modification via API is temporary and will revert at the next runtime restart. ::: ### Refresh Data Window From ceb3be02013ee202aa42ccad18d45bd5186074d4 Mon Sep 17 00:00:00 2001 From: Sergei Grebnov Date: Mon, 13 May 2024 15:37:15 -0700 Subject: [PATCH 5/5] Update spiceaidocs/docs/data-accelerators/index.md Co-authored-by: yfu --- spiceaidocs/docs/data-accelerators/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spiceaidocs/docs/data-accelerators/index.md b/spiceaidocs/docs/data-accelerators/index.md index 52832c9f..ffcb310f 100644 --- a/spiceaidocs/docs/data-accelerators/index.md +++ b/spiceaidocs/docs/data-accelerators/index.md @@ -63,7 +63,7 @@ datasets: SELECT * FROM accelerated_dataset WHERE city = 'Seattle' ``` -The `refresh_sql` parameter can be update at runtime on-demand using `PATCH /v1/datasets/:name/acceleration`. This change is temporary and will revert at the next runtime restart. +The `refresh_sql` parameter can be updated at runtime on-demand using `PATCH /v1/datasets/:name/acceleration`. This change is temporary and will revert at the next runtime restart. Example: