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

Update the federated-queries doc #655

Merged
merged 1 commit into from
Nov 28, 2024
Merged
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
44 changes: 22 additions & 22 deletions spiceaidocs/docs/features/federated-queries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ spice init demo
cd demo
```

**Step 5.** Start the Spice runtime.

```bash
spice run
```

**Step 6.** Open a new terminal, navigate back to the `demo` directory and add the `spiceai/fed-demo` Spicepod.
**Step 5.** Add the `spiceai/fed-demo` Spicepod.

```bash
# Change to demo directory.
Expand All @@ -58,6 +52,12 @@ spice add spiceai/fed-demo

Note in the Spice runtime output several datasets are loaded.

**Step 6.** Start the Spice runtime.

```bash
spice run
```

**Step 7.** Show available tables and query them, regardless of source.

```bash
Expand Down Expand Up @@ -95,7 +95,7 @@ SELECT *
FROM dremio_source_accelerated LIMIT 10
```

**Step 8.** Join tables across remote sources and query
**Step 8.** Join tables across remote sources and locally accelerated source

```sql
-- Query across S3, PostgreSQL, and Dremio
Expand All @@ -110,26 +110,26 @@ WITH order_numbers AS (
SELECT
AVG(total_amount),
passenger_count
FROM dremio_source
FROM dremio_source_accelerated
WHERE passenger_count IN (
SELECT DISTINCT order_number % 10 AS num_of_passenger
FROM order_numbers
)
GROUP BY passenger_count;

+---------------------------------+-----------------+
| AVG(dremio_source.total_amount) | passenger_count |
+---------------------------------+-----------------+
| 17.219515789473693 | 4 |
| 22.401176470588233 | 6 |
| 21.12263157894737 | 5 |
| 17.441359661495103 | 3 |
| 23.2 | 0 |
| 17.714222499449477 | 2 |
| 15.394881909237105 | 1 |
+---------------------------------+-----------------+

Time: 3.345525166 seconds. 7 rows.
+---------------------------------------------+-----------------+
| avg(dremio_source_accelerated.total_amount) | passenger_count |
+---------------------------------------------+-----------------+
| 17.441359661495113 | 3 |
| 22.401176470588233 | 6 |
| 21.122631578947367 | 5 |
| 17.219515789473697 | 4 |
| 17.71422249944938 | 2 |
| 15.394881909237206 | 1 |
| 23.2 | 0 |
+---------------------------------------------+-----------------+

Time: 0.557610333 seconds. 7 rows.
```

**Step 9.** Join tables across locally accelerated sources and query
Expand Down