HCatCreateDBDesc dbDesc = HCatCreateDBDesc.create(dbName)
.ifNotExists(true).build();
client.createDatabase(dbDesc);
ArrayList<HCatFieldSchema> cols = new ArrayList<HCatFieldSchema>();
cols.add(new HCatFieldSchema("userid", Type.INT, "id columns"));
cols.add(new HCatFieldSchema("viewtime", Type.BIGINT,
"view time columns"));
cols.add(new HCatFieldSchema("pageurl", Type.STRING, ""));
cols.add(new HCatFieldSchema("ip", Type.STRING,
"IP Address of the User"));
ArrayList<HCatFieldSchema> ptnCols = new ArrayList<HCatFieldSchema>();
ptnCols.add(new HCatFieldSchema("dt", Type.STRING, "date column"));
ptnCols.add(new HCatFieldSchema("country", Type.STRING,
"country column"));
HCatTable table = new HCatTable(dbName, tableName).cols(cols)
.partCols(ptnCols)
.fileFormat("sequenceFile");
HCatCreateTableDesc tableDesc = HCatCreateTableDesc.create(table, false).build();