Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document API to update Refresh SQL #237

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```

sgrebnov marked this conversation as resolved.
Show resolved Hide resolved
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.
sgrebnov marked this conversation as resolved.
Show resolved Hide resolved

An example using cURL:

Expand Down