SQL
bin/sql-client.sh
Explain 查看执行计划
抽象语法树、优化后执行计划、物理执行计划。
explain SELECT ***;
结果显示
tablemode结果存到内存,显示标准表。changlog
SET execution.result-mode=table
SET execution.result-mode=changelog
执行
Environment Files
现在还不支持DDL,只能用yaml配置。
delay是毫秒
tables:
- name: foo
type: source
update-mode: append
schema:
- name: id
type: LONG
- name: ct
type: TIMESTAMP
rowtime:
timestamps:
type: "from-field"
from: "eventTime"
watermarks:
type: "periodic-bounded"
delay: "60000"
- name: name
type: STRING
connector:
property-version: 1
type: kafka
version: 2.2.0
topic: foo-topic
startup-mode: earliest-offset
properties:
- key: zookeeper.connect
value: ${ZOOKEEPER}:2181
- key: bootstrap.servers
value: ${KAFKA}:9092
- key: group.id
value: foo-group
format:
property-version: 1
type: json
schema: "ROW(id LONG, ct TIMESTAMP, name STRING)"
- name: bar
type: sink
update-mode: append
schema:
- name: id
type: LONG
connector:
property-version: 1
type: kafka
version: 2.2.0
topic: bar-topic
startup-mode: earliest-offset
properties:
- key: zookeeper.connect
value: zookeeper:2181
- key: bootstrap.servers
value: kafka:9092
- key: group.id
value: foo-topic
format:
property-version: 1
type: json
schema: "ROW(id LONG)"
functions:
- name: topN
from: class
class: org.foo.sql.udf.TopN