随笔分类 -  Hive

1 2 下一页
hive的with as临时查询语句案例
摘要:-- create table xx [stored as parquet] as with tt1 as(..),tt2 as (..) 语法 drop table if exists tmp_aa.aa; create table if not exists tmp_aa.aa stored a 阅读全文
posted @ 2023-12-21 16:31 架构艺术
hive文件数超限制:[Fatal Error] total number of created files now is , which exceeds
摘要:[Fatal Error] total number of created files now is 100086, which exceeds 100000解决方法:hive> set hive.exec.max.created.files=655350; 阅读全文
posted @ 2023-11-02 11:48 架构艺术
hive传参
摘要:SET start_day=case when '${start_day}'='null' then '$[time(yyyy-MM-dd,-3d)]' else '${start_day}' end; --3天前的 SET end_day=case when '${end_day}'='null' 阅读全文
posted @ 2022-08-02 11:01 架构艺术 阅读(141) 评论(0) 推荐(0)
hive旧表新增字段
摘要:在一个几年的旧表,表最后面,新增字段 alter table dwd.dwd_xxx_dtl_di add columns( `line_type` string COMMENT 'xx类型' ) cascade; 插入语句,新增字段一定在select语句最后面。不然字段会错位 insert sel 阅读全文
posted @ 2022-06-09 14:00 架构艺术 阅读(142) 评论(1) 推荐(0)
正则
摘要:字段内容,以M或P开头 select dept_code RLIKE '^[MP].*' a, * from tmp_gdl.tmp10_bk where dept_code RLIKE '^[MP].*' limit 100 字段名,查找除了ds和hr之外的所有列。 set hive.suppor 阅读全文
posted @ 2022-06-09 13:56 架构艺术
hive get_json_object解析json数组
摘要:hive解析json,高级案例,非udf 阅读全文
posted @ 2022-05-07 12:59 架构艺术 阅读(305) 评论(0) 推荐(0)
cannot find class org.apache.hudi.hadoop.HoodieParquetInputFormat
摘要:Error: java.io.IOException: cannot find class org.apache.hudi.hadoop.HoodieParquetInputFormat at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.g 阅读全文
posted @ 2022-03-29 15:09 架构艺术 阅读(760) 评论(0) 推荐(0)
Hive表头导出成csv文件
摘要:Hive表导出成csv文件 hive -e " set hive.cli.print.header=true; #将表头输出 select * from data_table where some_query_conditions " | sed 's/[\t]/,/g' > hhd.csv set 阅读全文
posted @ 2021-11-09 10:32 架构艺术 阅读(789) 评论(0) 推荐(0)
presto正则表达式
摘要:正则表达式函数所有正则表达式函数都使用Java模式语法,但有一些值得注意的例外: 使用多行模式(通过(?m)标志启用)时,仅\n被识别为行终止符。此外,该(?d)标志不受支持,并且不得使用。不区分大小写的匹配(通过(?i)标志启用)始终以Unicode感知的方式执行。但是,不支持上下文相关和本地敏感 阅读全文
posted @ 2021-09-08 10:13 架构艺术 阅读(2231) 评论(0) 推荐(0)
Java 正则表达式(hive RGEXP)
摘要:一、概述:用来描述或者匹配一系列符合某个语句规则的字符串二、单个符号1、英文句点.符号:匹配单个任意字符。 表达式t.o 可以匹配:tno,t#o,teo等等。不可以匹配:tnno,to,Tno,t正o等。2、中括号[]:只有方括号里面指定的字符才参与匹配,也只能匹配单个字符。 表达式:t[abcd 阅读全文
posted @ 2021-09-07 11:43 架构艺术 阅读(224) 评论(0) 推荐(0)
presto函数大全 中文版
摘要:https://prestodb.github.io/docs/0.215/functions.html 官网: https://prestodb.io/docs/0.215/functions.html 6.1. 逻辑操作6.2. 比较函数和运算符6.3. 条件表达式6.4. Lambda 表达式 阅读全文
posted @ 2021-07-06 16:28 架构艺术 阅读(6441) 评论(0) 推荐(0)
Hive中rank()、row_number()函数的用法over(partition...)
摘要:1. 函数说明 rank() 排序相同时会重复,总数不会变 dense_rank() 排序相同时会重复,总数会减少 row_number() 会根据顺序计算 2. 操作案例 2.1 数据准备 孙悟空 语文 87 孙悟空 数学 95 孙悟空 英语 68 唐僧 语文 94 唐僧 数学 56 唐僧 英语 阅读全文
posted @ 2021-06-29 17:48 架构艺术 阅读(1240) 评论(0) 推荐(0)
hive语句的书写顺序和执行顺序
摘要:1、hive语句的书写顺序:(从前往后)(1)select(2)from(3)join on(4) where(5)group by(6)having(7)distribute by/cluster by(8) sort by(9) order by(10) limit(11) union(去重不排 阅读全文
posted @ 2021-05-25 13:57 架构艺术 阅读(838) 评论(0) 推荐(0)
Hive中求交集和差集的两种方法
摘要:Hive中求交集和差集的两种方法: --1.交集: select id from t1 intersect select id from t2 --2.差集 select a.id from t1 left join t2 on t2.id = t1.id and t2.id is null; se 阅读全文
posted @ 2021-02-23 11:29 架构艺术 阅读(8925) 评论(0) 推荐(0)
Hive中的Predicate Pushdown Rules(谓词下推规则)
摘要:引用:https://blog.csdn.net/strongyoung88/article/details/81156271 谓词下推概念 谓词下推 Predicate Pushdown(PPD):简而言之,就是在不影响结果的情况下,尽量将过滤条件提前执行。谓词下推后,过滤条件在map端执行,减少 阅读全文
posted @ 2021-01-05 16:36 架构艺术 阅读(636) 评论(0) 推荐(0)
hadoop Shuffle Error: Exceeded MAX_FAILED_UNIQUE_FETCHES; bailing-out
摘要:hadoop Shuffle Error: Exceeded MAX_FAILED_UNIQUE_FETCHES; bailing-out 程序里面需要打开多个文件,进行分析,系统一般默认数量是1024,(用ulimit -a可以看到)对于正常使用是够了,但是对于程序来讲,就太少了。修改办法:修改2 阅读全文
posted @ 2020-12-15 17:39 架构艺术 阅读(783) 评论(0) 推荐(0)
Hive-json表-处理JSON格式数据
摘要:add jar /home/jasonapp/json-serde-1.3.7-jar-with-dependencies.jar; create external table if not exists dm_goddog.student( student map<string,string> c 阅读全文
posted @ 2020-11-27 10:07 架构艺术 阅读(660) 评论(1) 推荐(0)
hive新增字段和修改字段的影响
摘要:DROP TABLE IF EXISTS tmp_dm_test_a.t_aa_orc; USE tmp_dm_test_a; CREATE EXTERNAL TABLE IF NOT EXISTS tmp_dm_test_a.t_aa_orc( user_id string COMMENT '用户 阅读全文
posted @ 2020-10-29 14:15 架构艺术 阅读(2322) 评论(0) 推荐(0)
hive多分隔符支持
摘要:1.问题描述 如何将多个字符作为字段分割符的数据文件加载到Hive表中,事例数据如下: 字段分隔符为“@#$” test1@#$test1name@#$test2value test2@#$test2name@#$test2value test3@#$test3name@#$test4value 如 阅读全文
posted @ 2020-09-29 21:32 架构艺术 阅读(521) 评论(0) 推荐(0)
Hive支持的文件格式与压缩算法
摘要:概述 只要是配置了正确的文件类型和压缩类型(比如Textfile+Gzip、SequenceFile+Snappy等),Hive都可以预期读取并解析数据,提供SQL功能。SequenceFile本身的结构已经设计了内容进行压缩。所以对于SequenceFile文件的压缩,并不是先生成Sequence 阅读全文
posted @ 2020-09-07 16:43 架构艺术 阅读(1556) 评论(0) 推荐(0)

1 2 下一页