当前位置:主页 > 查看内容

[JDBC] Kettle on MaxCompute 使用指南

发布时间:2021-04-29 00:00| 位朋友查看

简介:Kettle版本 8.2.0.0-342 MaxCompute JDBC driver版本 3.2.8 Setup下载并安装Kettle下载MaxCompute JDBC driver将MaxCompute JDBC driver置于Kettle安装目录下的lib子目录 data-integration/lib 下载并编译MaxCompute Kettle plugin https://github.com/aliyu……

Kettle版本 8.2.0.0-342

MaxCompute JDBC driver版本 3.2.8


Setup下载并安装Kettle下载MaxCompute JDBC driver将MaxCompute JDBC driver置于Kettle安装目录下的lib子目录 data-integration/lib 下载并编译MaxCompute Kettle plugin https://github.com/aliyun/aliyun-maxcompute-data-collectors将编译后的MaxCompute Kettle plugin置于Kettle安装目录下的lib子目录 data-integration/lib 启动spoon


Job

我们可以通过Kettle MaxCompute JDBC driver来实现对MaxCompute中任务的组织和执行。


首先需要执行以下操作

新建Job新建Database Connection
JDBC连接串格式为 jdbc:odps: maxcompute_endpoint ?project maxcompute_project_name
JDBC driver class为 com.aliyun.odps.jdbc.OdpsDriver
Username为阿里云AccessKey Id
Password为阿里云AccessKey Secret
JDBC更多配置见 https://help.aliyun.com/document_detail/161246.html


image


之后 可以根据业务需要 通过SQL节点访问MaxCompute。下面我们以一个简单的ETL过程为例


image


Create table节点的配置如下


image


需要注意

这里Connection需要选择我们配置好的不要勾选Send SQL as single statement


Load from OSS节点配置如下

image


需要注意的点同Create table节点。有关更多Load的用法 见 https://help.aliyun.com/document_detail/157418.html


Processing节点配置如下

image

需要注意的点同Create table节点。


Transformation

我们可以通过MaxCompute Kettle plugin实现数据流出或流入MaxCompute。


首先新建Transformation 之后新建Aliyun MaxCompute Input节点 配置如下

image.png


在MaxCompute中新建一张空表 schema与test_partition_table一致。


新建Aliyun MaxCompute Output节点 配置如下

image.png


执行Transformation 数据便从test_partition_table被下载 后被上传至test_partition_table_2。


其他设置MaxCompute flags

如图 在执行DDL/DML/SQL之前 可以通过set key value;的方式配置flags。

image.png

Script模式

暂时无法支持


本文转自网络,原文链接:https://developer.aliyun.com/article/783874
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!

推荐图文

  • 周排行
  • 月排行
  • 总排行

随机推荐