婴儿不睡觉是什么原因| 紫外线过敏用什么药膏| 采耳是什么意思| 眼科pd是什么意思| 水痘要注意什么| 胃不好可以吃什么水果| 黄桃什么时候上市| 什么牌空调好用又省电| jdk是什么| 生性多疑是什么意思| 切忌是什么意思| 七月十四日是什么节日| 咳嗽是什么原因引起的| 鼻子歪了是什么原因| 机械表是什么意思| 小孩肚子疼挂什么科| 咽喉炎是什么症状| hbcab偏高是什么意思| 前列腺吃什么食物调理| 豁出去了什么意思| 什么地哭| 云南的特产是什么| 娃娃脸是什么脸型| 血管变窄吃什么能改善| 甲状腺双叶结节什么意思| 董监高是什么意思| 临幕是什么意思| 磨砂皮是什么皮| 雌二醇高说明什么原因| 胃酸有什么办法缓解| 12月23是什么星座| 淋巴是什么引起的| 手足口病的症状是什么| 口吐白沫是什么生肖| 干燥综合症是什么病| 大驿土命是什么意思| 以梦为马什么意思| 金银满堂是什么生肖| 冬天穿什么| 仲夏夜是什么意思| 八月一日是什么日子| 颞下颌紊乱挂什么科| 尿结晶高是什么原因| 橘子什么季节成熟| 冷都男是什么意思| 出柜是什么意思| 黄绿色痰液是什么感染| 内分泌科看什么| 防疫站属于什么单位| 6月16日是什么星座| 病符是什么意思| 梦见捡板栗是什么意思| 三叉神经痛吃什么药| 治未病是什么意思| 怡字五行属什么的| 口中发甜是什么原因| 9月14日是什么星座| ca199检查是什么意思| 杨家将是什么生肖| 肚子胀气吃什么好| 鼻咽炎是什么症状| 办健康证要带什么证件| 宫颈囊肿是什么原因| 手术后吃什么伤口愈合快| 女性解脲支原体阳性是什么意思| 辅酶q10什么时候吃| 桐字属于五行属什么| 白羊和什么星座最配| 尿路感染什么症状| 吃桑葚有什么好处| experiment是什么意思| 鹞子是什么鸟| 夏天吃羊肉有什么好处| 唾液酸苷酶阳性是什么意思| 脚踝浮肿是什么原因| 总胆红素是什么| 菊花茶喝多了有什么坏处| kw是什么单位| 双龙是什么意思| 男生适合养什么小型犬| 拍黄瓜什么意思| 肠易激综合症用什么药能治好| 迪赛尼斯属于什么档次| 什么是贡菜| 排毒吃什么最好能排脸上毒| 血红蛋白是指什么| 清欢渡是什么意思| 尿常规隐血弱阳性什么意思| 孕酮是什么| 人体缺钾是什么症状| 宫颈多发纳囊是什么病| 预防水痘吃什么药| 正畸和矫正有什么区别| 妤是什么意思| 什么水果治便秘| 农历7月25日是什么星座| 内裤发黄是什么妇科病| eb病毒阳性是什么意思| 治疗腱鞘炎用什么药效果好| 御姐是什么意思| 胆结石什么原因引起的| 女生排卵期是什么意思| 10月6日什么星座| 什么树最值钱| 金钱草什么样| 县人民医院是什么级别| 唇钉是干什么用的| 什么车性价比最高| 震颤是什么意思| 咳嗽喉咙痛吃什么药| A型血为什么是完美血型| eus是什么检查| 吃什么能降血压最有效| 为什么一热脸就特别红| 肆意是什么意思| 心梗吃什么药好得快| 18K金什么意思| 什么叫血压| 隐晦是什么意思| 鹦鹉吃什么食物最好| 欧字五行属什么| sch是什么意思| 吃什么解酒| 痔核是什么| 医院信息科是做什么| 台湾什么时候收复| 小暑是什么意思啊| ella是什么意思| 梦见生孩子是什么意思解梦| 什么叫裸眼视力| 58岁属什么生肖| 下午三点到五点是什么时辰| 椴树是什么树| 足底麻木是什么原因| 三点水真读什么| 情绪上来像发疯一般是什么病| 活动无耐力与什么有关| 飞机什么时候开始登机| 一毛不拔指什么生肖| 太乙是什么意思| 薄荷叶有什么功效| 高考450分能上什么学校| 副团级是什么军衔| 觅食是什么意思| 穷思竭虑什么意思| 闺房之乐是什么意思| 坐班是什么意思| c1是什么| 咳嗽咳白痰是什么症状| 阳痿吃什么药效果好| vb是什么| 乳糖不耐受吃什么药| 有龙则灵的灵是什么意思| 红色的补色是什么颜色| 什么是白矮星| 抉择是什么意思| 欺世盗名是什么意思| 小孩子包皮挂什么科| 羡慕的意思是什么| 荔枝适合什么地方种植| 6.26什么星座| 膀胱在什么位置图片| 痛风是什么引起的| 什么书在书店里买不到| 半夜是什么时辰| 3月25是什么星座| 什么是宦官| 陪产假什么时候开始休| 男人阴囊潮湿吃什么药| 锁骨是什么骨| alpha是什么意思| 什么颜色的衣服显白| 货值是什么意思| 五月二十四号是什么星座| 肝火旺会出现什么症状| 2006属什么生肖| s1隐裂是什么意思| 北京中秋节有什么活动| 开车什么意思| 芒果什么季节成熟| 水色是什么颜色| 侧切是什么意思| 女中指戴戒指什么意思| 心肌缺血吃什么药最好| 猎德村为什么那么有钱| 6月19日是什么日子| 心悸是什么原因造成的| 普通的近义词是什么| 液氮是什么东西| 增加胃动力最好的药是什么药| 红隼吃什么| 卒中是什么意思| 急性上呼吸道感染是什么引起的| 小猫为什么一直叫| 月经和怀孕的症状有什么不同| 天使长什么样| 长期大便不成形是什么原因造成的| 叉烧是什么肉做的| 伪骨科是什么| 经常耳鸣是什么原因引起的| 32岁属什么| 女性尿频是什么原因| 木石念什么| 6月11日什么星座| 肛瘘是什么| 乌鱼是什么鱼| 绝眼是什么原因引起的| 胃烧心是怎么回事吃什么药| 虎是什么意思| 相公是什么意思| 胆囊炎不能吃什么食物| 天上九头鸟地上湖北佬是什么意思| 大象的鼻子为什么那么长| 润滑油是什么| 更年期什么年龄开始| 什么万千| 寒胃有什么症状| mua什么意思| 尔尔是什么意思| 儿童乘坐高铁需要什么证件| 不来月经有什么危害| 掰手指头响有什么危害| 鸡蛋炒什么好吃| 哺乳期感冒了能吃什么药| 阴部瘙痒用什么药| 杜松子是什么| ojbk什么意思| 阑尾炎是什么引起的| 丨什么意思| 雀的偏旁是什么| 为什么天气热皮肤就痒| hpa是什么意思| 州字五行属什么| 梦见老虎狮子是什么预兆| 减肥吃什么肉类| 人为什么打呼噜| 倭瓜是什么瓜| 爱被蚊子咬是什么体质| 2033年是什么年| 病毒感染会有什么症状| 艾叶泡脚有什么好处| 磁共振是做什么的| 肺火旺吃什么药最有效| 无可奈何是什么生肖| 每天头疼是什么原因引起的| 补体c3偏低是什么意思| pigeon是什么牌子| 五行缺金是什么命| 喝什么水对身体好| 什么水果不上火| 阴道炎有什么症状| 盐酸利多卡因注射作用是什么| 什么补钙| 石青色是什么颜色| 狗肉不能和什么食物一起吃| 精力是什么意思| 78什么意思| 八月出生的是什么星座| 老公工作劳累炖什么汤| 神经衰弱吃什么好| 欧代是什么| 紫癜是什么病严重吗| 梦见水里有蛇是什么意思| 为什么会结石| 百度
Skip to main content

银川召开市党政领导班子“两学一做”学习研讨会

百度   勇猛只是胡杨工作上的一面,事实上,他还是个多才多艺的文艺青年。

Hive Bitmap UDF provides UDFs for generating bitmap and bitmap operations in hive tables. The bitmap in Hive is exactly the same as the Doris bitmap. The bitmap in Hive can be imported into doris through (spark bitmap load).

the main purpose:

  1. Reduce the time of importing data into doris, and remove processes such as dictionary building and bitmap pre-aggregation;
  2. Save hive storage, use bitmap to compress data, reduce storage cost;
  3. Provide flexible bitmap operations in hive, such as: intersection, union, and difference operations, and the calculated bitmap can also be directly imported into doris; imported into doris;

How To Use?

Create Bitmap type table in Hive?

-- Example: Create Hive Bitmap Table
CREATE TABLE IF NOT EXISTS `hive_bitmap_table`(
`k1` int COMMENT '',
`k2` String COMMENT '',
`k3` String COMMENT '',
`uuid` binary COMMENT 'bitmap'
) comment 'comment'

-- Example:Create Hive Table
CREATE TABLE IF NOT EXISTS `hive_table`(
`k1` int COMMENT '',
`k2` String COMMENT '',
`k3` String COMMENT '',
`uuid` int COMMENT ''
) comment 'comment'

Hive Bitmap UDF Usage:?

Hive Bitmap UDF used in Hive/Spark,First, you need to compile fe to get hive-udf-jar-with-dependencies.jar. Compilation preparation:If you have compiled the ldb source code, you can directly compile fe,If you have compiled the ldb source code, you can compile it directly. If you have not compiled the ldb source code, you need to manually install thrift, Reference:Setting Up dev env for FE.

--clone doris code
git clone http://github.com/apache/doris.git
cd doris
git submodule update --init --recursive
--install thrift
--Enter the fe directory
cd fe
--Execute the maven packaging command(All sub modules of fe will be packaged)
mvn package -Dmaven.test.skip=true
--You can also just package the hive-udf module
mvn package -pl hive-udf -am -Dmaven.test.skip=true

After packaging and compiling, enter the hive-udf directory and there will be a target directory,There will be hive-udf.jar package

-- Load the Hive Bitmap Udf jar package (Upload the compiled hive-udf jar package to HDFS)
add jar hdfs://node:9001/hive-udf-jar-with-dependencies.jar;
-- Create Hive Bitmap UDAF function
create temporary function to_bitmap as 'org.apache.doris.udf.ToBitmapUDAF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
create temporary function bitmap_union as 'org.apache.doris.udf.BitmapUnionUDAF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
-- Create Hive Bitmap UDF function
create temporary function bitmap_count as 'org.apache.doris.udf.BitmapCountUDF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
create temporary function bitmap_and as 'org.apache.doris.udf.BitmapAndUDF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
create temporary function bitmap_or as 'org.apache.doris.udf.BitmapOrUDF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
create temporary function bitmap_xor as 'org.apache.doris.udf.BitmapXorUDF' USING JAR 'hdfs://node:9001/hive-udf-jar-with-dependencies.jar';
-- Example: Generate bitmap by to_bitmap function and write to Hive Bitmap table
insert into hive_bitmap_table
select
k1,
k2,
k3,
to_bitmap(uuid) as uuid
from
hive_table
group by
k1,
k2,
k3
-- Example: The bitmap_count function calculate the number of elements in the bitmap
select k1,k2,k3,bitmap_count(uuid) from hive_bitmap_table
-- Example: The bitmap_union function calculate the grouped bitmap union
select k1,bitmap_union(uuid) from hive_bitmap_table group by k1

Hive Bitmap UDF Description?

Hive Bitmap import into Doris?

When create a Hive table in the format specified as TEXT, for Binary type, Hive will be saved as a bash64 encoded string. Therefore, the binary data can be directly saved as Bitmap through bitmap_from_base64 function by using Doris's Hive Catalog.

Here is a full example:

  1. Creating Hive Tables in Hive
CREATE TABLE IF NOT EXISTS `test`.`hive_bitmap_table`(
`k1` int COMMENT '',
`k2` String COMMENT '',
`k3` String COMMENT '',
`uuid` binary COMMENT 'bitmap'
) stored as textfile
  1. Creating a Catalog in Doris
CREATE CATALOG hive PROPERTIES (
'type'='hms',
'hive.metastore.uris' = 'thrift://127.0.0.1:9083'
);
  1. Create Doris internal table
CREATE TABLE IF NOT EXISTS `test`.`doris_bitmap_table`(
`k1` int COMMENT '',
`k2` String COMMENT '',
`k3` String COMMENT '',
`uuid` BITMAP BITMAP_UNION COMMENT 'bitmap'
)
AGGREGATE KEY(k1, k2, k3)
DISTRIBUTED BY HASH(`user_id`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);
  1. Inserting data from Hive into Doris
insert into doris_bitmap_table select k1, k2, k3, bitmap_from_base64(uuid) from hive.test.hive_bitmap_table;

Method 2: Spark Load?

see details: Spark Load -> Basic operation -> Create load(Example 3: when the upstream data source is hive binary type table)

百度