final String HBASE_TABLE_NAME = "HiveExternalTable";
HTableDescriptor htableDesc = new HTableDescriptor(HBASE_TABLE_NAME.getBytes());
HColumnDescriptor hcolDesc = new HColumnDescriptor("cf".getBytes());
htableDesc.addFamily(hcolDesc);
HBaseAdmin hbaseAdmin = new HBaseAdmin(hbaseConf);
if(Arrays.asList(hbaseAdmin.listTables()).contains(htableDesc)){
// if table is already in there, don't recreate.
return;
}
hbaseAdmin.createTable(htableDesc);
HTable htable = new HTable(hbaseConf, HBASE_TABLE_NAME);