天天看点

MaxCompute常见问题总结以及排查方案

存储计费:按照存储在 MaxCompute 的数据的容量大小进行阶梯计费。

计算计费:MaxCompute 分按量后付费和按 CU 预付费两种计算计费方式。

按量后付费:按量后付费方式针对 SQL 任务和 MapReduce 任务进行计费。

SQL 任务按量后付费:即 SQL 任务按 I/O 后付费。

MapReduce 按量后付费:即 MapReduce 任务按量进行计费。

按 CU 预付费:此方式仅在阿里云大数据平台提供。

下载计费: MaxCompute 将按照下载的数据大小进行计费

注意是对公网下载收费,内网下载不收费

1,无事务控制

2,暂时不支持update/delete

3,不支持修改字段类型,不支持删除字段

4,不支持 select from 多表

5,其他hive对标函数,官方文档没有的暂时不支持

更多参考

<a href="https://help.aliyun.com/document_detail/50985.html?spm=5176.doc27862.6.757.lSC74f">https://help.aliyun.com/document_detail/50985.html?spm=5176.doc27862.6.757.lSC74f</a>

select 最大显示10000行

想导出大于10000行参考

<a href="https://help.aliyun.com/document_detail/53093.html?spm=5176.7751065.6.751.iLm6hF">https://help.aliyun.com/document_detail/53093.html?spm=5176.7751065.6.751.iLm6hF</a>

2,string字段最大8M

更多其他限制参考

<a href="https://help.aliyun.com/document_detail/51823.html?spm=5176.doc53093.6.618.R37r8p">https://help.aliyun.com/document_detail/51823.html?spm=5176.doc53093.6.618.R37r8p</a>

用户经常问:

本地测试正常,在提交到odps后失败,代码一毛一样

<a href="https://help.aliyun.com/document_detail/27967.html?spm=5176.doc51823.6.647.Rt0efa">https://help.aliyun.com/document_detail/27967.html?spm=5176.doc51823.6.647.Rt0efa</a>

原因:

我们处于安全考虑,对一些第三方jar包做了限制

一般是fastjson这个包比较常见,回复口径:

由于java沙箱限制,对一些第三方jar包由限制,fastjson的jar包被限制因为安全沙箱的原因无法使用。

<a href="https://help.aliyun.com/document_detail/27967.html">https://help.aliyun.com/document_detail/27967.html</a>

建议用gson

import com.google.gson.Gson;这个包试下

其他的jar的限制用户遇到类似报错可以提交工单咨询

下图是常见报错例子

MaxCompute常见问题总结以及排查方案

若想使用新数据类型,需在 SQL 语句前加语句:set odps.sql.type.system.odps2=true;

目前情况是需要加这个set,后续会省掉

<a href="https://help.aliyun.com/document_detail/27821.html?spm=5176.doc27967.6.546.XhnAGU">https://help.aliyun.com/document_detail/27821.html?spm=5176.doc27967.6.546.XhnAGU</a>

新数据类型,以及新函数、函数返回值是新数据类型都需要set

如果没有set,报错现象

com.aliyun.odps.OdpsException: ODPS-0130071:[1,8] Semantic analysis exception - function or view udtf_recom cannot be resolved

找不到函数或者方法

1,检查是否按照文档授权

<a href="https://help.aliyun.com/document_detail/45389.html?spm=5176.doc27821.6.691.5g0yGt">https://help.aliyun.com/document_detail/45389.html?spm=5176.doc27821.6.691.5g0yGt</a>

2,报错类似

DDL syntax error:ODPS-0130071:Semantic analysis exception - unrecognized option 'EXTERNAL'.

检查:是否引用了新类型,也需要set

3,如果建表后查询失败

检查用户oss或者ots数据量是否巨大,

oss的object数量是否很多

单个object是否很大

报错例子 没有授权

MaxCompute常见问题总结以及排查方案

连接客户端/访问域名先看下域名

<a href="https://help.aliyun.com/document_detail/34951.html?spm=5176.doc48950.6.572.58H50H">https://help.aliyun.com/document_detail/34951.html?spm=5176.doc48950.6.572.58H50H</a>

项目名称

Ak信息

如果报错找不到java类什么的

一般是客户端java环境(暂时不支持java9),建议java 7和8

1,如果是按量付费,请提交工单,如果是预付费,可以先看下cu对应的项目是否有大量作业或者比较大的作业,长期没有执行完。

可以使用主账户执行命令: TOP INSTANCE;这种方式查看当前正在运行的任务(在客户端(版本为0.29.0或以上)运行。)

您也可以通过这个工具查看项目下运行任务的状态

<a href="https://yq.aliyun.com/articles/247739?spm=5176.8091938.0.0.7Sf007">https://yq.aliyun.com/articles/247739?spm=5176.8091938.0.0.7Sf007</a>

如果是预付费cu用户可以使用这个工具查看cu使用情况

<a href="https://help.aliyun.com/document_detail/66565.html?spm=a2c4g.11186623.6.713.QARDJv">https://help.aliyun.com/document_detail/66565.html?spm=a2c4g.11186623.6.713.QARDJv</a>

2,数据倾斜

<a href="https://help.aliyun.com/document_detail/51020.html?spm=5176.doc34951.6.754.iMKNUT">https://help.aliyun.com/document_detail/51020.html?spm=5176.doc34951.6.754.iMKNUT</a>