Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This class is a sub class of HCatCommandDesc and will be used by the users to create descriptor and validate it for the "create table" command.

Image Added

HCatCreateDBDesc

This class is a sub class of HCatCommandDesc and will be used by the users to create descriptors and validate it for the "create database" command.

Image Added

HCatAddPartitionDesc

This class is a sub class of HCatCommandDesc and will be used by the users to create descriptos and validate it for the "add partition" command.

Image Added

HCatTable

This class encapsulates the table information returned the HCatClient implementation class and provides a uniform view to the user.

Image Added

HCatDatabase

This class encapsulates the database information returned the HCatClient implementation class and provides a uniform view to the user.

Image Added

HCatPartition

Image Added

Usage

Code Block
 Configuration config = new Configuration();
 config.add("hive-site.xml");
 HCatClient client = HCatClient.create(config);

 HCatCreateTableDesc desc = new HCatCreateTableDesc();
 desc.setTableName("demo_table");
 desc.setDatabaseName("db1");
 desc.setFileFormat("rcfile");
 ArrayList<HCatFieldSchema> cols = new ArrayList<HCatFieldSchema>();
 cols.add(new HCatFieldSchema("col1", Type.INT, "comment1"));
 cols.add(new HCatFieldSchema("col2", Type.STRING, "comment2"));
 desc.setCols(cols);

 //Validate
 desc.validateCommandDesc();
 boolean success = client.createTable(desc);

...