- Install hive
1. download hive-0.12.0.bin.tar.gz
2.#tar -xzvf hive-0.12.0.bin.tar.gz
3.add the bin dir to PATH in ~/.bashrc
4.#source ~/.bashrc
The dir structure of hive-0.12.0.bin likes the following:
lib/ : contains JARs., which implement a particular subset of Hive's functionality.
bin/: contains executable scripts that launch various Hive service, including the hive command-line interface(CLI)
hcatalog/: metastore service related procedures.
conf/: configuration files
examples/: some example script
Thrift service provides remote access from other processes.
Hive uses a built-in Derby SQL server, which provides limited, single-process metadata storage.
start hive
#hive //start hive CLI
#hive --help
The list of hive service is :
you can start a service using command like
#hive --service service-name
#hive //default run CLI service
look for help for CLI
#hive --help --service cli
- Variables and Properties
In CLI, set and display variables and properties using set
#hive --define foo=bar
#hive
hive> set foo;
hive>set;
hive>set -v;
hive>set env:HOME;
hive>set foo=xbar;
- Basic commands
#hive --hiveconf hive.cli.print.current.db=true
#hive -e "select * from mytable limit 3";
#hive -S -e "select * from mytable limit 3" > /tmp/myquery;
execute hql script
#hive -f /path/to/withqueries.hql
or
hive> source /path/to/withqueries.hql
shell execution
hive> ! shell-commands;
hive> ! pwd;
note: Don't invoke interactive commands that require user input. shell 'pipes' don't work and neither do file 'globs'.
Hadoop dfs commands from inside hive
hive> dfs -ls /;
hive> dfs -help;
Comments in Hive Scripts
--the is a comment line
Query Column Headers
hive>set hive.cli.print.header=true;
Start Hive Server
#hive --service hiveserver & //run hiveserver in daemon mode
or start hiveserver2
#hiveserver2
#netstat -nl |grep 10000 //check whether the server is running
References:
https://cwiki.apache.org/confluence/display/Hive/Home
相关推荐
hive 开发UDF 使用maven工程 引发jar包缺失 hive 开发UDF 使用maven工程 引发jar包缺失
Apache Hive事务操作设计及未来发展 Apache Hive是一款基于Hadoop的数据仓库工具,支持对大规模数据的存储、查询和分析。随着大数据时代的到来,Apache Hive的事务操作设计变得越来越重要。本文将对Apache Hive的...
hive3.1.2编译后的驱动包
This book is your go-to resource for using Hive: authors Scott Shaw, Ankur Gupta, David Kjerrumgaard, and Andreas Francois Vermeulen take you through learning HiveQL, the SQL-like language specific ...
hive:/default/foobar hive -e "SELECT * FROM foobar" > $[OUTPUT]协议 !hive:/default/foobar <- !hive:/default/sample_07 [hive] CREATE TABLE IF NOT EXISTS ${env:TABLEOUT} LIKE ${env:TABLEIN}; INSERT ...
bdp2hive项目介绍一、概述项目主要是集成生成sqoop脚本和创建hive分区表组件。生成sqoop脚本组件主要通过传递的数据库信息查询数据库获取表字段与数据集之间的对照关系SQL语句,通过模板拼接成sqoop脚本,上传服务器...
hadoop-hue-hive-cookbook TODO:在此处输入食谱说明。 支持的平台 TODO:列出您支持的平台。 属性 钥匙 类型 描述 ... " recipe[hadoop-hue-hive::default] " ] } 许可证和作者 作者:: YOUR_NAME ()
This book is your go-to resource for using Hive: authors Scott Shaw, Ankur Gupta, David Kjerrumgaard, and Andreas Francois Vermeulen take you through learning HiveQL, the SQL-like language specific ...
"jdbc:hive://localhost:10000/default". Currently, the only dbname supported is "default". 2.从hive导出数据到本地时注意指定的目录/home/bigdata/syg。如果指定的目录存在,hive会先删除该目录下的所有文件。...
在使用Hive的Beeline客户端进行连接时,可能会遇到错误提示"Could not open client transport with JDBC Uri: jdbc:hive2://hcmaster:10000/default"。这个错误通常意味着Beeline无法通过JDBC URL成功建立到Hive ...
自述文件概括Django 开放式计算工具版本:0.1 Hive 是一个试图帮助其他需要计算能力的项目的项目。 它是一个网络平台 ( ),它试图让任何人都可以使用高性能集群。 本项目使用docker运行计算程序。 这允许使安装过程...
hive-jdbc-1.1.0-cdh5.4.5-standalone.jar Caused by: java.sql.SQLException: java.lang.ClassNotFoundException: org.apache.hive.jdbc.HiveDriver at com.trs.gateway.commons.hive.HiveFeature.getConnection...
Hive JDBC 1.1.0-cdh5.12.1 连接库是Apache Hive项目中的一个重要组件,主要用于允许客户端程序通过Java数据库连接(JDBC)接口与Hive服务器进行交互。这个连接库是专为CDH(Cloudera Distribution Including Apache...
### Hive介绍 Hive是一种构建在Hadoop之上的数据仓库工具,主要用来进行数据提取、转换、加载(ETL),并能以结构化的形式存储数据,以便进行更方便的查询和分析。它提供了类似SQL的查询语言(HQL),允许用户以SQL...
Missing Hive Execution Jar: /hive/hive1.2.1/lib/hive-exec-*.jar
错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1099; nested exception is: java.net.BindException: Address already in use: JVM_Bind 这里说的是1099端口被其它进程占用...
"HIVE安装及详解" HIVE是一种基于Hadoop的数据仓库工具,主要用于处理和分析大规模数据。下面是关于HIVE的安装及详解。 HIVE基本概念 HIVE是什么?HIVE是一种数据仓库工具,主要用于处理和分析大规模数据。它将...
hadoopHive:Acesso没有蜂箱
Then he addresses the use of Docker in the Hadoop ecosystem with complete chapters on utilizing not only Hadoop, but Hive, HBase, Sqoop, Kafka, Solr and Spark. What You Will LearnHow to install a ...