Versions Compared

Key

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

...

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

HCatPartition

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

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);

...