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. css中position与z-index

    position属性 在css中,position属性用来控制元素的位置信息,其取值共有4种,即static.relative.absolute.fixed. 静态定位(static) 若没有指定po ...

  2. .NET Core的“dotnet restore”、“dotnet build”和“dotnet run”命令都是用来干什么的?

    dotnet restore 源代码:https://github.com/dotnet/cli/tree/rel/1.0.0/src/dotnet/commands/dotnet-restore 入 ...

  3. 误报的java.sql.SQLException: Parameter number 21 is not an OUT parameter

    今天为了模拟一个mysql内存不释放问题,要测试一个存储过程,同时具有出参和入参,启动时报了上述错误. <select id="funcl_trd_secu_execution_que ...

  4. Play Framework框架 JPA惯用注解

    Play Framework框架 JPA常用注解 1.@Entity(name=”EntityName”) 必须 ,name 为可选 , 对应数据库中一的个表 2.@Table(name=”" ...

  5. 利用Jquery使用HTML5的FormData属性实现对文件的上传

    1.利用Jquery使用HTML5的FormData属性实现对文件的上传 在HTML5以前我们如果需要实现文件上传服务器等功能的时候,有时候我们不得不依赖于FLASH去实现,而在HTML5到来之后,我 ...

  6. 移动端调试工具-Debuggap

    随着移动互联网的迅速崛起,开发移动应用程序越来越多,但如果在移动端开发应用程序需要调试时,额- 仿佛又回到了IE时代,最方便也只能到处 alert 来调试.目前已经有一款产品可以做到这一点,比如pho ...

  7. Snort - manual 笔记(三)

    1.6 Reading pcap files Snort 不仅可以监听interface, 还可以读取和分析已经捕获的数据包. 1.6.1 Command line arguments 下面的命令都可 ...

  8. Android 自定义带刻度的seekbar

    自定义带刻度的seekbar 1.布局 <span style="font-family:SimHei;font-size:18px;"><com.imibaby ...

  9. 【转】android shape的使用

    shape用于设定形状,可以在selector,layout等里面使用,有6个子标签,各属性如下: <?xml version="1.0" encoding="ut ...

  10. C++ RTTI

    一.定义:RTTI:Run Time Type Identification ,运行时类型识别:指程序能够使用基类的指针或引用来检索其所指对象的实际派生类型.二.使用方式:C++中有两个操作符提供RT ...