Skip to content

Commit 244b443

Browse files
docs: fix v2.2 cookbook validation issues (#595)
1 parent 1149a54 commit 244b443

16 files changed

Lines changed: 121 additions & 92 deletions

File tree

clickhouse/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ Follow the [getting started guide](https://docs.spiceai.org/getting-started) to
4747

4848
See the [datasets reference](https://docs.spiceai.org/reference/spicepod/datasets) for more dataset configuration options.
4949

50-
Set the environment variable `CLICKHOUSE_PASS` to the Clickhouse instance password. Environment variables can be specified on the command line when running the Spice runtime or in a `.env` file in the same directory as `spicepod.yaml`. The password is not required if the Clickhouse instance does not have a password set.
50+
For a password-protected Clickhouse instance, add the password parameter under the dataset's `params`:
5151

52-
i.e. to set the password in a `.env` file:
53-
54-
```bash
55-
echo "CLICKHOUSE_PASS=<password>" > .env
52+
```yaml
53+
clickhouse_pass: ${env:CLICKHOUSE_PASS}
5654
```
5755
58-
A `.env` file is created in the project directory with the following content:
56+
Then set `CLICKHOUSE_PASS` to the Clickhouse instance password. Environment variables can be specified on the command line when running the Spice runtime or in a `.env` file in the same directory as `spicepod.yaml`. Omit `clickhouse_pass` for an instance that does not have a password.
57+
58+
i.e. to set the password in a `.env` file:
5959

6060
```bash
61-
CLICKHOUSE_PASS=<password>
61+
echo "CLICKHOUSE_PASS=<password>" > .env
6262
```
6363

6464
If you followed the above [preparation](#preparation) to generate a Clickhouse server use this:

clickhouse/spicepod.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ datasets:
99
clickhouse_db: default
1010
clickhouse_tcp_port: 9000
1111
clickhouse_user: default
12-
clickhouse_pass: ${env:CLICKHOUSE_PASS}
1312
clickhouse_secure: false # Defaults to true. Set to false if not connecting over SSL
1413
acceleration:
1514
enabled: true

clients/adbc/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Works with `v1.0+`
44

5-
This repository provides a simple cookbook example demonstrating how to use Python to query Spice via the Apache Arrow Database Connectivity (ADBC) API with the Flight SQL interface to Spice OSS. The example script connects to a local Spice OSS runtime, executes a parameterized query and a simple query, and fetches results as Arrow Tables.
5+
This repository provides a simple cookbook example demonstrating how to use Python to query Spice via the Apache Arrow Database Connectivity (ADBC) API with the Flight SQL interface to Spice OSS. The example script connects to a local Spice OSS runtime, executes a parameterized query, and fetches results as an Arrow Table.
66

77
## Requirements
88

@@ -22,7 +22,7 @@ cd cookbook/clients/adbc
2222
### 2. Install dependencies
2323

2424
```bash
25-
python -m venv .venv
25+
python3 -m venv .venv
2626
source .venv/bin/activate
2727
pip install -r requirements.txt
2828
```
@@ -60,7 +60,7 @@ AccountId: [["account123","account789","account456"]]
6060
ServiceId: [["service789","service789","service789"]]
6161
AddOnSid: [["addon3","addon7","addon10"]]
6262
AddOnTypeSid: [["type123","type123","type789"]]
63-
AddOnJson: [["{\feature\":\"voice_integration\"}"","{\feature\":\"voice_integration\"}"","{\feature\":\"mms_support\"}""]]
63+
AddOnJson: [["{"feature":"voice_integration"}","{"feature":"voice_integration"}","{"feature":"mms_support"}"]]
6464
DateCreated: [[2025-04-03 15:45:00,2025-04-07 11:30:00,2025-04-10 09:45:00]]
6565
DateUpdated: [[2025-04-03 15:45:00,2025-04-07 11:30:00,2025-04-10 09:45:00]]
6666
```

clients/adbc/data/test_data.csv

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
AccountId,ServiceId,AddOnSid,AddOnTypeSid,AddOnJson,DateCreated,DateUpdated
2-
account123,service456,addon1,type789,"{\"feature\":\"sms_analytics\"}",2025-04-01 10:00:00,2025-04-01 10:00:00
3-
account123,service456,addon2,type789,"{\"feature\":\"mms_support\"}",2025-04-02 12:30:00,2025-04-03 09:15:00
4-
account123,service789,addon3,type123,"{\"feature\":\"voice_integration\"}",2025-04-03 15:45:00,2025-04-03 15:45:00
5-
account456,service456,addon4,type789,"{\"feature\":\"sms_analytics\"}",2025-04-04 08:20:00,2025-04-05 11:10:00
6-
account456,service123,addon5,type456,"{\"feature\":\"chatbot\"}",2025-04-05 14:00:00,2025-04-05 14:00:00
7-
account123,service456,addon6,type789,"{\"feature\":\"mms_support\"}",2025-04-06 09:00:00,2025-04-07 16:25:00
8-
account789,service789,addon7,type123,"{\"feature\":\"voice_integration\"}",2025-04-07 11:30:00,2025-04-07 11:30:00
9-
account789,service456,addon8,type789,"{\"feature\":\"sms_analytics\"}",2025-04-08 13:15:00,2025-04-09 10:40:00
10-
account123,service123,addon9,type456,"{\"feature\":\"chatbot\"}",2025-04-09 17:00:00,2025-04-09 17:00:00
11-
account456,service789,addon10,type789,"{\"feature\":\"mms_support\"}",2025-04-10 09:45:00,2025-04-10 09:45:00
2+
account123,service456,addon1,type789,"{""feature"":""sms_analytics""}",2025-04-01 10:00:00,2025-04-01 10:00:00
3+
account123,service456,addon2,type789,"{""feature"":""mms_support""}",2025-04-02 12:30:00,2025-04-03 09:15:00
4+
account123,service789,addon3,type123,"{""feature"":""voice_integration""}",2025-04-03 15:45:00,2025-04-03 15:45:00
5+
account456,service456,addon4,type789,"{""feature"":""sms_analytics""}",2025-04-04 08:20:00,2025-04-05 11:10:00
6+
account456,service123,addon5,type456,"{""feature"":""chatbot""}",2025-04-05 14:00:00,2025-04-05 14:00:00
7+
account123,service456,addon6,type789,"{""feature"":""mms_support""}",2025-04-06 09:00:00,2025-04-07 16:25:00
8+
account789,service789,addon7,type123,"{""feature"":""voice_integration""}",2025-04-07 11:30:00,2025-04-07 11:30:00
9+
account789,service456,addon8,type789,"{""feature"":""sms_analytics""}",2025-04-08 13:15:00,2025-04-09 10:40:00
10+
account123,service123,addon9,type456,"{""feature"":""chatbot""}",2025-04-09 17:00:00,2025-04-09 17:00:00
11+
account456,service789,addon10,type789,"{""feature"":""mms_support""}",2025-04-10 09:45:00,2025-04-10 09:45:00

clients/java/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide demonstrates how to use Java to query Spice via the Apache Arrow Flig
66

77
## Requirements
88

9-
- Java 11 or newer
9+
- JDK 17
1010
- [Maven](https://maven.apache.org/) installed
1111
- [Spice CLI](https://docs.spiceai.org/getting-started) installed and Spice OSS runtime available
1212

@@ -36,7 +36,6 @@ spice run
3636
### 4. Run the Java client
3737

3838
```bash
39-
MAVEN_OPTS="--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" \
4039
mvn exec:exec \
4140
-Dexec.mainClass="MessagingServiceApp"
4241
```
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
AccountId,ServiceId,AddOnSid,AddOnTypeSid,AddOnJson,DateCreated,DateUpdated
2-
account123,service456,addon1,type789,"{\"feature\":\"sms_analytics\"}",2025-04-01 10:00:00,2025-04-01 10:00:00
3-
account123,service456,addon2,type789,"{\"feature\":\"mms_support\"}",2025-04-02 12:30:00,2025-04-03 09:15:00
4-
account123,service789,addon3,type123,"{\"feature\":\"voice_integration\"}",2025-04-03 15:45:00,2025-04-03 15:45:00
5-
account456,service456,addon4,type789,"{\"feature\":\"sms_analytics\"}",2025-04-04 08:20:00,2025-04-05 11:10:00
6-
account456,service123,addon5,type456,"{\"feature\":\"chatbot\"}",2025-04-05 14:00:00,2025-04-05 14:00:00
7-
account123,service456,addon6,type789,"{\"feature\":\"mms_support\"}",2025-04-06 09:00:00,2025-04-07 16:25:00
8-
account789,service789,addon7,type123,"{\"feature\":\"voice_integration\"}",2025-04-07 11:30:00,2025-04-07 11:30:00
9-
account789,service456,addon8,type789,"{\"feature\":\"sms_analytics\"}",2025-04-08 13:15:00,2025-04-09 10:40:00
10-
account123,service123,addon9,type456,"{\"feature\":\"chatbot\"}",2025-04-09 17:00:00,2025-04-09 17:00:00
11-
account456,service789,addon10,type789,"{\"feature\":\"mms_support\"}",2025-04-10 09:45:00,2025-04-10 09:45:00
2+
account123,service456,addon1,type789,"{""feature"":""sms_analytics""}",2025-04-01 10:00:00,2025-04-01 10:00:00
3+
account123,service456,addon2,type789,"{""feature"":""mms_support""}",2025-04-02 12:30:00,2025-04-03 09:15:00
4+
account123,service789,addon3,type123,"{""feature"":""voice_integration""}",2025-04-03 15:45:00,2025-04-03 15:45:00
5+
account456,service456,addon4,type789,"{""feature"":""sms_analytics""}",2025-04-04 08:20:00,2025-04-05 11:10:00
6+
account456,service123,addon5,type456,"{""feature"":""chatbot""}",2025-04-05 14:00:00,2025-04-05 14:00:00
7+
account123,service456,addon6,type789,"{""feature"":""mms_support""}",2025-04-06 09:00:00,2025-04-07 16:25:00
8+
account789,service789,addon7,type123,"{""feature"":""voice_integration""}",2025-04-07 11:30:00,2025-04-07 11:30:00
9+
account789,service456,addon8,type789,"{""feature"":""sms_analytics""}",2025-04-08 13:15:00,2025-04-09 10:40:00
10+
account123,service123,addon9,type456,"{""feature"":""chatbot""}",2025-04-09 17:00:00,2025-04-09 17:00:00
11+
account456,service789,addon10,type789,"{""feature"":""mms_support""}",2025-04-10 09:45:00,2025-04-10 09:45:00

clients/scala/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide demonstrates how to use Scala to query Spice via the Apache Arrow Fli
66

77
## Requirements
88

9-
- Scala 2.13+
9+
- JDK 17
1010
- [sbt](https://www.scala-sbt.org/) installed
1111
- [Spice CLI](https://docs.spiceai.org/getting-started) installed and Spice OSS runtime available
1212

@@ -21,11 +21,13 @@ cd cookbook/clients/scala
2121

2222
### 2. Install dependencies
2323

24-
Ensure you have sbt and Scala installed:
24+
Install sbt and JDK 17:
2525

2626
```bash
27-
brew install scala
27+
brew install openjdk@17
2828
brew install sbt
29+
export JAVA_HOME="$(brew --prefix openjdk@17)/libexec/openjdk.jdk/Contents/Home"
30+
export PATH="$JAVA_HOME/bin:$PATH"
2931
```
3032

3133
### 3. Start Spice OSS
@@ -47,16 +49,16 @@ Expected output:
4749

4850
```
4951
[info] Add-ons by account and service:
50-
[info] MessagingServiceAddOn(account123,service456,addon6,type789,{\feature\":\"mms_support\"}",2025-04-06 16:00:00.0,2025-04-07 23:25:00.0)
51-
[info] MessagingServiceAddOn(account123,service456,addon2,type789,{\feature\":\"mms_support\"}",2025-04-02 19:30:00.0,2025-04-03 16:15:00.0)
52-
[info] MessagingServiceAddOn(account123,service456,addon1,type789,{\feature\":\"sms_analytics\"}",2025-04-01 17:00:00.0,2025-04-01 17:00:00.0)
52+
[info] addon6
53+
[info] addon2
54+
[info] addon1
5355
[info] Add-ons by add-on type:
54-
[info] MessagingServiceAddOn(account123,service456,addon1,type789,{\feature\":\"sms_analytics\"}",2025-04-01 17:00:00.0,2025-04-01 17:00:00.0)
55-
[info] MessagingServiceAddOn(account123,service456,addon2,type789,{\feature\":\"mms_support\"}",2025-04-02 19:30:00.0,2025-04-03 16:15:00.0)
56-
[info] MessagingServiceAddOn(account456,service456,addon4,type789,{\feature\":\"sms_analytics\"}",2025-04-04 15:20:00.0,2025-04-05 18:10:00.0)
57-
[info] MessagingServiceAddOn(account123,service456,addon6,type789,{\feature\":\"mms_support\"}",2025-04-06 16:00:00.0,2025-04-07 23:25:00.0)
58-
[info] MessagingServiceAddOn(account789,service456,addon8,type789,{\feature\":\"sms_analytics\"}",2025-04-08 20:15:00.0,2025-04-09 17:40:00.0)
59-
[info] MessagingServiceAddOn(account456,service789,addon10,type789,{\feature\":\"mms_support\"}",2025-04-10 16:45:00.0,2025-04-10 16:45:00.0)
56+
[info] addon1
57+
[info] addon2
58+
[info] addon4
59+
[info] addon6
60+
[info] addon8
61+
[info] addon10
6062
```
6163

6264
## Learn more

clients/scala/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ libraryDependencies ++= Seq(
1212
)
1313

1414

15-
run / javaOptions += "--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED"
15+
run / javaOptions += "--add-opens=java.base/java.nio=ALL-UNNAMED"
1616
run / javaOptions += "--add-opens=java.base/java.lang=ALL-UNNAMED"
1717
run / fork := true

clients/scala/data/test_data.csv

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
AccountId,ServiceId,AddOnSid,AddOnTypeSid,AddOnJson,DateCreated,DateUpdated
2-
account123,service456,addon1,type789,"{\"feature\":\"sms_analytics\"}",2025-04-01 10:00:00,2025-04-01 10:00:00
3-
account123,service456,addon2,type789,"{\"feature\":\"mms_support\"}",2025-04-02 12:30:00,2025-04-03 09:15:00
4-
account123,service789,addon3,type123,"{\"feature\":\"voice_integration\"}",2025-04-03 15:45:00,2025-04-03 15:45:00
5-
account456,service456,addon4,type789,"{\"feature\":\"sms_analytics\"}",2025-04-04 08:20:00,2025-04-05 11:10:00
6-
account456,service123,addon5,type456,"{\"feature\":\"chatbot\"}",2025-04-05 14:00:00,2025-04-05 14:00:00
7-
account123,service456,addon6,type789,"{\"feature\":\"mms_support\"}",2025-04-06 09:00:00,2025-04-07 16:25:00
8-
account789,service789,addon7,type123,"{\"feature\":\"voice_integration\"}",2025-04-07 11:30:00,2025-04-07 11:30:00
9-
account789,service456,addon8,type789,"{\"feature\":\"sms_analytics\"}",2025-04-08 13:15:00,2025-04-09 10:40:00
10-
account123,service123,addon9,type456,"{\"feature\":\"chatbot\"}",2025-04-09 17:00:00,2025-04-09 17:00:00
11-
account456,service789,addon10,type789,"{\"feature\":\"mms_support\"}",2025-04-10 09:45:00,2025-04-10 09:45:00
2+
account123,service456,addon1,type789,"{""feature"":""sms_analytics""}",2025-04-01 10:00:00,2025-04-01 10:00:00
3+
account123,service456,addon2,type789,"{""feature"":""mms_support""}",2025-04-02 12:30:00,2025-04-03 09:15:00
4+
account123,service789,addon3,type123,"{""feature"":""voice_integration""}",2025-04-03 15:45:00,2025-04-03 15:45:00
5+
account456,service456,addon4,type789,"{""feature"":""sms_analytics""}",2025-04-04 08:20:00,2025-04-05 11:10:00
6+
account456,service123,addon5,type456,"{""feature"":""chatbot""}",2025-04-05 14:00:00,2025-04-05 14:00:00
7+
account123,service456,addon6,type789,"{""feature"":""mms_support""}",2025-04-06 09:00:00,2025-04-07 16:25:00
8+
account789,service789,addon7,type123,"{""feature"":""voice_integration""}",2025-04-07 11:30:00,2025-04-07 11:30:00
9+
account789,service456,addon8,type789,"{""feature"":""sms_analytics""}",2025-04-08 13:15:00,2025-04-09 10:40:00
10+
account123,service123,addon9,type456,"{""feature"":""chatbot""}",2025-04-09 17:00:00,2025-04-09 17:00:00
11+
account456,service789,addon10,type789,"{""feature"":""mms_support""}",2025-04-10 09:45:00,2025-04-10 09:45:00

clients/scala/src/main/scala/DemoApp.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ object MessagingServiceApp {
7171
try {
7272
val addOns1 = dao.getMessagingServiceAddOns("account123", "service456")
7373
println("Add-ons by account and service:")
74-
addOns1.asScala.foreach(println)
74+
addOns1.asScala.foreach(addOn => println(addOn.AddOnSid))
7575

7676
val addOns2 = dao.getMessagingServiceAddOnByAddOnType("type789", 10)
7777
println("\nAdd-ons by add-on type:")
78-
addOns2.asScala.foreach(println)
78+
addOns2.asScala.foreach(addOn => println(addOn.AddOnSid))
7979
} finally {
8080
dbi.close(dao)
8181
}

0 commit comments

Comments
 (0)