Commit 92b0513
authored
Support for QuestDB arrays (#33)
What This Enables
This PR allows you to stream multi-dimensional array data from Kafka to QuestDB.
Previously, any message containing arrays would cause the connector to crash with Unsupported type errors. Now you can store sensor readings, machine learning features, financial time series, and other array-based data.
Real-World Use Cases Now Supported
IoT & Sensor Data
{
"device_id": "sensor_001",
"temperature_readings": [20.1, 20.3, 20.5, 20.7],
"location": "warehouse_a"
}
Machine Learning Features
{
"model_id": "classifier_v2",
"feature_matrix": [[0.1, 0.8], [0.3, 0.6], [0.9, 0.2]],
"prediction_confidence": 0.94
}
Financial Market Data
{
"symbol": "AAPL",
"ohlc_5min": [[150.1, 151.2, 149.8, 150.9], [150.9, 152.1, 150.3, 151.5]],
"volume": [12500, 13200]
}
Your array data flows through to QuestDB and gets stored as native arrays, queryable with QuestDB's array functions.
Data Format Support
With Kafka Connect Schema
// Your existing schema definitions work
Schema arraySchema = SchemaBuilder.array(Schema.FLOAT64_SCHEMA).build();
Schema-Free JSON (Most Common)
// Just send your JSON - arrays are auto-detected
{"sensor_data": [23.1, 24.5, 22.8]}`
Current Limitations
Supported
1D, 2D, 3D arrays (current QuestDB version)
Numeric data (integers and floats)
Both schema and schema-free Kafka messages
Nested arrays in complex JSON structures
Not Yet Supported
String arrays - ["apple", "banana"]
Mixed-type arrays - [1, "text", 3.14]
Null elements - [1.0, null, 3.0]]
Empty Arrays - this is a temporary limitation, empty arrays will be supported in future versions
Future Support
Up to 32 dimensions coming in next QuestDB version
Performance optimizations1 parent d616611 commit 92b0513
File tree
6 files changed
+859
-22
lines changed- connector/src
- main/java/io/questdb/kafka
- test/java/io/questdb/kafka
6 files changed
+859
-22
lines changedLines changed: 90 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
| |||
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
114 | 134 | | |
115 | 135 | | |
116 | 136 | | |
| |||
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
196 | 240 | | |
197 | 241 | | |
198 | 242 | | |
| |||
230 | 274 | | |
231 | 275 | | |
232 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
233 | 323 | | |
0 commit comments