{% include JB/setup %}
Apache Flink is an open source platform for distributed stream and batch data processing. Flinkās core is a streaming dataflow engine that provides data distribution, communication, and fault tolerance for distributed computations over data streams. Flink also builds batch processing on top of the streaming engine, overlaying native iteration support, managed memory, and program optimization.
Apache Flink is supported in Zeppelin with Flink interpreter group which consists of below five interpreters.
The Flink interpreter can be configured with properties provided by Zeppelin. You can also set other flink properties which are not listed in the table. For a list of additional properties, refer to Flink Available Properties.
Zeppelin will create 4 variables to represent flink's entrypoint:
senv
(StreamExecutionEnvironment),env
(ExecutionEnvironment)stenv
(StreamTableEnvironment)btenv
(BatchTableEnvironment)Starting from Flink 1.9, there‘re 2 planners supported by Flink’s table api: flink
& blink
.
zeppelin.flink.planner
to flink
).blink
planner which is also the default value of zeppelin.flink.planner
.In order to use Hive in Flink, you have to do several setting.
zeppelin.flink.enableHive
to true
HIVE_CONF_DIR
either in flink interpreter setting or zeppelin-env.sh
zeppelin.flink.hive.version
, by default it is 2.3.4. If you are using Hive 1.2.x, then you need to set it as 1.2.2
After these settings, you will be able to query hive table via either table api %flink
or batch sql %flink.bsql
Zeppelin automatically injects ZeppelinContext
as variable z
in your Scala/Python environment. ZeppelinContext
provides some additional functions and utilities. See Zeppelin-Context for more details.
By default, zeppelin would use IPython in %flink.pyflink
when IPython is available, Otherwise it would fall back to the original python implementation. If you don't want to use IPython, then you can set zeppelin.pyflink.useIPython
as false
in interpreter setting. For the IPython features, you can refer doc Python Interpreter
Zeppelin is shipped with several Flink tutorial notes which may be helpful for you.