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. knockout.js的简介和简单使用

    1.knockout简介knockout是一个轻量级的UI类库,通过MVVM模式使JavaScript前端UI简单化knockout有四大重要概念:1)声明式绑定:使用简明移读的语法很容易地将模型(m ...

  2. Fluent NHibernate and Spring.net

    http://blog.bennymichielsen.be/2009/01/04/using-fluent-nhibernate-in-spring-net/ http://comments.gma ...

  3. ex_KMP--Theme Section

    题目网址: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=110060#problem/B Description It's time f ...

  4. JDK动态代理的实现及原理

    Proxy.newProxyInstance(classloader,Class,invocationHandler) 调用getProxyClass0(loader, interfaces)生成代理 ...

  5. java注释指导手册

    译文出处: Toien Liu   原文出处:Dani Buiza 编者的话:注解是java的一个主要特性且每个java开发者都应该知道如何使用它. 我们已经在Java Code Geeks提供了丰富 ...

  6. C++ Const(常类型)的作用总结

    C++ Const的作用总结 面试或者工作中,我们经常遇到const修饰符定义的变量,函数和对象等.那么const的作用具体是什么,有哪些.今天自己好好的总结了一下,记录下来方便自己以后时间久了不记得 ...

  7. Android5.0新特性——兼容性(support)

    兼容性 虽然Material Design新增了许多新特性,但是并不是所有新内容对对下保持了兼容. 使用v7包 v7 support libraries r21 及更高版本包含了以下Material ...

  8. PHP PEAR2

    出错: Pyrus\Installer\Exception: Installation failed Pyrus\AtomicFileTransaction\MultiException: Unabl ...

  9. SharePoint 2013 新功能探索 之 SPGroup、SPUser 事件处理程序 还要继续改进

    曾几何时,想要获取SPGroup Add及SPUserAdd事件,在网上查找各种方法,都没有找到相对应的解决办法,如今在VS 2013 Preview版本 提供了 SPSecurityEventRec ...

  10. Bootstrap 我的学习记录4 轮播图的使用和理解

    <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8& ...