Skip to content

Commit b7bb89e

Browse files
committed
Updated documentation on setting timezone.
1 parent 418560c commit b7bb89e

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

examples/docker-compose/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,50 @@ Solution: Upgrade docker/docker compose to v2.
2828

2929
### Supplemental
3030

31+
#### Setting ClickHouse Server Timezone
32+
33+
To configure the ClickHouse server timezone:
34+
35+
1. Edit `config.xml` with your desired timezone:
36+
37+
```xml
38+
<clickhouse replace="true">
39+
<timezone>America/Chicago</timezone>
40+
</clickhouse>
41+
```
42+
43+
2. Uncomment the volume mount in `docker-compose.yaml` under the `clickhouse` service:
44+
45+
```yaml
46+
volumes:
47+
- ./config.xml:/etc/clickhouse-server/conf.d/config.xml
48+
```
49+
50+
3. Restart the containers: `docker compose down && docker compose up`
51+
3152
#### Querying data using Spark
53+
To set the session timezone in Spark, add the following configuration under the `configs` section in `docker-compose-spark-iceberg.yaml`:
54+
55+
```yaml
56+
configs:
57+
- spark.sql.session.timeZone=America/Chicago
58+
```
59+
60+
Replace `America/Chicago` with your desired timezone.
61+
62+
For example, your Spark service definition might look like:
63+
64+
```yaml
65+
spark-iceberg:
66+
image: ...
67+
environment:
68+
- ...
69+
configs:
70+
- spark.sql.session.timeZone=America/Chicago
71+
...
72+
```
73+
74+
This ensures that Spark SQL sessions will use the specified timezone.
3275

3376
```shell
3477
docker compose -f docker-compose-spark-iceberg.yaml down -v

examples/docker-compose/docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ services:
5353
volumes:
5454
# for access to clickhouse-logs
5555
- ./data/docker-compose/clickhouse/var/log/clickhouse-server:/var/log/clickhouse-server
56-
- ./config.xml:/etc/clickhouse-server/conf.d/config.xml
57-
depends_on:
58-
- ice-rest-catalog
56+
# - ./config.xml:/etc/clickhouse-server/conf.d/config.xml
57+
depends_on:
58+
- ice-rest-catalog
5959
configs:
6060
clickhouse-init:
6161
content: |

0 commit comments

Comments
 (0)