Dataphin中将MaxCompute数据同步到MySQL数据库,运行报错“ErrorCode=MethodNotAllowed, ErrorMessage=schema evolution table operations through tunnel is disabled”
问题描述
Dataphin中将MaxCompute数据同步到MySQL数据库,运行报错“ErrorCode=MethodNotAllowed, ErrorMessage=schema evolution table operations through tunnel is disabled”。完整异常如下:
2022-06-02 14:38:30.029 [job-0] ERROR RetryUtil - Exception when calling callable, 异常Msg:RequestId=2022060214382923dcdb0b04806b86, ErrorCode=MethodNotAllowed, ErrorMessage=schema evolution table operations through tunnel is disabled.
com.aliyun.odps.tunnel.TunnelException: RequestId=2022060214382923dcdb0b04806b86, ErrorCode=MethodNotAllowed, ErrorMessage=schema evolution table operations through tunnel is disabled.
at com.aliyun.odps.tunnel.TableTunnel$DownloadSession.initiate(TableTunnel.java:1337) ~[odps-sdk-core-0.26.6-public.jar:0.26.6-public]
at com.aliyun.odps.tunnel.TableTunnel$DownloadSession.<init>(TableTunnel.java:1216) ~[odps-sdk-core-0.26.6-public.jar:0.26.6-public]
at com.aliyun.odps.tunnel.TableTunnel.createDownloadSession(TableTunnel.java:371) ~[odps-sdk-core-0.26.6-public.jar:0.26.6-public]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsUtil$4.call(OdpsUtil.java:331) ~[odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsUtil$4.call(OdpsUtil.java:328) ~[odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.common.util.RetryUtil$Retry.call(RetryUtil.java:164) ~[datax-common-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.common.util.RetryUtil$Retry.doRetry(RetryUtil.java:111) ~[datax-common-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.common.util.RetryUtil.executeWithRetry(RetryUtil.java:30) [datax-common-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsUtil.createMasterSessionForPartitionedTable(OdpsUtil.java:328) [odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsSplitUtil.splitOnePartition(OdpsSplitUtil.java:125) [odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsSplitUtil.splitPartitionedTable(OdpsSplitUtil.java:70) [odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.util.OdpsSplitUtil.doSplit(OdpsSplitUtil.java:26) [odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.plugin.reader.odpsreader.OdpsReader$Job.split(OdpsReader.java:275) [odpsreader-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.job.JobContainer.doReaderSplit(JobContainer.java:758) [datax-core-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.job.JobContainer.split(JobContainer.java:397) [datax-core-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.job.JobContainer.start(JobContainer.java:118) [datax-core-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.Engine.start(Engine.java:104) [datax-core-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.Engine.entry(Engine.java:204) [datax-core-0.0.1-SNAPSHOT.jar:na]
at com.alibaba.datax.core.Engine.main(Engine.java:296) [datax-core-0.0.1-SNAPSHOT.jar:na]
问题原因
客户修改过输入组件MaxCompute数据源的表结构导致,之前删除过表字段导致。需要说明的是,只要表结构做过修改,后续创建DataX同步任务通过Tunnel下载数据都有问题。
解决方案
表做过schema evolution。通过tunnel下载数据就会报错:ErrorCode=MethodNotAllowed, ErrorMessage=schema evolution table operations through tunnel is disabled。使用该功能表通过tunnel上传/下载有可能产生稳定性风险以及数据正确性风险,该功能在tunnel侧默认关闭。
两种修复方式:
● 表drop后重建
ⅰ. 将表里的数据做一下备份(create table xxx_tmp select * from xxx;)
ⅱ. 将表的授权信息作一下备份(show acl for xxx;备份授权信息)
ⅲ. 把表drop后按最新版本的schema重新创建(show create xxx;drop table xxx;create table xxx;)
ⅳ. 将备份的数据导回新表(insert overwrite xxx select * from xxx_tmp;)
ⅴ. 将新表重新授权给原用户(grant xxx on table xxx to user/ROLE xxx;)
ⅵ. 将数据重新回流一次
● project owner钉钉联系MaxCompute阿里云技术支持申请打开tunnel侧开关。
适用于
- Dataphin