...
Modification to Existing Classes:
HCatTableInfo
...
In the current code base, HCatTableInfo class acts a wrapper for the Table class, providing only required information to the users. Similar classes
need to be added for database and partition. Also, there needs to appropriate builder methods to construct HCatTableInfo, HCatPartitionInfo and
HCatDatabaseInfo classes.
The current relationship between HCatTableInfo, StorerInfo and PartInfo is as follows:
The "PartInfo" class can be modified to act as a wrapper to partition ( similar to HCatTableInfo). The following modifications need to be done:
- Remove job properties.
- All the properties required by the partition info are available with the Partition. HCatPartitionInfo( present PartInfo) should make use of it.
- There is no need to store HCatTableInfo as a member. It is only used to obtain data column and value mapping. There can be a method that can take a HCatTableInfo as input.
Usage
Code Block |
---|
Configuration config = new Configuration(); config.add("hive-site.xml"); HCatTempletonClient client = new HCatTempletonClient(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); |
...
Discussion Topics
- Templeton APIs should given as much information as HiveMetaStoreClient does using its APIs.
- Delete APIs in Templeton have user group and permissions as input parameters.
- The describe partition result in Templeton has column info , which Partition does not have.
- Addition of two more APIs, "MarkSetDone" and "listPartitionsByFilter"