hcatalog配置



hive的配置中添加:
export PATH=$PATH:$HIVE_HOME/hcatalog/bin:$HIVE_HOME/hcatalog/sbin


HCatalog CLI

The HCatalog CLI supports these command line options:

Option

Usage

Description

-g

hcat -g mygroup ...

Tells HCatalog that the table which needs to be created must have group "mygroup".

-p

hcat -p rwxr-xr-x ...

Tells HCatalog that the table which needs to be created must have permissions "rwxr-xr-x".

-f

hcat -f myscript.hcatalog ...

Tells HCatalog that myscript.hcatalog is a file containing DDL commands to execute.

-e

hcat -e 'create table mytable(a int);' ...

Tells HCatalog to treat the following string as a DDL command and execute it.

-D

hcat -Dkey=value ...

Passes the key-value pair to HCatalog as a Java System Property.

 

hcat

Prints a usage message.

Note the following:

  • The -g and -p options are not mandatory.
  • Only one -e or -f option can be provided, not both.
  • The order of options is immaterial; you can specify the options in any order.

If no option is provided, then a usage message is printed:

Usage:  hcat  { -e "<query>" | -f <filepath> }  [-g <group>] [-p <perms>] [-D<name>=<value>]


Create/Drop/Alter Table

CREATE TABLE

If you create a table with a CLUSTERED BY clause you will not be able to write to it with Pig or MapReduce. This is because they do not understand how to partition the table, so attempting to write to it would cause data corruption.

CREATE TABLE AS SELECT

Not supported. Throws an exception with the message "Operation Not Supported".

DROP TABLE

Supported. Behavior the same as Hive.

ALTER TABLE

Supported except for the REBUILD and CONCATENATE options. Behavior the same as Hive.

Create/Drop/Alter View

Note: Pig and MapReduce cannot read from or write to views.

CREATE VIEW

Supported. Behavior same as Hive.

DROP VIEW

Supported. Behavior same as Hive.

ALTER VIEW

Supported. Behavior same as Hive.

Show/Describe

SHOW TABLES

Supported. Behavior same as Hive.

SHOW PARTITIONS

Not supported. Throws an exception with message "Operation Not Supported".

SHOW FUNCTIONS

Supported. Behavior same as Hive.

DESCRIBE

Supported. Behavior same as Hive.

Create/Drop Index

CREATE and DROP INDEX operations are supported.

Note: Pig and MapReduce cannot write to a table that has auto rebuild on, because Pig and MapReduce do not know how to rebuild the index.

Create/Drop Function

CREATE and DROP FUNCTION operations are supported, but created functions must still be registered in Pig and placed in CLASSPATH for MapReduce.

"dfs" Command and "set" Command

Supported. Behavior same as Hive.

Other Commands

Any command not listed above is NOT supported and throws an exception with the message "Operation Not Supported".

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值