Skip to content

Commit 03207b6

Browse files
authored
Merge branch 'main' into jh_kafka_StructArrayExplode
2 parents ae98503 + 0ebc2fd commit 03207b6

16 files changed

Lines changed: 213 additions & 136 deletions

File tree

documentation/concepts/materialized-views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ Specify a partitioning scheme larger than the sampling interval:
306306

307307
```questdb-sql
308308
CREATE MATERIALIZED VIEW my_view AS (
309-
SELECT timestamp, symbol, sum(amount) FROM trades SAMPLE BY 8h
309+
SELECT timestamp, symbol, sum(amount) AS total_amount FROM trades SAMPLE BY 8h
310310
) PARTITION BY DAY;
311311
```
312312

documentation/ingestion/clients/java.md

Lines changed: 69 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: Java Client Documentation
3-
description: "Dive into QuestDB using the Java ingestion client for high-performance,
4-
insert-only operations. Unlock peak time series data ingestion and analysis
5-
efficiency."
3+
description: "Reference for the questdb-client Maven artifact — the Java ILP ingestion client for QuestDB, covering setup, configuration, authentication, and error handling."
64
---
75

86
import Tabs from "@theme/Tabs"
@@ -11,8 +9,6 @@ import TabItem from "@theme/TabItem"
119

1210
import CodeBlock from "@theme/CodeBlock"
1311

14-
import InterpolateReleaseData from "../../../src/components/InterpolateReleaseData"
15-
1612
import { RemoteRepoExample } from "@theme/RemoteRepoExample"
1713

1814
:::note
@@ -25,7 +21,8 @@ For embedded QuestDB, please check our
2521

2622
:::
2723

28-
The QuestDB Java client is baked right into the QuestDB binary.
24+
The QuestDB Java client is distributed as a separate Maven artifact
25+
(`org.questdb:questdb-client`).
2926

3027
The client provides the following benefits:
3128

@@ -46,43 +43,33 @@ for **writing** data to QuestDB. For retrieving data, we recommend using a
4643

4744
:::
4845

49-
## Compatible JDKs
50-
51-
The client relies on some JDK internal libraries, which certain specialised JDK
52-
offerings may not support.
53-
54-
Here is a list of known incompatible JDKs:
55-
56-
- Azul Zing 17
57-
- A fix is in progress. You can use Azul Zulu 17 in the meantime.
58-
5946
## Quick start
6047

61-
Add QuestDB as a dependency in your project's build configuration file.
48+
Add the QuestDB Java client as a dependency in your project's build configuration file.
6249

6350
<Tabs defaultValue="maven" values={[ { label: "Maven", value: "maven" },
6451
{ label: "Gradle", value: "gradle" }, ]}
6552

6653
> <TabItem value="maven">
6754
68-
<InterpolateReleaseData
69-
renderText={(release) => (
70-
<CodeBlock className="language-xml">
71-
{`<dependency>
55+
<InterpolateJavaClientVersion renderText={(release) => (
56+
<CodeBlock className="language-xml">
57+
{`<dependency>
7258
<groupId>org.questdb</groupId>
73-
<artifactId>questdb</artifactId>
59+
<artifactId>questdb-client</artifactId>
7460
<version>${release.name}</version>
7561
</dependency>`}
76-
</CodeBlock>
77-
)}
78-
/>
62+
</CodeBlock>
63+
)} />
7964
</TabItem>
8065
<TabItem value="gradle">
81-
<InterpolateReleaseData
82-
renderText={(release) => (
83-
<CodeBlock className="language-text">
84-
{`compile group: 'org.questdb', name: 'questdb', version: '${release.name}'`}
85-
</CodeBlock> )} /> </TabItem> </Tabs>
66+
<InterpolateJavaClientVersion renderText={(release) => (
67+
<CodeBlock className="language-text">
68+
{`implementation 'org.questdb:questdb-client:${release.name}'`}
69+
</CodeBlock>
70+
)} />
71+
</TabItem>
72+
</Tabs>
8673

8774
The code below creates a client instance configured to use HTTP transport to
8875
connect to a QuestDB server running on localhost, port 9000. It then sends two
@@ -92,27 +79,10 @@ time.
9279

9380
<RemoteRepoExample name="ilp-http" lang="java" header={false} />
9481

95-
Configure the client using a configuration string. It follows this general
96-
format:
97-
98-
```text
99-
<protocol>::<key>=<value>;<key>=<value>;...;
100-
```
101-
102-
[Transport protocol](/docs/ingestion/ilp/overview/#transport-selection)
103-
can be one of these:
104-
105-
- `http` — ILP/HTTP
106-
- `https` — ILP/HTTP with TLS encryption
107-
- `tcp` — ILP/TCP
108-
- `tcps` — ILP/TCP with TLS encryption
109-
110-
The key `addr` sets the hostname and port of the QuestDB server. Port defaults
111-
to 9000 for HTTP(S) and 9009 for TCP(S).
112-
113-
The minimum configuration includes the transport and the address. For a complete
114-
list of options, refer to the [Configuration Options](#configuration-options)
115-
section.
82+
The client is configured using a configuration string. See
83+
[Ways to create the client](#ways-to-create-the-client) for all configuration
84+
methods, and [Configuration options](#configuration-options) for available
85+
settings.
11686

11787
## Authenticate and encrypt
11888

@@ -132,20 +102,38 @@ There are three ways to create a client instance:
132102

133103
1. **From a configuration string.** This is the most common way to create a
134104
client instance. It describes the entire client configuration in a single
135-
string. See [Configuration options](#configuration-options) for all available
136-
options. It allows sharing the same configuration across clients in different
137-
languages.
105+
string, and allows sharing the same configuration across clients in different
106+
languages. The general format is:
107+
108+
```text
109+
<protocol>::<key>=<value>;<key>=<value>;...;
110+
```
111+
112+
[Transport protocol](/docs/ingestion/ilp/overview/#transport-selection)
113+
can be one of these:
114+
115+
- `http` — ILP/HTTP
116+
- `https` — ILP/HTTP with TLS encryption
117+
- `tcp` — ILP/TCP
118+
- `tcps` — ILP/TCP with TLS encryption
119+
120+
The key `addr` sets the hostname and port of the QuestDB server. Port
121+
defaults to 9000 for HTTP(S) and 9009 for TCP(S). The minimum configuration
122+
includes the transport and the address.
138123

139124
```java
140125
try (Sender sender = Sender.fromConfig("http::addr=localhost:9000;auto_flush_rows=5000;retry_timeout=10000;")) {
141126
// ...
142127
}
143128
```
144129

130+
For all available options, see
131+
[Configuration options](#configuration-options).
132+
145133
2. **From an environment variable.** The `QDB_CLIENT_CONF` environment variable
146134
is used to set the configuration string. Moving configuration parameters to
147135
an environment variable allows you to avoid hard-coding sensitive information
148-
such as tokens and password in your code.
136+
such as tokens and passwords in your code.
149137

150138
```bash
151139
export QDB_CLIENT_CONF="http::addr=localhost:9000;auto_flush_rows=5000;retry_timeout=10000;"
@@ -169,16 +157,16 @@ There are three ways to create a client instance:
169157
}
170158
```
171159

172-
## Configuring multiple urls
160+
## Configuring multiple URLs
173161

174162
:::note
175163

176164
This feature requires QuestDB OSS 9.1.0+ or Enterprise 3.0.4+.
177165

178166
:::
179167

180-
The ILP client can be configured with multiple _possible_ endpoints to send your data to. Only one will be sent to at
181-
any one time.
168+
The ILP client can be configured with multiple _possible_ endpoints to send your data to. Only one endpoint is used at
169+
a time.
182170

183171
To configure this feature, simply provide multiple `addr` entries. For example:
184172

@@ -193,10 +181,10 @@ On initialisation, if `protocol_version=auto`, the sender will identify the firs
193181
any subsequent data to it.
194182

195183
In the event that the instance becomes unavailable for writes, the client will retry the other possible endpoints, and when it finds
196-
a new writeable instance, will _stick_ to it instead. This unvailability is characterised by failures to connect or locate the instance,
184+
a new writeable instance, will _stick_ to it instead. This unavailability is characterised by failures to connect or locate the instance,
197185
or the instance returning an error code due to it being read-only.
198186

199-
By configuring multiple addresses, you can continue allowing you to continue to capture data if your primary instance
187+
By configuring multiple addresses, you can continue to capture data if your primary instance
200188
fails, without having to reconfigure the clients. This backup instance can be hot or cold, and so long as it is assigned a known address, it will be written to as soon as it is started.
201189

202190
Enterprise users can leverage this feature to transparently handle replication failover, without the need to introduce a load-balancer or
@@ -217,7 +205,7 @@ to `30s` or higher.
217205
1. Create a client instance via `Sender.fromConfig()`.
218206
2. Use `table(CharSequence)` to select a table for inserting a new row.
219207
3. Use `symbol(CharSequence, CharSequence)` to add all symbols. You must add
220-
symbols before adding other column type.
208+
symbols before adding other column types.
221209
4. Use the following options to add all the remaining columns:
222210

223211
- `stringColumn(CharSequence, CharSequence)`
@@ -243,7 +231,7 @@ precision and scale.
243231
set a designated timestamp.
244232
6. Optionally: You can use `flush()` to send locally buffered data into a
245233
server.
246-
7. Go to the step no. 2 to start a new row.
234+
7. Repeat from step 2 to start a new row.
247235
8. Use `close()` to dispose the Sender after you no longer need it.
248236

249237
## Ingest arrays
@@ -293,15 +281,15 @@ You can configure the client to not use automatic flushing, and issue explicit
293281
flush requests by calling `sender.flush()`:
294282

295283
```java
296-
try (Sender sender = Sender.fromConfig("http::addr=localhost:9000;auto_flush=off")) {
284+
try (Sender sender = Sender.fromConfig("http::addr=localhost:9000;auto_flush=off")) {
297285
sender.table("trades")
298286
.symbol("symbol", "ETH-USD")
299287
.symbol("side", "sell")
300288
.doubleColumn("price", 2615.54)
301289
.doubleColumn("amount", 0.00044)
302290
.atNow();
303291
sender.table("trades")
304-
.symbol("symbol", "TC-USD")
292+
.symbol("symbol", "BTC-USD")
305293
.symbol("side", "sell")
306294
.doubleColumn("price", 39269.98)
307295
.doubleColumn("amount", 0.001)
@@ -343,17 +331,16 @@ closing the client.
343331

344332
## Error handling
345333

334+
HTTP automatically retries failed, recoverable requests: network errors, some
335+
server errors, and timeouts. Non-recoverable errors include invalid data,
336+
authentication errors, and other client-side errors.
346337

347338
:::note
348339

349340
If you have configured multiple addresses, retries will be run against different instances.
350341

351342
:::
352343

353-
HTTP automatically retries failed, recoverable requests: network errors, some
354-
server errors, and timeouts. Non-recoverable errors include invalid data,
355-
authentication errors, and other client-side errors.
356-
357344
Retrying is especially useful during transient network issues or when the server
358345
goes offline for a short period. Configure the retrying behavior through the
359346
`retry_timeout` configuration option or via the builder API with
@@ -364,9 +351,9 @@ it hits the timeout without success, the client throws a `LineSenderException`.
364351
The client won't retry requests while it's being closed and attempting to flush
365352
the data left over in the buffer.
366353

367-
The TCP transport has no mechanism to notify the client it encountered an
368-
error; instead it just disconnects. When the client detects this, it throws a
369-
`LineSenderException` and becomes unusable.
354+
The TCP transport has no mechanism to notify the client it encountered an
355+
error; instead it just disconnects. When the client detects this, it throws a
356+
`LineSenderException` and becomes unusable.
370357

371358
## Recover after a client-side error
372359

@@ -383,7 +370,7 @@ rows were accepted by the server.
383370

384371
Error handling behaviour changed with the release of QuestDB 9.1.0.
385372

386-
Previously, failing all retries would cause the code to except and release the buffered data.
373+
Previously, failing all retries would cause an exception and release the buffered data.
387374

388375
Now the buffer will not be released. If you wish to re-use the same sender with fresh data, you must call the
389376
new `reset()` function.
@@ -475,6 +462,16 @@ method.
475462
For a breakdown of available options, see the
476463
[Configuration string](/docs/ingestion/clients/configuration-string/) page.
477464

465+
## Compatible JDKs
466+
467+
The client relies on some JDK internal libraries, which certain specialised JDK
468+
offerings may not support.
469+
470+
Here is a list of known incompatible JDKs:
471+
472+
- Azul Zing 17
473+
- A fix is in progress. You can use Azul Zulu 17 in the meantime.
474+
478475
## Other considerations
479476

480477
- Refer to the [ILP overview](/docs/ingestion/ilp/overview) for details

documentation/ingestion/import-csv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ TRUNCATE TABLE table_name;
497497
or import into another empty table and then use `INSERT INTO SELECT`:
498498
499499
```questdb-sql
500-
INSERT INTO table_name batch 100000
500+
INSERT BATCH 100000 INTO table_name
501501
SELECT * FROM other_table;
502502
```
503503

documentation/query/datatypes/geohashes.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ use of `WHERE 1 != 1` means that no rows are inserted, only the table schema is
161161
prepared:
162162

163163
```questdb-sql
164-
CREATE TABLE new_table AS
165-
(SELECT cast(null AS geohash(4c)) gh4c)
164+
CREATE TABLE new_table AS (
165+
SELECT cast(null AS geohash(4c)) gh4c
166166
FROM source_table WHERE 1 != 1
167+
)
167168
```
168169

169170
Geohash types can be cast from higher to lower precision, but not from lower to

documentation/query/functions/meta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ table_columns('my_table');
619619
| s | VARCHAR | false | 0 | false | 0 | false | false |
620620

621621
```questdb-sql title="Get designated timestamp column"
622-
SELECT column, type, designated FROM table_columns('my_table') WHERE designated = true;
622+
SELECT "column", type, designated FROM table_columns('my_table') WHERE designated = true;
623623
```
624624

625625
| column | type | designated |

documentation/query/operators/spatial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The `within` operator can be used to filter results by geohash:
6666
```questdb-sql
6767
SELECT * FROM pos
6868
WHERE g8c within(#ezz, #u33d8)
69-
LATEST ON ts PARTITON BY uuid;
69+
LATEST ON ts PARTITION BY uuid;
7070
```
7171

7272
This yields the following results:
@@ -82,7 +82,7 @@ exist within a larger grid:
8282
```questdb-sql
8383
SELECT * FROM pos
8484
WHERE g8c within(#u33)
85-
LATEST ON ts PARTITON BY uuid;
85+
LATEST ON ts PARTITION BY uuid;
8686
```
8787

8888
| ts | device_id | g1c | g8c |

documentation/query/sql/copy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ WITH FORMAT PARQUET;
373373
Check all recent exports:
374374

375375
```questdb-sql title="View export history"
376-
SELECT ts, table, destination, status, rows_exported
376+
SELECT ts, "table", destination, status, rows_exported
377377
FROM sys.copy_export_log
378378
WHERE ts > dateadd('d', -1, now())
379379
ORDER BY ts DESC;

0 commit comments

Comments
 (0)