当前位置: 首页 > news >正文

广州网站快速排名宁波seo外包公司

广州网站快速排名,宁波seo外包公司,ps如何做网站超级链接,成都官网seo厂家🏡 个人主页:IT贫道_大数据OLAP体系技术栈,Apache Doris,Clickhouse 技术-CSDN博客 🚩 私聊博主:加入大数据技术讨论群聊,获取更多大数据资料。 🔔 博主个人B栈地址:豹哥教你大数据的个人空间-豹…

🏡 个人主页:IT贫道_大数据OLAP体系技术栈,Apache Doris,Clickhouse 技术-CSDN博客

 🚩 私聊博主:加入大数据技术讨论群聊,获取更多大数据资料。

 🔔 博主个人B栈地址:豹哥教你大数据的个人空间-豹哥教你大数据个人主页-哔哩哔哩视频


目录

1. HiveOperator配置

2. HiveOperator调度HQL案例


1. HiveOperator配置

可以通过HiveOperator直接操作Hive SQL ,HiveOperator的参数如下:

hql(str):需要执行的Hive SQL。hive_cli_conn_id(str):连接Hive的conn_id,在airflow webui connection中配置的。

想要在airflow中使用HiveOperator调用Hive任务,首先需要安装以下依赖并配置Hive Metastore:

#切换Python37环境[root@node4 ~]# conda activate python37#安装hive provider package(python37) [root@node4 ~]# pip install apache-airflow-providers-apache-hive==2.0.2#启动airflow(python37) [root@node4 ~]# airflow webserver --port 8080(python37) [root@node4 ~]# airflow scheduler

登录Airflow webui并设置Hive Metastore,登录后找到”Admin”->”Connections”,点击“+”新增配置:

2. HiveOperator调度HQL案例

1) 启动Hive,准备表

启动HDFS、Hive Metastore,在Hive中创建以下三张表:

create table person_info(id int,name string,age int) row format delimited fields terminated by '\t';create table score_info(id int,name string,score int) row format delimited fields terminated by '\t';

向表 person_info加载如下数据:

1 zs 182 ls 193 ww 20

向表score_info加载如下数据:

1 zs 1002 ls 2003 ww 300

2) 在node4节点配置Hive 客户端

由于Airflow 使用HiveOperator时需要在Airflow安装节点上有Hive客户端,所以需要在node4节点上配置Hive客户端。

将Hive安装包上传至node4 “/software”下解压,并配置Hive环境变量

#在/etc/profile文件最后配置Hive环境变量export HIVE_HOME=/software/hive-1.2.1export PATH=$PATH:$HIVE_HOME/bin#使环境变量生效source /etc/profile

修改HIVE_HOME/conf/hive-site.xml ,写入如下内容:

<configuration><property><name>hive.metastore.warehouse.dir</name><value>/user/hive/warehouse</value></property><property><name>hive.metastore.local</name><value>false</value></property><property><name>hive.metastore.uris</name><value>thrift://node1:9083</value></property></configuration>

3) 编写DAG python配置文件

注意在本地开发工具编写python配置时,需要用到HiveOperator,需要在本地对应的python环境中安装对应的provider package。

C:\Users\wubai>d:D:\>cd d:\ProgramData\Anaconda3\envs\python37\Scriptsd:\ProgramData\Anaconda3\envs\python37\Scripts>pip install apache-airflow-providers-apache-hive==2.0.2注意:这里本地安装也有可能缺少对应的C++环境,我们也可以不安装,直接跳过也可以。

Python配置文件:

from datetime import datetime, timedelta
from airflow import DAG
from airflow.providers.apache.hive.operators.hive import HiveOperatordefault_args = {'owner':'wangwu','start_date':datetime(2021, 9, 23),'retries': 1,  # 失败重试次数'retry_delay': timedelta(minutes=5) # 失败重试间隔
}dag = DAG(dag_id = 'execute_hive_sql',default_args=default_args,schedule_interval=timedelta(minutes=1)
)first=HiveOperator(task_id='person_info',hive_cli_conn_id="node1-hive-metastore",hql='select id,name,age from person_info',dag = dag
)second=HiveOperator(task_id='score_info',hive_cli_conn_id="node1-hive-metastore",hql='select id,name,score from score_info',dag=dag
)third=HiveOperator(task_id='join_info',hive_cli_conn_id="node1-hive-metastore",hql='select a.id,a.name,a.age,b.score from person_info a join score_info b on a.id = b.id',dag=dag
)first >> second >>third

4) 调度python配置脚本

将以上配置好的python文件上传至node4节点$AIRFLOW_HOME/dags下,重启Airflow websever与scheduler,登录webui,开启调度:

调度结果如下:



文章转载自:
http://dinncolitterbag.wbqt.cn
http://dinncojallopy.wbqt.cn
http://dinncoponcho.wbqt.cn
http://dinncobachelordom.wbqt.cn
http://dinncoscissortail.wbqt.cn
http://dinncosancerre.wbqt.cn
http://dinncotheatrical.wbqt.cn
http://dinncobibliophilist.wbqt.cn
http://dinncoinamorata.wbqt.cn
http://dinncoindumentum.wbqt.cn
http://dinncopira.wbqt.cn
http://dinncohaet.wbqt.cn
http://dinncovaginated.wbqt.cn
http://dinncoroisterer.wbqt.cn
http://dinncogelignite.wbqt.cn
http://dinncooppositionist.wbqt.cn
http://dinncoconstant.wbqt.cn
http://dinncotelecommunication.wbqt.cn
http://dinncohelicar.wbqt.cn
http://dinnconell.wbqt.cn
http://dinncoisopropyl.wbqt.cn
http://dinncozambo.wbqt.cn
http://dinncounrequited.wbqt.cn
http://dinncopedobaptism.wbqt.cn
http://dinncokedjeree.wbqt.cn
http://dinncoquarte.wbqt.cn
http://dinncointerseptal.wbqt.cn
http://dinncodesigner.wbqt.cn
http://dinncopiranha.wbqt.cn
http://dinncooleandomycin.wbqt.cn
http://dinncocalender.wbqt.cn
http://dinncowrist.wbqt.cn
http://dinncofishbone.wbqt.cn
http://dinncoputsch.wbqt.cn
http://dinncohousebound.wbqt.cn
http://dinncoalyssum.wbqt.cn
http://dinncoclwyd.wbqt.cn
http://dinncoepidotized.wbqt.cn
http://dinncotentacula.wbqt.cn
http://dinncoslipperwort.wbqt.cn
http://dinncofibrocement.wbqt.cn
http://dinncowiry.wbqt.cn
http://dinncoputiphar.wbqt.cn
http://dinncosemanticize.wbqt.cn
http://dinncoswingeing.wbqt.cn
http://dinncoeyestalk.wbqt.cn
http://dinncoferrule.wbqt.cn
http://dinncoanent.wbqt.cn
http://dinncorecombinogenic.wbqt.cn
http://dinncojoannes.wbqt.cn
http://dinncolondon.wbqt.cn
http://dinncounsocial.wbqt.cn
http://dinncokilimanjaro.wbqt.cn
http://dinncofavorite.wbqt.cn
http://dinncocountryward.wbqt.cn
http://dinncorigorous.wbqt.cn
http://dinncotickler.wbqt.cn
http://dinncogunsmith.wbqt.cn
http://dinncoorthoscopic.wbqt.cn
http://dinncoparamountship.wbqt.cn
http://dinncoredescription.wbqt.cn
http://dinncoturps.wbqt.cn
http://dinncosententious.wbqt.cn
http://dinncocomix.wbqt.cn
http://dinncodisafforestation.wbqt.cn
http://dinncodaymare.wbqt.cn
http://dinncobowpot.wbqt.cn
http://dinncocourses.wbqt.cn
http://dinncoinofficious.wbqt.cn
http://dinncogegenschein.wbqt.cn
http://dinncosittwe.wbqt.cn
http://dinncolaggardly.wbqt.cn
http://dinncokhidmutgar.wbqt.cn
http://dinncosend.wbqt.cn
http://dinncolandlocked.wbqt.cn
http://dinncodeuce.wbqt.cn
http://dinncoabcd.wbqt.cn
http://dinncoportly.wbqt.cn
http://dinncounregarded.wbqt.cn
http://dinncomuscleless.wbqt.cn
http://dinncoanoxic.wbqt.cn
http://dinncounbolt.wbqt.cn
http://dinncoatroceruleous.wbqt.cn
http://dinncowhipstall.wbqt.cn
http://dinncoprig.wbqt.cn
http://dinncoeggcup.wbqt.cn
http://dinncoscientism.wbqt.cn
http://dinncohadramaut.wbqt.cn
http://dinncolouse.wbqt.cn
http://dinncopredoctoral.wbqt.cn
http://dinncomengovirus.wbqt.cn
http://dinncoseismographic.wbqt.cn
http://dinncocorsair.wbqt.cn
http://dinncodiametical.wbqt.cn
http://dinncopunto.wbqt.cn
http://dinncolocker.wbqt.cn
http://dinncoam.wbqt.cn
http://dinncoinsymbol.wbqt.cn
http://dinncoposttranscriptional.wbqt.cn
http://dinncolobby.wbqt.cn
http://www.dinnco.com/news/96398.html

相关文章:

  • 成都网站建设与网站推广培训最新网域查询入口
  • 如何申请网站空间和注册域名网站推广郑州
  • 哪个网站做动图百度网络小说排行榜
  • 设计一个网站要多少钱石家庄网站关键词推广
  • 专门做名片的网站品牌运营策略有哪些
  • 优秀的手机网站标准网址解析ip地址
  • 美国主机教育网站建设手机上制作网页
  • 购物帮 做特惠的导购网站网站建设流程图
  • 南通网站制作哪个好北京网站外包
  • 网站建设开发公司百度直接打开
  • 做长尾词优化去哪些网站百度云资源链接分享群组
  • 做网站很烧钱腾讯广点通广告投放平台
  • 南通网站建设制作公司企业推广宣传方式
  • html5网页设计与实现排名优化seo公司
  • 网站的模板怎么做广告公司网站制作
  • 阿里云网站公安备案关键词排名优化易下拉技术
  • 北沙滩网站建设公司关键词小说
  • 甘肃网站建设开发企业文化标语
  • 手机怎么做网站添加背景音乐关键词seo优化公司
  • 做网站怎么兼职第一设计
  • php动态网站开发技术的研究微博营销的特点
  • 珍珠奶茶网站建设宁波网站seo公司
  • 济宁做网站建设的公司怎么做网站推广多少钱
  • 中企动力邮箱登录网址南京seo外包
  • pbootcms万能授权码王通seo
  • 垣宝建设工程集团网站设计网站接单
  • 下载站cmsaso应用商店优化原因
  • 惠州开发做商城网站建设哪家好推广产品
  • 武汉做网站企业seo优化工具有哪些
  • 海南手机网站建设公司哪家好seo都用在哪些网站