
hive数仓
zhangshk_
一直在路上。。。
展开
-
hive 查询结果转为parquet格式 存入hdfs中
hive 查询结果转为parquet格式 存入hdfs中 , 步骤: 1.首先根据我们hive查询结果 ,新建一张表 , 2.然后,对表结构做修改 ,更改表指定存储格式为parquet , 3.然后删除之前创建的那装表, 然后新建这张指定存储格式的表, 4.之后把结果插入这个表中。 1、 create table table_parquet as select j30.原创 2018-01-10 18:53:59 · 16462 阅读 · 0 评论 -
hive添加分区报错 mismatched input 'add' expecting KW_EXCHANGE near 'table' in
It's not exactly a bug, just a side effect of Open Source when it's done by a motley crew of people all around the world with no "product owner" and no incentives to use a common programming style (or...原创 2018-08-06 11:47:28 · 11368 阅读 · 0 评论 -
经典sql题目(使用窗口函数解决)
很多同学可能对窗口函数,但是他确实已经出现在了sqlserver,oracle,mysql 等关系型数据库中 以及hive ,presto等数仓中。使用 窗口函数确实能够为我们解决很多sql难题。 下面我通过一些经典的sql面试题,讲解如何通过窗口函数,解决。 1.用SQL选出每个人成绩的最高的前两条纪录 原表记录: zs,math,75 zs,chinese,81 lisi,ch...原创 2018-09-18 15:01:24 · 8501 阅读 · 0 评论 -
hive修改表结构&表属性
0x01:重命名表 1 ALTER TABLE table_name RENAME TO new_table_name; 上面这个命令可以重命名表,数据所在的位置和分区都没有改变。 0x02:改变列名/类型/位置/注释 1 ALTER TABLE table_name CHANGE 2 [CLOUMN] col_old_name col_new_name colum...转载 2018-09-18 17:59:47 · 16980 阅读 · 1 评论