Skip to content

Commit db88f54

Browse files
committed
fix(doc): use colon instead of equals sign in session properties
Signed-off-by: divinerapier <[email protected]>
1 parent 822e88d commit db88f54

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,19 @@ also known as namespace in some environments.
183183

184184
```
185185
Type: string
186-
Valid values: comma-separated list of key=value session properties
186+
Valid values: semicolon-separated list of key:value session properties (e.g. key1:value1;key2:value2)
187187
Default: empty
188188
```
189189

190190
The `session_properties` parameter must contain valid parameters accepted by
191191
the Trino server. Run `SHOW SESSION` in Trino to get the current list.
192192

193+
Example:
194+
195+
```
196+
session_properties=query_max_run_time:2s;query_priority:1
197+
```
198+
193199
##### `custom_client`
194200

195201
```
@@ -256,7 +262,7 @@ http://user@localhost:8080?source=hello&catalog=default&schema=foobar
256262
```
257263

258264
```
259-
https://user@localhost:8443?session_properties=query_max_run_time=10m,query_priority=2
265+
https://user@localhost:8443?session_properties=query_max_run_time:10m;query_priority:2
260266
```
261267

262268
## Data types

trino/integration_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,23 @@ func waitForContainerHealth(containerID, containerName string) {
349349
}
350350
}
351351

352+
func waitForTrinoReady(t *testing.T, db *sql.DB) {
353+
if err := pool.Retry(func() error {
354+
row := db.QueryRow("SELECT count(*) FROM system.runtime.nodes WHERE state = 'active'")
355+
var count int
356+
if row.Scan(&count) != nil {
357+
t.Logf("Failed to query nodes: %v", row.Err())
358+
return errors.New("Not ready")
359+
}
360+
if count > 0 {
361+
return nil
362+
}
363+
return errors.New("Not ready")
364+
}); err != nil {
365+
log.Fatal("Timed out waiting for Trino to be ready")
366+
}
367+
}
368+
352369
func generateCerts(dir string) error {
353370
priv, err := rsa.GenerateKey(rand.Reader, 2048)
354371
if err != nil {
@@ -474,6 +491,7 @@ func integrationOpen(t *testing.T, dsn ...string) *sql.DB {
474491
if err != nil {
475492
t.Fatal(err)
476493
}
494+
waitForTrinoReady(t, db)
477495
return db
478496
}
479497

0 commit comments

Comments
 (0)