File tree Expand file tree Collapse file tree 1 file changed +32
-5
lines changed Expand file tree Collapse file tree 1 file changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -292,15 +292,42 @@ The table below shows supported Avro primitive data types and how they match Tim
292
292
293
293
### Avro Logical Types
294
294
295
- Here is a list of supported logical types :
295
+ If you use ` logicalType ` in your Avro schema, Timeplus will automatically map it to the corresponding Timeplus data type :
296
296
297
- * UUID: maps to uuid.
298
- * Date: maps to date.
299
- * Timestamp (millisecond precision): maps to datetime64(3).
300
- * Timestamp (microsecond precision): maps to datetime64(6).
297
+ - UUID: maps to ` uuid ` .
298
+ - Date: maps to ` date ` .
299
+ - Timestamp (millisecond precision): maps to ` datetime64(3) ` .
300
+ - Timestamp (microsecond precision): maps to ` datetime64(6) ` .
301
301
302
302
Other logical types are not implemented yet.
303
303
304
+ For example, given the following Avro schema:
305
+
306
+ ``` json
307
+ {
308
+ "type" : " record" ,
309
+ "name" : " schema" ,
310
+ "fields" : [
311
+ {
312
+ "name" : " time" ,
313
+ "type" : { "type" : " long" , "logicalType" : " timestamp-millis" }
314
+ },
315
+ { "name" : " key" , "type" : " string" },
316
+ { "name" : " value" , "type" : " double" }
317
+ ]
318
+ }
319
+ ```
320
+
321
+ The external stream uses tuple will be like this:
322
+
323
+ ``` sql
324
+ CREATE EXTERNAL STREAM avro (
325
+ time datetime64(3 ),
326
+ key string,
327
+ value float64
328
+ ) SETTINGS ...;
329
+ ```
330
+
304
331
### record
305
332
There are two ways to map a ` record ` . The simple one is using ` tuple ` . Here is an example:
306
333
You can’t perform that action at this time.
0 commit comments