{"id":1734,"date":"2020-06-24T17:51:35","date_gmt":"2020-06-24T09:51:35","guid":{"rendered":"http:\/\/39.97.231.10\/?p=1734"},"modified":"2020-06-24T17:51:35","modified_gmt":"2020-06-24T09:51:35","slug":"flink-on-zeppelin-batch","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=1734","title":{"rendered":"Flink on Zeppelin  &#8211; Batch"},"content":{"rendered":"<p>\u672c\u6587\u8bb2\u8ff0\u5982\u4f55\u4f7f\u7528Flink SQL + UDF\u6765\u505aBatch ETL\u548cBI\u6570\u636e\u5206\u6790\u7684\u4efb\u52a1\u3002<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.582_51031.jpeg\\\" \/><\/p>\n<section><strong>Flink Interpreter\u7c7b\u578b<\/strong><\/section>\n<p>\u00a0 \u00a0 \u9996\u5148\u4ecb\u7ecd\u4e0bZeppelin\u4e2d\u7684Flink Interpreter\u7c7b\u578b\u3002Zeppelin\u7684Flink Interpreter\u652f\u6301Flink\u7684\u6240\u6709API (DataSet, DataStream, Table API \uff09\u3002\u8bed\u8a00\u65b9\u9762\u652f\u6301Scala\uff0cPython\uff0cSQL\u3002\u4e0b\u56fe\u662fZeppelin\u4e2d\u652f\u6301\u7684\u4e0d\u540c\u573a\u666f\u4e0b\u7684Flink Interpreter\u3002<\/p>\n<table>\n<tbody>\n<tr class=\\\"firstRow\\\">\n<td valign=\\\"top\\\" width=\\\"95\\\"><strong>Name<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\"><strong>Class<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"95\\\">%flink<\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\">FlinkInterpreter<\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\">Creates ExecutionEnvironment\/StreamExecutionEnvironment\/BatchTableEnvironment\/StreamTableEnvironment and provides a Scala environment<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"95\\\">%flink.pyflink<\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\">PyFlinkInterpreter<\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\">Provides a python environment<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"95\\\">%flink.ipyflink<\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\">IPyFlinkInterpreter<\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\">Provides an ipython environment<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"95\\\">%flink.ssql<\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\">FlinkStreamSqlInterpreter<\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\">Provides a stream sql environment<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"95\\\">%flink.bsql<\/td>\n<td valign=\\\"top\\\" width=\\\"167\\\">FlinkBatchSqlInterpreter<\/td>\n<td valign=\\\"top\\\" width=\\\"251\\\">Provides a batch sql environment<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<section><strong>\u914d\u7f6eFlink Interpreter<\/strong><\/section>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u4e0b\u56fe\u4f8b\u4e3e\u4e86\u6240\u6709\u91cd\u8981\u7684Flink\u914d\u7f6e\u4fe1\u606f\uff0c\u9664\u6b64\u4e4b\u5916\u4f60\u8fd8\u53ef\u4ee5\u914d\u7f6e\u4efb\u610fFlink\u7684Configuration\uff08https:\/\/ci.apache.org\/projects\/flink\/flink-docs-master\/ops\/config.html\uff09<\/p>\n<table>\n<tbody>\n<tr class=\\\"firstRow\\\">\n<td valign=\\\"top\\\" width=\\\"137\\\"><strong>Property<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><strong>Default<\/strong><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">FLINK_HOME<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Flink\u7684\u5b89\u88c5\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">HADOOP_CONF_DIR<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Hadoop\u914d\u7f6e\u4fe1\u606f\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">HIVE_CONF_DIR<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Hive\u914d\u7f6e\u4fe1\u606f\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.execution.mode<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\">local<\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Execution mode of flink, e.g. local | yarn | remote<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.execution.remote.host<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">jobmanager hostname if it is remote mode<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.execution.remote.port<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">jobmanager port if it is remote mode<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.jm.memory<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\">1024<\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Total number of memory(mb) of JobManager<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.tm.memory<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\">1024<\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Total number of memory(mb) of TaskManager<\/td>\n<\/tr>\n<tr>\n<td valign=\\\"top\\\" width=\\\"137\\\">flink.yarn.appName<\/td>\n<td valign=\\\"top\\\" width=\\\"115\\\">Zeppelin Flink Session<\/td>\n<td valign=\\\"top\\\" width=\\\"261\\\">Yarn app name<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">flink.yarn.queue<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">queue name of yarn app<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">flink.execution.jars<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">additional user jars (comma separated)<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">flink.execution.packages<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\"><\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">additional user packages (comma separated), e.g. org.apache.flink:flink-connector-kafka_2.11:1.10,org.apache.flink:flink-connector-kafka-base_2.11:1.10,org.apache.flink:flink-json:1.10<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">zeppelin.pyflink.python<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">python<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">python binary executable for PyFlink<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">table.exec.resource.default-parallelism<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">1<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">Default parallelism for flink sql job<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">zeppelin.flink.scala.color<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">true<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">whether display scala shell output in colorful format<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">zeppelin.flink.enableHive<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">false<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">whether enable hive<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">zeppelin.flink.printREPLOutput<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">true<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">Print REPL output<\/td>\n<\/tr>\n<tr>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"137\\\">zeppelin.flink.maxResult<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"115\\\">1<\/td>\n<td colspan=\\\"1\\\" rowspan=\\\"1\\\" valign=\\\"top\\\" width=\\\"90\\\">max number of rows returned by sql interpreter<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>StreamExecutionEnvironment, ExecutionEnvironment, StreamTableEnvironment, BatchTableEnvironment<\/h2>\n<p>Flink Interpreter (%flink) \u4e3a\u7528\u6237\u81ea\u52a8\u521b\u5efa\u4e86\u4e0b\u97626\u4e2a\u53d8\u91cf\u4f5c\u4e3aFlink Scala\u7a0b\u5e8f\u7684\u5165\u53e3\u3002<\/p>\n<ul class=\\\" list-paddingleft-2\\\">\n<li><code>senv<\/code>\u00a0(StreamExecutionEnvironment),<\/li>\n<li><code>benv<\/code>\u00a0(ExecutionEnvironment)<\/li>\n<li><code>stenv<\/code>\u00a0(StreamTableEnvironment for blink planner)<\/li>\n<li><code>btenv<\/code>\u00a0(BatchTableEnvironment for blink planner)<\/li>\n<li><code>stenv_2<\/code>\u00a0(StreamTableEnvironment for flink planner)<\/li>\n<li><code>btenv_2<\/code>\u00a0(BatchTableEnvironment for flink planner)<\/li>\n<\/ul>\n<p>PyFlinkInterpreter \uff08%flink.pyflink, %flink.ipyflink) \u4e3a\u7528\u6237\u81ea\u52a8\u521b\u5efa\u4e866\u4e2apython\u53d8\u91cf\u4f5c\u4e3aPyFlink\u7a0b\u5e8f\u7684\u5165\u53e3<\/p>\n<ul class=\\\" list-paddingleft-2\\\">\n<li>s_env\u00a0(StreamExecutionEnvironment),<\/li>\n<li>b_env\u00a0(ExecutionEnvironment)<\/li>\n<li><code>st_env<\/code>\u00a0(StreamTableEnvironment for blink planner)<\/li>\n<li><code>bt_env<\/code>\u00a0(BatchTableEnvironment for blink planner)<\/li>\n<li><code>st_env_2<\/code>\u00a0(StreamTableEnvironment for flink planner)<\/li>\n<li><code>bt_env_2<\/code>\u00a0(BatchTableEnvironment for flink planner)<\/li>\n<\/ul>\n<section>Blink\/Flink Planner<\/section>\n<p>Flink 1.10\u4e2d\u67092\u79cdtable api\u7684planner\uff1a<code>flink<\/code>\u00a0&amp;\u00a0<code>blink<\/code>.<\/p>\n<ul class=\\\" list-paddingleft-2\\\">\n<li>\u5982\u679c\u4f60\u7528DataSet api\u4ee5\u53ca\u9700\u8981\u628aDataSet\u8f6c\u6362\u6210Table\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u4f7f\u7528Flink planner\u7684TableEnvironment\u00a0(<code>btenv_2<\/code>\u00a0and\u00a0<code>stenv_2<\/code>).<\/li>\n<li>\u5176\u4ed6\u573a\u666f\u4e0b,\u00a0\u6211\u4eec\u90fd\u4f1a\u5efa\u8bae\u7528\u6237\u4f7f\u7528<code>blink<\/code>\u00a0planner. \u8fd9\u4e5f\u662fFlink sql\u4f7f\u7528\u7684planner(<code>%flink.bsql<\/code>\u00a0&amp;\u00a0<code>%flink.ssql<\/code>)<\/li>\n<\/ul>\n<section><strong>\u4f7f\u7528Flink Batch SQL<\/strong><\/section>\n<p>\u00a0 \u00a0 \u00a0 %flink.bsql\u00a0\u662f\u7528\u6765\u6267\u884cFlink\u7684batch sql. \u8fd0\u884c\u00a0<code>help<\/code>\u00a0\u547d\u4ee4\u53ef\u4ee5\u5f97\u5230\u6240\u6709\u53ef\u7528\u7684\u547d\u4ee4<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.589_69575.jpeg\\\" \/><br \/>\n\u603b\u7684\u6765\u8bf4\uff0cFlink Batch SQL\u53ef\u4ee5\u7528\u6765\u505a2\u5927\u4efb\u52a1\uff1a<\/p>\n<ul class=\\\" list-paddingleft-2\\\">\n<li>\u4f7f\u7528\u00a0<code>insert into<\/code>\u00a0\u8bed\u53e5\u6765\u505a Batch ETL<\/li>\n<li>\u4f7f\u7528\u00a0<code>select<\/code>\u00a0\u8bed\u53e5\u6765\u505aBI\u00a0\u6570\u636e\u5206\u6790<\/li>\n<\/ul>\n<section><strong>\u57fa\u4e8eBank\u6570\u636e\u7684Batch ETL<\/strong><\/section>\n<p>\u00a0 \u00a0 \u4e0b\u9762\u6211\u4eec\u57fa\u4e8eBank \uff08https:\/\/archive.ics.uci.edu\/ml\/datasets\/bank+marketing\uff09\u6570\u636e\u6765\u505aBatch ETL\u4efb\u52a1\u3002\u9996\u5148\u7528Flink Sql\u521b\u5efa\u4e00\u4e2araw \u6570\u636e\u7684source table\uff0c\u4ee5\u53ca\u6e05\u6d17\u5e72\u51c0\u540e\u7684sink table\u3002<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.575_4830.jpeg\\\" \/><br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.964_33723.jpeg\\\" \/><br \/>\n\u7136\u540e\u518d\u5b9a\u4e49Table Function\u6765parse raw data\u3002<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.604_36751.jpeg\\\" \/><br \/>\n\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u7528insert\u00a0into\u8bed\u53e5\u6765\u8fdb\u884c\u6570\u636e\u8f6c\u6362\uff08source table &#8211;&gt; sink table)<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.581_53178.png\\\" \/><br \/>\n\u7528select\u8bed\u53e5\u6765Preview\u6700\u7ec8\u6570\u636e\uff0c\u9a8c\u8bc1insert\u00a0into\u8bed\u53e5\u7684\u6b63\u786e\u6027<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.584_27039.jpeg\\\" \/><\/p>\n<section><strong>\u57fa\u4e8eBank\u6570\u636e\u7684BI\u6570\u636e\u5206\u6790<\/strong><\/section>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u7ecf\u8fc7\u4e0a\u9762\u7684\u6570\u636e\u6e05\u6d17\u5de5\u4f5c\uff0c\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u5206\u6790\u4e86\u3002\u7528\u6237\u4e0d\u4ec5\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684SQL Select\u8bed\u53e5\u8fdb\u884c\u5206\u6790\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Zeppelin\u7684dynamic forms\u6765\u589e\u52a0\u4ea4\u4e92\u6027\uff08TextBox\uff0cSelect\uff0cCheckbox\uff09<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.603_66564.jpeg\\\" \/><br \/>\n<strong>\u4f7f\u7528Flink UDF<\/strong><br \/>\n<strong>\u00a0 \u00a0 \u00a0\u00a0<\/strong>SQL\u867d\u7136\u5f3a\u5927\uff0c\u4f46\u8868\u8fbe\u80fd\u529b\u6bd5\u7adf\u6709\u9650\u3002\u6709\u65f6\u5019\u5c31\u8981\u501f\u52a9\u4e8eUDF\u6765\u8868\u8fbe\u66f4\u590d\u6742\u7684\u903b\u8f91\u3002Flink Interpreter \u652f\u63012\u79cdUDF (Scala + Python)\u3002\u4e0b\u9762\u662f2\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u3002<br \/>\n<strong>\u00a0 \u00a0 \u00a0 \u00a0Scala UDF<\/strong><\/p>\n<section>\n<pre>%flink\nclass ScalaUpper extends ScalarFunction {\n  def eval(str: String) = str.toUpperCase\n}\nbtenv.registerFunction(\\\"scala_upper\\\", new ScalaUpper())<\/pre>\n<\/section>\n<p><strong>\u00a0 \u00a0 \u00a0 \u00a0 Python UDF<\/strong><\/p>\n<pre>%flink.pyflink\nclass PythonUpper(ScalarFunction):\n  def eval(self, s):\n    return s.upper()\nbt_env.register_function(\\\"python_upper\\\", udf(PythonUpper(), DataTypes.STRING(), DataTypes.STRING()))<\/pre>\n<section><\/section>\n<p>\u521b\u5efa\u5b8cUDF\u4e4b\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728SQL\u91cc\u4f7f\u7528\u4e86\u3002<br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.580_17896.jpeg\\\" \/><br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.590_46914.jpeg\\\" \/><br \/>\n<strong>\u5bf9Hive\u6570\u636e\u7684\u6570\u636e\u5206\u6790<\/strong><br \/>\n\u9664\u4e86\u53ef\u4ee5\u5206\u6790Flink SQL\u521b\u5efa\u7684table\u4e4b\u5916\uff0cFlink\u4e5f\u53ef\u4ee5\u5206\u6790Hive\u4e0a\u5df2\u6709\u7684table\u3002\u5982\u679c\u8981\u8ba9Flink Interpreter\u4f7f\u7528Hive\uff0c\u90a3\u4e48\u9700\u8981\u505a\u4ee5\u4e0b\u914d\u7f6e<\/p>\n<ul class=\\\" list-paddingleft-2\\\">\n<li>\u8bbe\u7f6e\u00a0<code>zeppelin.flink.enableHive<\/code>\u00a0\u4e3a\u00a0<code>true<\/code><\/li>\n<li>Copy\u00a0\u4e0b\u9762\u8fd9\u4e9b\u00a0dependencies \u5230flink\u7684\u00a0lib \u76ee\u5f55\n<ul class=\\\" list-paddingleft-2\\\">\n<li>flink-connector-hive_{scala_version}-{flink.version}.jar<\/li>\n<li>flink-hadoop-compatibility_{scala_version}-{flink.version}.jar<\/li>\n<li>flink-shaded-hadoop-2-uber-{hadoop.version}-{flink-shaded.version}.jar<\/li>\n<li>hive-exec-2.x.jar (for Hive 1.x, you need to copy hive-exec-1.x.jar, hive-metastore-1.x.jar, libfb303-0.9.2.jar and libthrift-0.9.2.jar)<\/li>\n<\/ul>\n<\/li>\n<li>\u5728Flink interpreter setting \u91cc\u6216\u8005 zeppelin-env.sh\u91cc\u6307\u5b9a\u00a0<code>HIVE_CONF_DIR<\/code><code><\/code><\/li>\n<li>\u5728Flink interpreter setting \u6307\u5b9a\u00a0zeppelin.flink.hive.version \u4e3a\u4f60\u4f7f\u7528\u7684Hive\u7248\u672c<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u5c31\u7528\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u5c55\u793a\u5982\u4f55\u5728Zeppelin\u4e2d\u7528Flink\u67e5\u8be2Hive table<br \/>\n<strong>1. \u7528Zeppelin\u7684jdbc interpreter\u67e5\u8be2hive tables<\/strong><br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.585_32550.png\\\" \/><br \/>\n<strong>2.\u00a0\u7528Flink sql \u67e5\u8be2\u00a0hive table\u7684schema<\/strong><br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.914_94978.png\\\" \/><br \/>\n<strong>3. \u7528Flink Sql \u67e5\u8be2hive table<\/strong><br \/>\n<img class=\\\"rich_pages js_insertlocalimg\\\" src=\\\"https:\/\/notecdn.yiban.io\/cloud_res\/521685660\/imgs\/20-6-24_09:46:11.924_87869.png\\\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8bb2\u8ff0\u5982\u4f55\u4f7f\u7528Flink SQL + UDF\u6765\u505aBatch ETL\u548cBI\u6570\u636e\u5206\u6790\u7684\u4efb\u52a1\u3002 Flink Int &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=1734\"> <span class=\"screen-reader-text\">Flink on Zeppelin  &#8211; Batch<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[131,118],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"\u672c\u6587\u8bb2\u8ff0\u5982\u4f55\u4f7f\u7528Flink SQL + UDF\u6765\u505aBatch ETL\u548cBI\u6570\u636e\u5206\u6790\u7684\u4efb\u52a1\u3002 Flink Int&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/1734"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1734"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/1734\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1734"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}