Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: apply monofont to "hcat" in table

Command Line Interface

Table of Contents
maxLevel3

Set Up

The HCatalog command line interface (CLI) can be invoked as HIVE_HOME=hive_home hcat_home/bin/hcat where hive_home is the directory where Hive has been installed and hcat_home is the directory where HCatalog has been installed.

...

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:

...

When using the HCatalog CLI, you cannot specify a permission string without read permissions for owner, such as -wxrwxr-x, because the string begins with "-". If such a permission setting is desired, you can use the octal version instead, which in this case would be 375. Also, any other kind of permission string where the owner has read permissions (for example r-x------ or r--r--r--) will work fine.

Hive CLI

Many hcat commands can be issued as hive commands, including all HCatalog DDL commands. The Hive CLI includes some commands that are not available in the HCatalog CLI. Note these differences:

  • "hcat -g" and "hcat -p" for table group and permission settings are only available in the HCatalog CLI.
  • hcat uses the -p flag for permissions but hive uses it to specify a port number.
  • hcat uses the -D flag without a space to define key=value pairs but hive uses -d or --define with a space (also --hivevar).
    For example, "hcat -DA=B" versus "hive -d A=B".
  • hcat without any flags prints a help message but hive uses the -H flag or --help.

The Hive CLI is documented here.

HCatalog DDL

HCatalog supports all Hive Data Definition Language except those operations that require running a MapReduce job. For commands that are supported, any variances are noted below.

HCatalog does not support the following Hive DDL and other HiveQL commands:

  • IMPORT FROM ALTER INDEX ... REBUILD
  • EXPORT TABLE
  • CREATE TABLE ... AS SELECT
  • ALTER TABLE ... REBUILDCONCATENATE
  • ALTER TABLE ... CONCATENATEARCHIVE/UNARCHIVE PARTITION
  • ANALYZE TABLE ... COMPUTE STATISTICSALTER TABLE ARCHIVE/UNARCHIVE PARTITION
  • IMPORT FROM ...
  • EXPORT TABLE

For information about using WebHCat for DDL commands, see URL Format and WebHCat Reference: DDL Resources.

Create/Drop/Alter Table

CREATE TABLE

...

Panel
titleColorindigo
titleBGColorsilver
titleNavigation Links

Previous: Reader and Writer Interfaces
Next: Storage Formats

Hive command line interface: Hive CLI
Hive DDL commands: Hive Data Definition Language
WebHCat DDL resources: WebHCat Reference: DDL

General: HCatalog ManualWebHCat (Templeton) ManualHive Home
Old version (HCatalog 0.5.0): Command Line InterfaceWiki HomeHive Project Site