元数据管理工具——Atlas

https://blog.csdn.net/u012543380/article/details/110070153

https://blog.csdn.net/oDaiLiDong/article/details/78052017

第1节 数据仓库元数据管理

元数据(MetaData)狭义的解释是用来描述数据的数据。广义的来看,除了业务逻辑直接读写处理的那些业务数据,所有其它用来维持整个系统运转所需的信息/数据都可以叫作元数据。如数据库中表的Schema信息,任务的血缘关系,用户和脚本/任务的权限映射关系信息等。

管理元数据的目的,是为了让用户能够更高效的使用数据,也是为了让平台管理人员能更加有效的做好数据的维护管理工作。

但通常这些元数据信息是散落在平台的各个系统,各种流程之中的,它们的管理也可能或多或少可以通过各种子系统自身的工具,方案或流程逻辑来实现。

元数据管理平台很重要的一个功能就是信息的收集,至于收集哪些信息,取决于业务的需求和需要解决的目标问题。

元数据管理平台还需要考虑如何以恰当的形式对这些元数据信息进行展示;进一步的,如何将这些元数据信息通过服务的形式提供给周边上下游系统使用,真正帮助大数据平台完成质量管理的闭环工作。

 

应该收集那些信息,没有绝对的标准,但是对大数据开发平台来说,常见的元数据信息包括:

  • 表结构信息
  • 数据的空间存储,读写记录,权限归属和其它各类统计信息
  • 数据的血缘关系信息
  • 数据的业务属性信息

数据血缘关系。血缘信息或者叫做Lineage的血统信息是什么,简单的说就是数据之间的上下游来源去向关系,数据从哪里来到哪里去。如果一个数据有问题,可以根据血缘关系往上游排查, 看看到底在哪个环节出了问题。此外也可以通过数据的血缘关系,建立起生产这些数据的任务之间的依赖关系,进而辅助调度系统的工作调度,或者用来判断一个失败或错误的任务可能对哪些下游数据造成影响等等。

分析数据的血缘关系看起来简单,但真的要做起来,并不容易,因为数据的来源多种多样,加工数据的手段,所使用的计算框架可能也各不相同,此外也不是所有的系统天生都具备获取相关信息的能力。而针对不同的系统,血缘关系具体能够分析到的粒度可能也不一样,有些能做到表级别,有些甚至可以做到字段级别。

以Hive表为例,通过分析Hive脚本的执行计划,是可以做到相对精确的定位出字段级别的数据血缘关系的。而如果是一个MapReduce任务生成的数据,从外部来看,可能就只能通过分析MR任务输出的Log日志信息来粗略判断目录级别的读写关系,从而间接推导数据的血缘依赖关系了。

数据的业务属性信息。业务属性信息都有哪些呢?如一张数据表的统计口径信息,这张表干什么用的,各个字段的具体统计方式,业务描述,业务标签,脚本逻辑的历史变迁记录,变迁原因等,此外还包括对应的数据表格是由谁负责开发的,具体数据的业务部门归属等。数据的业务属性信息,首先是为业务服务的,它的采集和展示也就需要尽可能的和业务环境相融合,只有这样才能真正发挥这部分元数据信息的作用。

很长一段时间内,市面都没有成熟的大数据元数据管理解决方案。直到2015年,Hortonworks 终于坐不住了,约了一众小伙伴公司倡议:咱们开始整个数据治理方案吧。然后,包含数据分类、集中策略引擎、数据血缘、安全和生命周期管理功能的Atlas应运而生。(类似的产品还有 Linkedin 在2016年新开源的项目 WhereHows )

第2节 Atlas简介

Atlas是Hadoop平台元数据框架;

Atlas是一组可扩展的核心基础治理服务,使企业能够有效,高效地满足Hadoop中的合规性要 求,并能与整个企业数据生态系统集成;

Apache Atlas为组织提供了开放的元数据管理和治理功能,以建立数据资产的目录,对这些资产进行分类和治理,并为IT团队、数据分析团队提供围绕这些数据资产的协作功能。

image.png

Atlas由元数据的收集,存储和查询展示三部分核心组件组成。此外,还会有一个管理后台对整体元数据的采集流程以及元数据格式定义和服务的部署等各项内容进行配置管理。

Atlas包括以下组件:

  • Core。Atlas功能核心组件,提供元数据的获取与导出(Ingets/Export)、类型系统(Type System)、元数据存储索引查询等核心功能
  • Integration。Atlas对外集成模块。外部组件的元数据通过该模块将元数据交给Atlas管理
  • Metadata source。Atlas支持的元数据数据源,以插件形式提供。当前支持从以下来源提 取和管理元数据:
    • Hive
    • HBase
    • Sqoop
    • Kafka
    • Storm
  • Applications。Atlas的上层应用,可以用来查询由Atlas管理的元数据类型和对象
  • Graph Engine(图计算引擎)。Altas使用图模型管理元数据对象。图数据库提供了极大的灵活性,并能有效处理元数据对象之间的关系。除了管理图对象之外,图计算引擎还为元数据对象创建适当的索引,以便进行高效的访问。在Atlas 1.0 之前采用Titan作为图存储引擎,从1.0开始采用JanusGraph作为图存储引擎。JanusGraph底层又分为两块:
  • Metadata Store。采用 HBase 存储 Atlas 管理的元数据;
  • Index Store。采用Solr存储元数据的索引,便于高效搜索;

第3节 安装配置

重点讲解Atlas,不对Atlas的依赖组件做讲解,组件均采用单机模式安装。

编译才能安装。

3.1 安装依赖

  • Maven 3.6.3(完成)
  • HBase 1.1.2(不需要安装,需要软件包)
  • Solr 5.5.1(不需要安装,需要软件包)
  • atlas 1.2.0(需要编译)

官方只提供了源码,没有提供二进制的安装版本,因此Atlas需要编译。

3.2 安装步骤

1、准备软件包

  • apache-atlas-1.2.0-sources.tar.gz
  • solr-5.5.1.tgz
  • hbase-1.1.2.tar.gz

2、解压缩源码,修改配置

 
  1. # 解压缩

  2. cd /opt/lagou/software

  3. tar zxvf apache-atlas-1.2.0-sources.tar.gz

  4. cd apache-atlas-sources-1.2.0/

  5.  
  6. # 修改配置

  7. vi pom.xml

  8.  
  9. # 修改

  10. 645 <npm-for-v2.version>3.10.8</npm-for-v2.version>

  11. 652 <hadoop.version>2.9.2</hadoop.version>

3、将HBase、Solr的包拷贝到对应的目录中

如果不拷贝这些包,就需要下载,下载 HBase 和 Solr 时速度很慢。这里提前下载完所需的这两个组件,拷贝到对应目录中。

 
  1. cd /opt/lagou/software/apache-atlas-sources-1.2.0

  2. # 创建目录

  3. cd distro/

  4. mkdir solr

  5. mkdir hbase

  6. # 拷贝软件包

  7. cp /opt/lagou/software/solr-5.5.1.tgz ./solr/

  8. cp /opt/lagou/software/hbase-1.1.2.tar.gz ./hbase/

4、maven设置阿里镜像

备注:重要,否则非常慢

 
  1. cd $MAVEN_HOME/conf

  2. # 在配置文件中添加

  3. vi settings.xml

  4.  
  5. # 加在 158 行后

  6. <mirror>

  7. <id>alimaven</id>

  8. <name>aliyun maven</name>

  9. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

  10. <mirrorOf>central</mirrorOf>

  11. </mirror>

5、Atlas编译

 
  1. cd /opt/lagou/software/apache-atlas-sources-1.2.0

  2. export MAVEN_OPTS="-Xms2g -Xmx2g"

  3. mvn clean -DskipTests package -Pdist,embedded-hbase-solr

编译过程中大概要下载600M左右的jar,持续的时间比较长。

image.png

编译完的软件位置:/opt/lagou/software/apache-atlas-sources-1.2.0/distro/target

编译完的软件:apache-atlas-1.2.0-bin.tar.gz

6、Atlas安装

 
  1. cd /opt/lagou/software/apache-atlas-sources-1.2.0/distro/target

  2.  
  3. # 解压缩

  4. tar zxvf apache-atlas-1.2.0-bin.tar.gz

  5. mv apache-atlas-1.2.0/ /opt/lagou/servers/atlas-1.2.0

  6.  
  7. # 修改 /etc/profile,设置环境变量 ATLAS_HOME

  8.  
  9. # 启动服务(第一次启动服务的时间比较长)

  10. cd $ATLAS_HOME/bin

  11. ./atlas_start.py

  12. # 检查后台进程 (1个atlas、2个HBase、1个solr后台进程)

  13. ps -ef | grep atlas

  14.  
  15. /opt/lagou/servers/atlas-1.2.0/server/webapp/atlas

  16. hbase-daemon.sh

  17. org.apache.hadoop.hbase.master.HMaster

  18. /opt/lagou/servers/atlas-1.2.0/solr/server

  19.  
  20. # 停止服务

  21. ./atlas_stop.py

检查 solr 的状态:

 
  1. cd /opt/lagou/servers/atlas-1.2.0/solr/bin

  2. ./solr status

  3. Solr process 25038 running on port 9838

  4. {

  5. "solr_home":"/opt/lagou/servers/atlas-1.2.0/solr/server/solr",

  6. "version":"5.5.1 c08f17bca0d9cbf516874d13d221ab100e5b7d58 - anshum -

  7. 2016-04-30 13:28:18",

  8. "startTime":"2020-07-31T11:58:45.638Z",

  9. "uptime":"0 days, 14 hours, 55 minutes, 11 seconds",

  10. "memory":"54.8 MB (%11.2) of 490.7 MB",

  11. "cloud":{

  12. "ZooKeeper":"localhost:2181",

  13. "liveNodes":"1",

  14. "collections":"3"}}

检查 zk 状态:

echo stat|nc localhost 2181

Web服务:http://linux122:21000/login.jsp

image.png

用户名 / 口令:admin / admin

账号的信息存储在文件 conf/users-credentials.properties 中。其中 Password 通过如下方式产生 sha256sum 摘要信息:

echo -n "admin" | sha256sum

image.png

第4节 Hive血缘关系导入

1、配置HIVE_HOME环境变量;将 $ATLAS_HOME/conf/atlas-application.properties 拷贝

到 $HIVE_HOME/conf 目录下

ln -s $ATLAS_HOME/conf/atlas-application.properties $HIVE_HOME/conf/atlas-application.properties

2、拷贝jar包

 
  1. # $ATLAS_HOME/server/webapp/atlas/WEB-INF/lib/ 目录下的3个jar,拷贝到 $ATLAS_HOME/hook/hive/atlas-hive-plugin-impl/ 目录下 jackson-jaxrs-base-2.9.9.jar

  2. jackson-jaxrs-json-provider-2.9.9.jar

  3. jackson-module-jaxb-annotations-2.9.9.jar

  4.  
  5. ln -s $ATLAS_HOME/server/webapp/atlas/WEB-INF/lib/jackson-jaxrs-base-2.9.9.jar $ATLAS_HOME/hook/hive/atlas-hive-plugin-impl/jackson-jaxrs-base-2.9.9.jar

  6. ln -s $ATLAS_HOME/server/webapp/atlas/WEB-INF/lib/jackson-jaxrs-json-provider-2.9.9.jar $ATLAS_HOME/hook/hive/atlas-hive-plugin-impl/jackson-jaxrs-json-provider-2.9.9.jar

  7. ln -s $ATLAS_HOME/server/webapp/atlas/WEB-INF/lib/jackson-module-jaxb-annotations-2.9.9.jar $ATLAS_HOME/hook/hive/atlas-hive-plugin-impl/jackson-module-jaxb-annotations-2.9.9.jar

3、修改Hive的配置

hive-site.xml增加 hook

 
  1. <property>

  2. <name>hive.exec.post.hooks</name>

  3. <value>org.apache.atlas.hive.hook.HiveHook</value>

  4. </property>

$HIVE_HOME/conf/hive-env.sh中添加HIVE_AUX_JARS_PATH变量

export HIVE_AUX_JARS_PATH=/opt/lagou/servers/atlas-1.2.0/hook/hive

4、批量导入hive数据

备注:Hive能正常启动;在执行的过程中需要用户名/口令:admin/admin

import-hive.sh

成功导出可以看见最后的提示信息:Hive Meta Data imported successfully!!!

在浏览器中可以看见:Search 中的选项有变化

image.png

Hive hook 可捕获以下操作:

  • create database
  • create table/view, create table as select
  • load, import, export
  • DMLs (insert)
  • alter database
  • alter table
  • alter view

第5节 与电商业务集成

开发(建库、建表) => 导入数据 => 执行Hive脚本

导入Hive的血缘关系

电商业务建表语句(可省略):

 
  1. -- 创建DataBases;

  2. CREATE DATABASE ODS;

  3. CREATE DATABASE DIM;

  4. CREATE DATABASE DWD;

  5. CREATE DATABASE DWS;

  6. CREATE DATABASE ADS;

  7.  
  8. -- 创建ODS表

  9. DROP TABLE IF EXISTS `ods.ods_trade_orders`;

  10. CREATE EXTERNAL TABLE `ods.ods_trade_orders`(

  11. `orderid` int,

  12. `orderno` string,

  13. `userid` bigint,

  14. `status` tinyint,

  15. `productmoney` decimal(10,0),

  16. `totalmoney` decimal(10,0),

  17. `paymethod` tinyint,

  18. `ispay` tinyint,

  19. `areaid` int,

  20. `tradesrc` tinyint,

  21. `tradetype` int,

  22. `isrefund` tinyint,

  23. `dataflag` tinyint,

  24. `createtime` string,

  25. `paytime` string,

  26. `modifiedtime` string)

  27. COMMENT '订单表'

  28. PARTITIONED BY (`dt` string)

  29. row format delimited fields terminated by ',' location '/user/data/trade.db/orders/';

  30.  
  31. DROP TABLE IF EXISTS `ods.ods_trade_order_product`;

  32. CREATE EXTERNAL TABLE `ods.ods_trade_order_product`(

  33. `id` string,

  34. `orderid` decimal(10,2),

  35. `productid` string,

  36. `productnum` string,

  37. `productprice` string,

  38. `money` string,

  39. `extra` string,

  40. `createtime` string)

  41. COMMENT '订单明细表'

  42. PARTITIONED BY (`dt` string)

  43. row format delimited fields terminated by ',' location '/user/data/trade.db/order_product/';

  44.  
  45. DROP TABLE IF EXISTS `ods.ods_trade_product_info`;

  46. CREATE EXTERNAL TABLE `ods.ods_trade_product_info`(

  47. `productid` bigint,

  48. `productname` string,

  49. `shopid` string,

  50. `price` decimal(10,0),

  51. `issale` tinyint,

  52. `status` tinyint,

  53. `categoryid` string,

  54. `createtime` string,

  55. `modifytime` string)

  56. COMMENT '产品信息表'

  57. PARTITIONED BY (`dt` string)

  58. row format delimited fields terminated by ',' location '/user/data/trade.db/product_info/';

  59.  
  60. DROP TABLE IF EXISTS `ods.ods_trade_product_category`;

  61. CREATE EXTERNAL TABLE `ods.ods_trade_product_category`(

  62. `catid` int,

  63. `parentid` int,

  64. `catname` string,

  65. `isshow` tinyint,

  66. `sortnum` int,

  67. `isdel` tinyint,

  68. `createtime` string,

  69. `level` tinyint)

  70. COMMENT '产品分类表'

  71. PARTITIONED BY (`dt` string)

  72. row format delimited fields terminated by ',' location '/user/data/trade.db/product_category';

  73.  
  74. DROP TABLE IF EXISTS `ods.ods_trade_shops`;

  75. CREATE EXTERNAL TABLE `ods.ods_trade_shops`(

  76. `shopid` int,

  77. `userid` int,

  78. `areaid` int,

  79. `shopname` string,

  80. `shoplevel` tinyint,

  81. `status` tinyint,

  82. `createtime` string,

  83. `modifytime` string)

  84. COMMENT '商家店铺表'

  85. PARTITIONED BY (`dt` string)

  86. row format delimited fields terminated by ',' location '/user/data/trade.db/shops';

  87.  
  88. DROP TABLE IF EXISTS `ods.ods_trade_shop_admin_org`;

  89. CREATE EXTERNAL TABLE `ods.ods_trade_shop_admin_org`(

  90. `id` int,

  91. `parentid` int,

  92. `orgname` string,

  93. `orglevel` tinyint,

  94. `isdelete` tinyint,

  95. `createtime` string,

  96. `updatetime` string,

  97. `isshow` tinyint,

  98. `orgType` tinyint)

  99. COMMENT '商家地域组织表'

  100. PARTITIONED BY (`dt` string)

  101. row format delimited fields terminated by ',' location '/user/data/trade.db/shop_org/';

  102.  
  103. DROP TABLE IF EXISTS `ods.ods_trade_payments`;

  104. CREATE EXTERNAL TABLE `ods.ods_trade_payments`(

  105. `id` string,

  106. `paymethod` string,

  107. `payname` string,

  108. `description` string,

  109. `payorder` int,

  110. `online` tinyint)

  111. COMMENT '支付方式表'

  112. PARTITIONED BY (`dt` string)

  113. row format delimited fields terminated by ',' location '/user/data/trade.db/payments/';

  114.  
  115. -- 创建DIM表

  116. DROP TABLE IF EXISTS dim.dim_trade_product_cat;

  117. create table if not exists dim.dim_trade_product_cat(

  118. firstId int,

  119. firstName string,

  120. secondId int,

  121. secondName string,

  122. thirdId int,

  123. thirdName string

  124. )

  125. partitioned by (dt string)

  126. STORED AS PARQUET;

  127.  
  128. drop table if exists dim.dim_trade_shops_org;

  129. create table dim.dim_trade_shops_org(

  130. shopid int,

  131. shopName string,

  132. cityId int,

  133. cityName string ,

  134. regionId int ,

  135. regionName string

  136. )

  137. partitioned by (dt string)

  138. STORED AS PARQUET;

  139.  
  140. drop table if exists dim.dim_trade_payment;

  141. create table if not exists dim.dim_trade_payment(

  142. paymentId string, -- 支付方式id

  143. paymentName string -- 支付方式名称 )

  144. partitioned by (dt string)

  145. STORED AS PARQUET;

  146.  
  147. drop table if exists dim.dim_trade_product_info;

  148. create table dim.dim_trade_product_info(

  149. `productId` bigint,

  150. `productName` string,

  151. `shopId` string,

  152. `price` decimal,

  153. `isSale` tinyint,

  154. `status` tinyint,

  155. `categoryId` string,

  156. `createTime` string,

  157. `modifyTime` string,

  158. `start_dt` string,

  159. `end_dt` string

  160. ) COMMENT '产品表' STORED AS PARQUET;

  161.  
  162. -- 创建DWD表

  163. -- 订单事实表(拉链表)

  164. DROP TABLE IF EXISTS dwd.dwd_trade_orders;

  165. create table dwd.dwd_trade_orders(

  166. `orderId` int,

  167. `orderNo` string,

  168. `userId` bigint,

  169. `status` tinyint,

  170. `productMoney` decimal,

  171. `totalMoney` decimal,

  172. `payMethod` tinyint,

  173. `isPay` tinyint,

  174. `areaId` int,

  175. `tradeSrc` tinyint,

  176. `tradeType` int,

  177. `isRefund` tinyint,

  178. `dataFlag` tinyint,

  179. `createTime` string,

  180. `payTime` string,

  181. `modifiedTime` string,

  182. `start_date` string,

  183. `end_date` string

  184. ) COMMENT '订单事实拉链表' partitioned by (dt string) STORED AS PARQUET;

  185.  
  186. -- 创建DWS表

  187. DROP TABLE IF EXISTS dws.dws_trade_orders;

  188. create table if not exists dws.dws_trade_orders(

  189. orderid string, -- 订单id

  190. cat_3rd_id string, -- 商品三级分类id

  191. shopid string, -- 店铺id

  192. paymethod tinyint, -- 支付方式

  193. productsnum bigint, -- 商品数量

  194. paymoney double, -- 订单商品明细金额

  195. paytime string -- 订单时间

  196. )

  197. partitioned by (dt string)

  198. STORED AS PARQUET;

  199.  
  200. -- 订单明细表宽表

  201. DROP TABLE IF EXISTS dws.dws_trade_orders_w;

  202. create table if not exists dws.dws_trade_orders_w(

  203. orderid string, --订单id

  204. cat_3rd_id string,-- 商品三级分类id

  205. thirdname string, -- 商品三级分类名称

  206. secondname string, -- 商品二级分类名称

  207. firstname string, -- 商品一级分类名称

  208. shopid string, --店铺id

  209. shopname string,--店铺名

  210. regionname string,-- 店铺所在大区

  211. cityname string,-- 店铺所在城市

  212. paymethod tinyint, --支付方式

  213. productsnum bigint, --商品数量

  214. paymoney double,-- 订单明细金额

  215. paytime string --订单时间

  216. )

  217. partitioned by (dt string)

  218. STORED AS PARQUET;

  219.  
  220. -- 创建ADS表

  221. -- ADS层订单分析表

  222. DROP TABLE IF EXISTS ads.ads_trade_order_analysis;

  223. create table if not exists ads.ads_trade_order_analysis(

  224. areatype string,-- 区域范围:区域类型(全国、大区、城市)

  225. regionname string, -- 区域名称

  226. cityname string,-- 城市名称

  227. categorytype string,-- 商品分类类型(一级、二级)

  228. category1 string,-- 商品一级分类名称

  229. category2 string, -- 商品二级分类名称

  230. totalcount bigint, -- 订单数量

  231. total_productnum bigint,-- 商品数量

  232. totalmoney double-- 支付金额

  233. )

  234. partitioned by (dt string)

  235. row format delimited fields terminated by ',';

使用Sqoop加载数据(可省略):

 
  1. sqoop import \

  2. --connect jdbc:mysql://linux123:3306/ebiz \

  3. --username hive \

  4. --password 12345678 \

  5. --target-dir /user/data/trade.db/orders/dt=2020-07-21/ \

  6. --table lagou_trade_orders \

  7. --delete-target-dir \

  8. --num-mappers 1 \

  9. --fields-terminated-by ','

  10.  
  11. sqoop import \

  12. --connect jdbc:mysql://linux123:3306/ebiz \

  13. --username hive \

  14. --password 12345678 \

  15. --target-dir /user/data/trade.db/payments/dt=2020-07-21/ \

  16. --table lagou_payments \

  17. --delete-target-dir \

  18. --num-mappers 1 \

  19. --fields-terminated-by ','

  20.  
  21. sqoop import \

  22. --connect jdbc:mysql://linux123:3306/ebiz \

  23. --username hive \

  24. --password 12345678 \

  25. --target-dir /user/data/trade.db/product_category/dt=2020-07-21/ \

  26. --table lagou_product_category \

  27. --delete-target-dir \

  28. --num-mappers 1 \

  29. --fields-terminated-by ','

  30.  
  31. sqoop import \

  32. --connect jdbc:mysql://linux123:3306/ebiz \

  33. --username hive \

  34. --password 12345678 \

  35. --target-dir /user/data/trade.db/product_info/dt=2020-07-21/ \

  36. --table lagou_product_info \

  37. --delete-target-dir \

  38. --num-mappers 1 \

  39. --fields-terminated-by ','

  40.  
  41. sqoop import \

  42. --connect jdbc:mysql://linux123:3306/ebiz \

  43. --username hive \

  44. --password 12345678 \

  45. --target-dir /user/data/trade.db/order_product/dt=2020-07-21/ \

  46. --table lagou_order_product \

  47. --delete-target-dir \

  48. --num-mappers 1 \

  49. --fields-terminated-by ','

  50.  
  51. sqoop import \

  52. --connect jdbc:mysql://linux123:3306/ebiz \

  53. --username hive \

  54. --password 12345678 \

  55. --target-dir /user/data/trade.db/shop_org/dt=2020-07-21/ \

  56. --table lagou_shop_admin_org \

  57. --delete-target-dir \

  58. --num-mappers 1 \

  59. --fields-terminated-by ','

  60.  
  61. sqoop import \

  62. --connect jdbc:mysql://linux123:3306/ebiz \

  63. --username hive \

  64. --password 12345678 \

  65. --target-dir /user/data/trade.db/shops/dt=2020-07-21/ \

  66. --table lagou_shops \

  67. --delete-target-dir \

  68. --num-mappers 1 \

  69. --fields-terminated-by ','

  70.  
  71. alter table ods.ods_trade_orders add partition(dt='2020-07-21');

  72. alter table ods.ods_trade_payments add partition(dt='2020-07-21');

  73. alter table ods.ods_trade_product_category add partition(dt='2020-07-21');

  74. alter table ods.ods_trade_product_info add partition(dt='2020-07-21');

  75. alter table ods.ods_trade_order_product add partition(dt='2020-07-21');

  76. alter table ods.ods_trade_shop_admin_org add partition(dt='2020-07-21');

  77. alter table ods.ods_trade_shops add partition(dt='2020-07-21');

电商业务脚本(省略了ODS层数据加载):

 
  1. # 加载DIM层数据

  2. sh /data/lagoudw/script/trade/dim_load_product_cat.sh 2020-07-21

  3. sh /data/lagoudw/script/trade/dim_load_shop_org.sh 2020-07-21

  4. sh /data/lagoudw/script/trade/dim_load_payment.sh 2020-07-21

  5. sh /data/lagoudw/script/trade/dim_load_product_info.sh 2020-07-21

  6. # 加载DWD层数据

  7. sh /data/lagoudw/script/trade/dwd_load_trade_orders.sh 2020-07-21

  8. # 加载DWS层数据

  9. sh /data/lagoudw/script/trade/dws_load_trade_orders.sh 2020-07-21

  10. # 加载ADS层数据

  11. sh /data/lagoudw/script/trade/ads_load_trade_order_analysis.sh 2020-07-21

创建 Classfication:order_analysis

创建Glossary:ODS层 => 电商业务

查看血缘关系 ads_trade_order_analysis:

image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值