Skip to content

Commit

Permalink
Document API to update Refresh SQL (#237)
Browse files Browse the repository at this point in the history
* Document API to update Refresh SQL

* Update spiceaidocs/docs/data-accelerators/index.md

Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com>

* Update spiceaidocs/docs/data-accelerators/index.md

Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com>

* Update

* Update spiceaidocs/docs/data-accelerators/index.md

Co-authored-by: yfu <fevin86@gmail.com>

---------

Co-authored-by: Luke Kim <80174+lukekim@users.noreply.github.com>
Co-authored-by: yfu <fevin86@gmail.com>
  • Loading branch information
3 people committed May 13, 2024
1 parent af0fda2 commit ee597d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions spiceaidocs/docs/data-accelerators/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,26 @@ datasets:
SELECT * FROM accelerated_dataset WHERE city = 'Seattle'
```

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:

```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]
- 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
Expand Down
2 changes: 1 addition & 1 deletion spiceaidocs/docs/features/local-acceleration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit ee597d8

Please sign in to comment.