datax抽取es数据到hive

更新时间:2023-05-11 20:50:59 阅读: 评论:0

datax抽取es数据到hive
收到⼀个需求:将es集群的数据抽取到⼤数据平台
在hive创建⼀个对应数据表
create table if not exists ods.pr_es_test_orc(
clueId STRING,
brandId STRING,
clueEstype STRING
)row format delimited FIELDS TERMINATED BY'|'
STORED AS orc;
有些主要需要配置的点:
“endpoint” :es的ip地址,
“accessId”:⽤户名,
“accessKey”: 密码,
“index”: 数据库前缀*,( 其中的*是全匹配 )
“scroll”: 每次读取数据缓存时间,
{
"job":{
"tting":{
"speed":{
"channel":7
}
},
"content":[{
"reader":{
"name":"elasticarchreader",
"parameter":{
"endpoint":"XXX.XXX.XXX.XXX:9200",
"accessId":"XXXXXXX*",
"accessKey":"XXXXXXXXXXX",
"index":"XXXXXX-*",
"type":"_doc",
"scroll":"3m",
"headers":{
},
"arch":[{
"query":{
"bool":{
"filter":[
{
"range":{
"createdTime":{
"boost":1,
"from":"${st}", ,
"include_lower":true,
"include_upper":true,
"to":"${et}"
}
}
}
]
}
},
"size":10
}],
"table":{
"column":[
{"name":"clueId"},
{"name":"brandId"},
{"name":"clueEstype"}
]
]
}
}
},
"writer":{
"name":"hdfswriter",
"parameter":{
"defaultFS":"hdfs://${hdfs}",
"fileType":"ORC",
"path":"/ur/hive/warehou/ods.db/pr_es_test_orc", "fileName":"aaaaaa",
"column":[
{"name":"clueId", "type":"STRING"},
{"name":"brandId", "type":"STRING"},
{"name":"clueEstype", "type":"STRING"}
],
"writeMode":"append",
"fieldDelimiter":"|",
"compress":"NONE"
}
}
}]
}
}

本文发布于:2023-05-11 20:50:59,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/590229.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图