千家信息网

hive中如何实现多表关联

发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,这篇文章将为大家详细讲解有关hive中如何实现多表关联,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。use noc_dpi;CREATE table IF NOT
千家信息网最后更新 2025年12月03日hive中如何实现多表关联

这篇文章将为大家详细讲解有关hive中如何实现多表关联,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

use noc_dpi;CREATE table IF NOT EXISTS tmp_yym_app(appname STRING, mdn_num int, inputoctets int,outputoctet int)row format delimited fields terminated by '|' stored as textfile location '/user/noc/private/tmp_yym_app'; insert overwrite table tmp_yym_appselect tt.appname,count(distinct mdn),sum(tt.inputoctets),sum(tt.outputoctets) from (select t.*  from NOC_3G_APP_USER_SUMMARY  t join liming_test_mdn m on  t.mdn=m.mdn and m.mdn<>'' and m.mdn is not null where t.dt=$appdate1union all   select t.*  from NOC_4G_APP_USER_SUMMARY  t join liming_test_mdn m on  t.mdn=m.mdn and m.mdn<>'' and m.mdn is not null where t.dt=$appdate1) tt group by tt.appname

关于"hive中如何实现多表关联"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

0