1、应答阿里云数据事业部 高级专家非结构化数据在MaxCompute上的处理数据无边界:MaxCompute2.0DT时代:海量数据的加速产生MaxCompute2.0结构化数据 vs 非结构化数据每天产生的80%+数据是非结构化的-视频,音频,图像-文本文件:log,csv,html等-特殊二进制格式:e.g.,基因数据MaxCompute2.0打造大数据生态:计算与数据的互联互通理想:现状:MaxCompute2.0MaxCompute:阿里云核心分布式计算平台-阿里集团内部大规模数据处理需求锤炼出的大数据平台-10,000+台物理机/集群,多集群-服务集团内部淘宝,蚂蚁等BU的分布式处理:每
2、天百万级别作业数-基于阿里云飞天分布式系统,成熟的高可用分布数据处理平台,安全易用-MaxCompute SQL:通过简明语义,实现复杂数据处理逻辑-语言:SQL具有良好的可扩展性,表达性强-架构:MaxCompute 2.0提供了强大的灵活度-分布式作业中85%+为分布式SQL(v.s.9/15/2014;通过外部表(EXTERNAL TABLE),描述数据的存储位置(oss)和处理方式(csv)1,46.81006,-92.78787,9/14/2014,S 1,45.78782,-91.56735,9/14/2014,NE。8,46.97878,-87.03234,9/16/2014,N
3、E7,47.67866,-87.78989,9/17/2014,W直接对数据进行读取,抽取出的数据可直接参与SQL运算,无缝连接vehicleId|locationLongtitute_|_8|46.97878inputquery resultMaxCompute内置csv文件handler处理该oss位置上的所有csv文件指定csv读取的schema范例 1:处理存储OSS上的CSV文件MaxCompute2.0SELECT vehicleId,locationLongtitue FROM AmbulanceDataExternal WHERE direction=NE AND record
4、Time 9/15/2014;1|46.81006|-92.78787|9/14/2014|S 1|45.78782|-91.56735|9/14/2014|NE。8|46.97878|-87.03234|9/16/2014|NE7|47.67866|-87.78989|9/17/2014|WvehicleId|locationLongtitute_|_8|46.97878CREATE EXTERNAL TABLE IF NOT EXISTS AmbulanceDataExternal(vehicleId int,locationLatitute double,locationLongtitu
5、e double,recordTime string,direction string)STORED BY com.aliyun.odps.example.TextStorageHandler WITH SERDEPROPERTIES(delimiter=|)LOCATION oss:/oss-cn-hangzhou- odps-example.jar;通过Java SDK实现的特殊文本handlerJava代码包名用户传参接口inputquery result范例 2:处理存储OSS上的特殊格式文本MaxCompute2.0用户Java SDK接口:StorageHandler/*Base
6、StorageHandler class,user-defined StorageHandler shall extend from this class.*The class provides interfaces to reason about Extractor/Outputer implemented by user,*for converting raw byte stream into records and vice versa.*/public abstract class OdpsStorageHandler /*Getter for underlying extractor