1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 流式SQL处理示例配置
logging:
level: trace
streams:
- input:
type: "file"
# 内存输入配置,提供一些测试消息
path: "./examples/stream_data.json"
# close_on_eof: true
# start_from_beginning: true
# - input:
# type: "memory"
# # 内存输入配置,提供一些测试消息
# messages:
# - '{ "timestamp": 1625000000000, "value": 10, "sensor": "temp_1" }'
# - '{ "timestamp": 1625000001000, "value": 15, "sensor": "temp_1" }'
# - '{ "timestamp": 1625000002000, "value": 12, "sensor": "temp_1" }'
pipeline:
thread_num: 4
processors:
- type: "json_to_arrow"
- type: "sql"
# SQL查询语句,支持标准SQL语法
query: "SELECT * ,cast(value as string) as tx FROM flow"
# 表名(用于SQL查询中引用)
# table_name: "events"
- type: "arrow_to_json"
output:
# type: "stdout"
type: "file"
append: false
path: "examples/output.txt"