Hive cli vs beeline

The primary difference between the two involves how the clients connect to Hive.

The Hive CLI connects directly to the Hive Driver and requires that Hive be installed on the same machine as the client.

Beeline connects to HiveServer2 and does not require the installation of Hive libraries on the same machine as the client. Beeline is a thin client that also uses the Hive JDBC driver but instead executes queries through HiveServer2, which allows multiple concurrent client connections and supports authentication.

1.load data local inpath is not support in beeline.

Solution:  a. we can use 'put'  and 'load data inpath' to replace this command.

                   b. create these stage table as external table, then we just add new partitions and then just put file, not need load.

beeline -n username -u "jdbc:hive2://hiveserver:10000/dbname;principal=hive/hiveserve@domain"

run kinit before run beeline.

Echo 'password' | kinit

drop table evan_test2;

CREATE EXTERNAL TABLE evan_test2 (

userId BIGINT,

type INT,

filename String

)

COMMENT 'User Infomation'

PARTITIONED BY (country String)

ROW FORMAT DELIMITED FIELDS TERMINATED BY ','

STORED AS TEXTFILE

LOCATION 'hdfs:////evan_test/';

alter table evan_test2 add partition(country='tet');

 2.

INSERT OVERWRITE LOCAL DIRECTORY 'temp'

FIELDS TERMINATED BY ','

select * from evan_test2;

This is not support in beeline .

Solution: we can use beeline's new command to implement the same function.

               beeline --showHeader=false --outputformat=dsv --delimiterForDSV=$'\001' -e 'select * from evan_test3' >test.csv

Show data test.csv

Cat -a test.csv

Cat -a test.csv | tr $'\001' '\t'

Hive beeline update的更多相关文章

  1. Hive Beeline 官方文档学习

    Beeline 是什么? 它是一个命令行形式的jdbc客户端.搞Java开发的同学,看到这里就应该知道这货是什么了 ── 它是一个连接数据库的工具. 只不过Beeline连接的数据库是HiveServ ...

  2. hive beeline详解

    Hive客户端工具后续将使用Beeline 替代HiveCLI ,并且后续版本也会废弃掉HiveCLI 客户端工具,Beeline是 Hive 0.11版本引入的新命令行客户端工具,它是基于SQLLi ...

  3. Hive Beeline 命令行参数

    [hadoop@hive ~]$ beeline --help[中文版] The Beeline CLI 支持以下命令行参数: Option Description --autoCommit=[tru ...

  4. [转]Hive/Beeline 使用笔记

    FROM : http://www.7mdm.com/1407.html Hive: 利用squirrel-sql 连接hive add driver -> name&example u ...

  5. 关于 HIVE Beeline 问题

    1  启动 hiveserver2 服务,启动 beeline -u jdbc:hive2:// 正常 ,启动 beeline -u jdbc:hive2://127.0.0.1:10000 包如下错 ...

  6. hive Beeline plus HiveServer2简单使用

    HiveServer2是经常与beeline一起使用,可以用jdbc客户端远程连接,一般用于生产环境. 在提供传统客服端的功能之外,还提供其他功能: Beeline连接 1.先在hadoop集群启动H ...

  7. HIve:beeline终端上在输错hive语句时,无论 Backspace还是delete 都删除不掉错误的语句,没有办法退格

    通过SecureCRT工具连上linux后,通过beeline连接上hive后,在输错hive语句时,无论 Backspace还是delete 都删除不掉错误的语句,没有办法退格. 解决方案: 第一步 ...

  8. hive orc update

    hive-site.xml --><configuration> <!-- WARNING!!! This file is auto generated for documen ...

  9. hive & hive beeline常用参数

    Hive 1参数如下: usage: hive -d,--define <key=value> Variable substitution to apply to Hive command ...

随机推荐

  1. C语言中有bool类型吗?

    之前一直都没有注意到,最近在用C语言写DSP算法时,偶然间发现我函数中定义的bool类型的变量在VC6.0(我主要用它来检查一下语法错误)中编译居然报错了,说是bool类型没有定义.用了这么久的C和C ...

  2. html5人物图片360度立体旋转

    体验效果:http://hovertree.com/texiao/html5/10.htm 下载:http://hovertree.com/hvtart/bjae/t16oddyt.htm 代码如下: ...

  3. 用C#编程的建议

    1.如果可能尽量使用接口来编程       .NET框架包括类和接口,在编写程序的时候,你可能知道正在用.NET的哪个类.然而,在这种情况下如果你用.NET支持的接口而不是它的类来编程时,代码会变得更 ...

  4. 【循序渐进学Python】7.面向对象的核心——类型(上)

    我们知道Python是一门面向对象的脚本语言.从C#的角度来看:首先Python支持多继承.Python 类型成员通常都是public的,并且所有成员函数都是virtual的(可以直接重写). 1. ...

  5. sns社区架构设计案例分享(二)

    源码下载地址:http://www.jinhusns.com/Products/Download/?type=xcj 五. 架构使用说明 > 缓存 > 使用说明 > (一)基础类库介 ...

  6. 重新想象 Windows 8 Store Apps (57) - 本地化和全球化

    [源码下载] 重新想象 Windows 8 Store Apps (57) - 本地化和全球化 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 本地化和全球化 本地化 ...

  7. ECMall如何支持SSL连接邮件服务器的配置

    首先,主要是ecmall使用的phpmailer版本太低,不支持加密连接. 然后,得对相应代码做一定调整. 1. 覆盖phpmailer 请从附件进行下载: http://files.cnblogs. ...

  8. HDU 1028(母函数)

    Online Judge Online Exercise Online Teaching Online Contests Exercise Author F.A.QHand In HandOnline ...

  9. 【洛谷 P3385】模板-负环(图论--spfa)

    题目:有一个图有N个顶点,M条边.边用三个整数a b w表示,意思为a->b有一条权值为w的边(若w<0则为单向,否则双向).共T组数据.对于每组数据,存在负环则输出一行"YE5 ...

  10. mongodb学习2---常用命令解析

    1,mongodb insert()和save()的相同点和区别区别:若新增的数据中存在主键 ,insert() 会提示错误,而save() 则更改原来的内容为新内容.insert({_id : 1, ...