Hive--可执行SQL的Hadoop数据仓库管理工具

HiveHDFSHive

1. 使SQLSQLMapReduce

2. HDFSHive

3. HiveJDBC

 

 

HBaseHDFSHiveHBaseHadoop(bi)HiveMapReduce(使SQLMR)HBaseHDFS

  Hive HBase
使SQLMapReduce HDFS便使
1. HiveMySQLHDFS
2. Hive
1. HBase
2. HBase
访 HiveMapReduceMapReduce HBase使访
使 1. Hive使HadoopHadoop
2. Hiverow-levelappend-only
3. HiveSQL
4. HiveOLAPhdfsOLAPSQLHiveCUDHiveHDFS
1. HBase
2. HBaserow-level
3. HBasejoin
4. HBasekey-valuekey-valueCMSHBaseOLTP

HbaseHive使Hbase使Hive

 

Hive

1. Hive0.11HiveServer2HiveServer(ThriftServer)HiveServer2Hive

2. HiveServer2BeelineJDBCPython ClientRuby Client等BeelineHiveServer2Hive CLIJDBCPython ClientRuby ClientHive

 

3. HiveServer2

(1) HiveHQL(Operator)GroupByOperatorJoinOperator

2OperatorHive

3HDFSMapReduce

4HiveExecMapperExecReducerMapReduce

(5)  Hive 

a. Parser HQL (ASTAbstract Syntax Tree)

b. Semantic Analyzer

c. Logic Plan Generator

d. Logic Optimizer

e. Physical Plan Gernerator(MapReduce Jobs)

f. Physical Optimizer Join 

(6) 

Job Jobshuffle

 

 

HQLMapReduceHadoopSQL使HQL使Hive

1. HQLSQLSQLBeelineSQLHive

 

 

2.  Hive

1Hive

DataBaseMetaStore(MySQL)

//hive > create database test_database;

2

HiveTableTableHivepvsHDFS/wh/pvswhhive-site.xml${hive.metastore.warehouse.dir} TableExternal Table

3

HDFSHDFS便

HDFSPartition

访

CREATE EXTERNAL TABLE LOCATIONLOCATION HDFS External Table

//hive > create external table test_external_table (key string)

4

PartitionPartitionHivePartitionHivePartitionPartitionpvsdscityPartitionds = 20090801, ctry = US HDFS/wh/pvs/ds=20090801/ctry=US ds = 20090801, ctry = CA HDFS/wh/pvs/ds=20090801/ctry=CA

//hive >create table test_partition_table (key string) partitioned by (dt string)

 

5

BucketsHashhashhashBucketuser32bucketuserhashhash0HDFS/wh/pvs/ds=20090801/ctry=US/part-00000hash20HDFS/wh/pvs/ds=20090801/ctry=US/part-00020Map

//hive >creattable test_bucket_table (kestring) clustered by (key) int20 buckets

 

 6Hive

select

//hive >create view test_view as select * from test

 

Hive使http://hive.apache.org/wikiHive使ZookeeperHA

Hive0.14使ZookeeperHiveServer2HA(ZooKeeper Service Discovery)ClientnameSpaceHiveServer2hostport

 

1. HiveServer2Zookeeperapache-hive-2.0.0-binhive-site.xml

 HiveServer2ZookeeperHive

2. 使JDBC

JDBCURL

HiveServer2
posted @ 2019-04-28 00:54  北辰Root  阅读(834)  评论(0编辑  收藏  举报