...
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.
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.
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.
HCatTable
This class encapsulates the table information returned the HCatClient implementation class and provides a uniform view to the user.
HCatDatabase
This class encapsulates the database information returned the HCatClient implementation class and provides a uniform view to the user.
HCatPartition
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); |
...