
本文共 7614 字,大约阅读时间需要 25 分钟。
26.1 ������������������������������
26.1.1 ���������������������������������������
1���ODS������������������������
������������������������������������������������������������������������������������������
2���DWD������������������
���ODS���������������������������������������������������������������������������������
3���DWS������������������������
���DWD������������������������������������������������������������������������������������������
4���ADS������������������������
26.1.2 Tez���������������
Tez������������������������������������������������������������������������������HDFS���������������������������������������������������������������������
26.1.3 ������������������������������UDF���UDTF������������������������������������������������
��������������� ���UDF������������������������������UDTF���������������������������
26.1.4 ���������������������������
������������������������������������id ���������������
26.1.5 ���������������������������
������������������ left join ������������������������������������mid������������������������������
26.1.6 ������������������1������������
������������=��������������� join ������������ ���������������=������������/���������������
26.1.7 ���������������������������
������������id������������������������������������1������������������������������
26.1.8 ���������������������������������
������������left join������������ left join������������������������������id���������������id������null
26.1.9 ���������������������������
������������id���������������������������������������������������
26.1.10 ������������������������3���������������������
������������id������������������������������������������3������
26.1.11 ���������������������������������������������������������
1������������������7��������������������������������������������������������� 2��������������������������������������������������� 3��������������������������������������������������� 4������������������������������������3���������������������������������������������3��������������������������� 21.1.12 ������������������������������������������
26.2 Hive������
26.2.1 Hive���������
26.2.2 Hive������������������
Hive ���������������������������������������������������������������������
1���������������������
Hive ��������� HDFS ���������������������������������������������������������������������
2���������������
Hive������������������������������������������������������������������������������������������������
3���������������
Hive ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Hive������������������������������������������
4���������������
Hive���������������������������������������������������������������������������������
26.2.3 ���������������������
1���������������������������������������������������Hive��������������������������������������������������������������������������������� 2��������������������������������������������������������������������������������������� 21.2.4 4���By������ 1���Sort By��������������������� 2���Order By������������������������������Reducer��� 3���Distrbute By���������MR���Partition������������������������sort by��������� 4��� Cluster By������Distribute by���Sorts by������������������������������Cluster by���������Cluster by������������Distribute by���������������������Sort by���������������������������������������������������������������������������ASC������DESC���
26.2.5 ������������
1������������������ ���1��� OVER()���������������������������������������������������������������������������������������������������������������������partition by ������order by��������� ���2���CURRENT ROW������������ ���3���n PRECEDING���������n��������� ���4��� n FOLLOWING���������n��������� ���5���UNBOUNDED������������UNBOUNDED PRECEDING ��������������������������� UNBOUNDED FOLLOWING������������������������ ���6��� LAG(col,n)������������n��������� ���7���LEAD(col,n)������������n��������� ���8��� NTILE(n)������������������������������������������������������������������������������������������1���������������������������NTILE���������������������������������������������n���������int��������� 2������������������ ���1���RANK() ������������������������������������������ ���2���DENSE_RANK() ������������������������������������������ ���3���ROW_NUMBER() ���������������������
26.2.6 ������������������������������UDF���UDTF������������������������������������������������
1������������������ 2������UDF������������������������������UDTF��������������������������� 3������������UDF������������������������������UDF���������evaluate������ 4������������UDTF������������������������������GenericUDTF������������������������������������������process���������
26.2.7 Hive������
1���MapJoin ���������������MapJoin���������������MapJoin������������������Hive���������������Join���������������Common Join������������Reduce������������join���������������������������������������MapJoin���������������������������������map���������join���������reducer���������
2��������������� ���������������SELECT������������������������������������������������������������������������SELECT *��� ���������������������������������������������������������������������������������������������Where��������������������������������������������������������� 3���������������������
4��������������������� 5���������������Map��� ���1������������������������������������input���������������������������������map��������� ���������������������������input���������������������input��������������������������������������������������� ���2������������map������������������ ���������������������������������������������������������������������������������128m������������������������������������������������������������map���������������������������map������������������������������������������������������������������������������������������������������������������������������������map������������������ ���3������������������������map������������128m������������������������������������ ���������������������������������������127m������������������������������map������������������������������������������������������������������������������������������������map���������������������������������������map��������������������������������������� ���������������������2���3������������������������������������������������������map������������map������ 6������������������������ ���Map���������������������������������Map������CombineHiveInputFormat���������������������������������������������������������������������HiveInputFormat���������������������������������
7���������������Reduce��� Reduce��������������������������� ���1������������������������������Reduce������������������������������ ���2������������������������Reduce������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ ���������Reduce���������������������������������������������������������������������������������Reduce���������������Reduce���������������������������������������
8��������������� // ���������������������
SET hive.merge.mapfiles = true; -- ������true������map-only������������������������������ SET hive.merge.mapredfiles = true; -- ������false������map-reduce������������������������������ SET hive.merge.size.per.task = 268435456; -- ������256M SET hive.merge.smallfiles.avgsize = 16777216; -- ���������������������������������������������������������������������map-reduce������������������merge
发表评论
最新留言
关于作者
