Hive
wql_zero
如有版权问题,或者文章中有疑问联系QQ:1078956079
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HIVE(hive-site.xml)配置
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.76.100:3306/hive?createDatabaseIfNotExist=true</value> <descri...原创 2018-07-14 00:03:49 · 13958 阅读 · 0 评论 -
hive创建分区导入数据
create table t_sz01(id int,name string) row format delimited fields terminated by ','; create table if not exists mytable(sid int,sname string) row format delimited fields terminated by ',' stored a...原创 2018-07-15 09:52:36 · 1656 阅读 · 0 评论 -
Hive基本操作
创建表: create table person(id bigint,name string,age bigint) row format delimited fields terminated by ","; 导入数据: load data local inpath '/home/wql/app/hData/person.txt' into table person; load data i...原创 2019-03-11 15:56:40 · 141 阅读 · 0 评论 -
Hive内部表&外部表
内部表&外部表 未被external修饰的是内部表(managed table),被external修饰的为外部表(external table); 区别: 内部表数据由Hive自身管理,外部表数据由HDFS管理; 内部表数据存储的位置是hive.metastore.warehouse.dir(默认:/user/hive/warehouse),外部表数据的存储位置由自己制定; 删除内部...原创 2019-03-11 15:58:27 · 188 阅读 · 0 评论 -
Hive分区表
分区表: 分区表实际上就是对应一个HDFS文件系统上独立的文件夹,该文件夹下是该分区所有的数据文件,Hive中的分区就是分目录,把一个大的数据集根据业务需要分割成更小的数据集; 在查询时通过where子句中的表达式来选择查询所需要的指定的分区,这样的查询效率会提高很多; CREATE EXTERNAL TABLE IF NOT EXISTS default.emp_partition( e...原创 2019-03-11 15:59:37 · 180 阅读 · 0 评论 -
Hive数据导出导入操作
1:导入数据进入到Hive表: LOAD DATA [LOCAL] INPATH 'filepath' [OVERWRITE] INTO TABLE tablename [PARTITION (partcol1=val1, partcol2=val2 ...)] 实例: 1)加载本地数据到Hive表: load data local inpath '/home/wql/app/hData/em...原创 2019-03-11 16:02:12 · 334 阅读 · 0 评论 -
Hive查询实例
数据查询: SELECT [ALL | DISTINCT] select_expr, select_expr, ... FROM table_reference [WHERE where_condition] [GROUP BY col_list] [ORDER BY col_list] [CLUSTER BY col_list | [DISTRIBUTE BY co...原创 2019-03-11 16:03:17 · 558 阅读 · 0 评论 -
Hive客户端连接
Hive连接方式: cd /home/wql/app/apache-hive-1.2.2-bin/bin; nohup hiveserver2 1>/home/wql/app/logs/hiveserver.log 2>/home/wql/app/logs/hiveserver.err & wql@wql-pc:~/app/apache-hive-1.2.2-bin/bin$...原创 2019-03-13 06:58:44 · 934 阅读 · 0 评论 -
Hive之JDBC连接数据库
package com.itheima.hadoop.hive; import java.sql.SQLException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.DriverManager; public class HiveJdbc...原创 2019-03-13 06:59:49 · 958 阅读 · 0 评论
分享