首页 > 其他分享 >hive - beeline命令行可以使用的命令

hive - beeline命令行可以使用的命令

时间:2023-06-01 15:36:02浏览次数:34  
标签:node03 jdbc hive current beeline 命令行 specified table

 

 

 

beeline> !help
!all                Execute the specified SQL against all the current connections
!autocommit         Set autocommit mode on or off
!batch              Start or execute a batch of statements
!brief              Set verbose mode off
!call               Execute a callable statement
!close              Close the current connection to the database
!closeall           Close all current open connections
!columns            List all the columns for the specified table
!commit             Commit the current transaction (if autocommit is off)
!connect            Open a new connection to the database.
!dbinfo             Give metadata information about the database
!describe           Describe a table
!dropall            Drop all tables in the current database
!exportedkeys       List all the exported keys for the specified table
!go                 Select the current connection
!help               Print a summary of command usage
!history            Display the command history
!importedkeys       List all the imported keys for the specified table
!indexes            List all the indexes for the specified table
!isolation          Set the transaction isolation for this connection
!list               List the current connections
!manual             Display the BeeLine manual
!metadata           Obtain metadata information
!nativesql          Show the native SQL for the specified statement
!nullemptystring    Set to true to get historic behavior of printing null as
                    empty string. Default is false.
!outputformat       Set the output format for displaying results
                    (table,vertical,csv,tsv,xmlattrs,xmlelements)
!primarykeys        List all the primary keys for the specified table
!procedures         List all the procedures
!properties         Connect to the database specified in the properties file(s)
!quit               Exits the program
!reconnect          Reconnect to the database
!record             Record all output to the specified file
!rehash             Fetch table and column names for command completion
!rollback           Roll back the current transaction (if autocommit is off)
!run                Run a script from the specified file
!save               Save the current variabes and aliases
!scan               Scan for installed JDBC drivers
!script             Start saving a script to a file
!set                Set a beeline variable
!show               show an options current value
!source             Execute a SQL file
!sql                Execute a SQL command
!tables             List all the tables in the database
!typeinfo           Display the type map for the current connection
!verbose            Set verbose mode on

Comments, bug reports, and patches go to ???
beeline>

 

 

建立连接

beeline> !connect jdbc:hive2://node03:10000
scan complete in 3ms
Connecting to jdbc:hive2://node03:10000
Enter username for jdbc:hive2://node03:10000: harley
Enter password for jdbc:hive2://node03:10000: ******
2023-06-01 15:24:12,238 INFO jdbc.Utils: Supplied authorities: node03:10000
2023-06-01 15:24:12,239 INFO jdbc.Utils: Resolved authority: node03:10000
Connected to: Apache Hive (version 0.12.0-transwarp-tdh4310)
Driver: Hive JDBC (version 0.12.0-transwarp-tdh4310)
Transaction isolation: TRANSACTION_REPEATABLE_READ
beeline>
0: jdbc:hive2://node03:10000>

也可以直接写成一行:beeline> !connect jdbc:hive2://node03:10000 harley 123456

 

标签:node03,jdbc,hive,current,beeline,命令行,specified,table
From: https://www.cnblogs.com/harleyblogs/p/17449158.html

相关文章

  • 快速操作Linux终端命令行的快捷键列表
    快速操作Linux终端命令行的快捷键列表在shell命令终端中,Ctrl+n相当于方向向下的方向键,Ctrl+p相当于方向向上的方向键。在命令终端中通过它们或者方向键可以实现对历史命令的快速查找。这也是快速输入命令的技巧。在命令终端中可以通过Ctrl+r实现快速检索使用过的历史命令。Ctrl+r......
  • 在linux服务器上使用命令行下载百度网盘中的文件
    转载自https://blog.csdn.net/qq_37428140/article/details/124219739 1、安装bypy工具pipinstallbypy2、认证自己的网盘账号bypyinfo按照提示,在控制台和浏览器中完成认证3、授权成功后,我们可以在网盘中的“我的应用数据”目录下看到如下文件夹: 将需要下载的......
  • sparkSQL原理和使用——一般在生产中,基本都是使用hive做数据仓库存储数据,然后用spark
    一、sparkSQL概述1.1什么是sparkSQLSparkSQL是Spark用来处理结构化数据的一个模块,它提供了一个编程抽象叫做DataFrame并且作为分布式SQL查询引擎的作用。类似于hive的作用。1.2sparkSQL的特点1、容易集成:安装Spark的时候,已经集成好了。不需要单独安装。2、统一的数据访问方......
  • Hive扩展内容
    一个SQL语句的分析SELECTa.Key,SUM(a.Cnt)ASCntFROM(SELECTKey,COUNT(*)ASCntFROMTableNameGROUPBYKey,CASEWHENKey='KEY001'THENHash(Random())%50ELSE0END)aGROUPBYa.Key;这个SQL其实是一个解决数据倾......
  • Hive高级函数实战
    函数的基本操作和mysql一样的,hive也是一个主要做统计的工具,所以为了满足各种各样的统计需要,它也内置了相当多的函数showfunctions;#查看所有内置函数descfunctionfunctionName;#查看指定函数的描述信息descfunctionextendedfunctionName;#显示函数的扩展内容Hiv......
  • 【博学谷学习记录】超强总结,用心分享 | hive分区与分桶的区别
    【博学谷IT技术支持】公众号:积雷山摩云洞,欢迎关注!!!概念分区表:将数据分散到多个子目录中,在执行查询是,可以根据条件加快查询效率分桶表:是相对分区更细的颗粒度划分,分桶表是将表查分到不同的文件中,根据数据表某列的hash值进行分区,对某列数据分区就是对该列属性值的hash值取模,......
  • Hive核心实战
    Hive中数据库的操作showdatabases;#查看数据库列表usedefault;#选择数据库createdatabasemydb1;#创建数据库createdatabasemydb2location'/user/hive/mydb2';#指定hdfs目录的位置dropdatabasemydb1;#删除数据库default是默认数据库,默认就在这个库里面......
  • Hive中的表类型
    在Mysql中没有表类型这个概念,因为它就只有一种表。但是Hive中是有多种表类型的,我们可以分为四种,内部表、外部表、分区表、桶表下面来一个一个学习一下这些类型的表内部表内部表也可以称为受控表,它是Hive中的默认表类型,表数据默认存储在warehouse目录中。在加载数据的过程中,......
  • Hive基础使用
    Hive的使用方式可以在Shell命令行下操作Hive,或者使用JDBC代码的方式操作命令行方式针对命令行这种方式,其实还有两种使用第一个是使用bin目录下的hive命令,这个是从hive一开始就支持的使用方式后来又出现一个beeline命令,它是通过HiveServer2服务连接hive,是一个轻量级的客户端......
  • Hive - 言出法随
            --显示当前数据库selectcurrent_database();--设置hive属性在命令行显示当前数据库sethive.cli.print.current.db=true; ......