/** * Builds the HCatAddPartitionDesc. * * @return the h cat add partition desc * @throws HCatException */ public HCatAddPartitionDesc build() throws HCatException { return hcatPartition == null? new HCatAddPartitionDesc(dbName, tableName, location, partitionSpec) : new HCatAddPartitionDesc(hcatPartition); } }
tbl = hmsClient.getTable(partInfoList.get(0).getDatabaseName(), partInfoList.get(0).getTableName()); HCatTable hcatTable = new HCatTable(tbl); ArrayList<Partition> ptnList = new ArrayList<Partition>(); for (HCatAddPartitionDesc desc : partInfoList) { HCatPartition hCatPartition = desc.getHCatPartition(); hCatPartition = desc.getHCatPartition(hcatTable); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfoList.get(0).getTableName() + " is could not be found.", e); } catch (TException e) {
partitionSpec.put("grid", "AB"); partitionSpec.put("dt", "2011_12_31"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table,partitionSpec))).build()); partitionSpec.put("grid", "AB"); partitionSpec.put("dt", "2012_01_01"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table,partitionSpec))).build()); partitionSpec.put("dt", "2012_01_01"); partitionSpec.put("grid", "OB"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table,partitionSpec))).build()); partitionSpec.put("dt", "2012_01_01"); partitionSpec.put("grid", "XB"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table,partitionSpec))).build());
partitionSpec.put("grid", "AB"); partitionSpec.put("dt", "2011_12_31"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table, partitionSpec))).build()); partitionSpec.put("grid", "AB"); partitionSpec.put("dt", "2012_01_01"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table, partitionSpec))).build()); partitionSpec.put("dt", "2012_01_01"); partitionSpec.put("grid", "OB"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table, partitionSpec))).build()); partitionSpec.put("dt", "2012_01_01"); partitionSpec.put("grid", "XB"); client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(table, partitionSpec, makePartLocation(table, partitionSpec))).build());
Table tbl = null; try { tbl = hmsClient.getTable(partInfo.getDatabaseName(), partInfo.getTableName()); throw new HCatException("The table " + partInfo.getTableName() + " is not partitioned."); HCatPartition hcatPartition = partInfo.getHCatPartition(); hcatPartition = partInfo.getHCatPartition(hcatTable); throw new HCatException("MetaException while adding partition.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfo.getTableName() + " is could not be found.", e); } catch (TException e) {
firstPtn.put("country", "usa"); HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(new HCatPartition(table, firstPtn, null)).build(); client.addPartition(addPtn); secondPtn.put("country", "brazil"); HCatAddPartitionDesc addPtn2 = HCatAddPartitionDesc.create(dbName, tableName, null, secondPtn).build(); client.addPartition(addPtn2); thirdPtn.put("country", "argentina"); HCatAddPartitionDesc addPtn3 = HCatAddPartitionDesc.create(dbName, tableName, null, thirdPtn).build(); client.addPartition(addPtn3);
/** * Builds the HCatAddPartitionDesc. * * @return the h cat add partition desc * @throws HCatException */ public HCatAddPartitionDesc build() throws HCatException { return hcatPartition == null? new HCatAddPartitionDesc(dbName, tableName, location, partitionSpec) : new HCatAddPartitionDesc(hcatPartition); } }
tbl = hmsClient.getTable(partInfoList.get(0).getDatabaseName(), partInfoList.get(0).getTableName()); HCatTable hcatTable = new HCatTable(tbl); ArrayList<Partition> ptnList = new ArrayList<Partition>(); for (HCatAddPartitionDesc desc : partInfoList) { HCatPartition hCatPartition = desc.getHCatPartition(); hCatPartition = desc.getHCatPartition(hcatTable); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfoList.get(0).getTableName() + " is could not be found.", e); } catch (TException e) {
client.addPartition(HCatAddPartitionDesc.create(new HCatPartition(createdTable, partitionSpec, makePartLocation(createdTable,partitionSpec))).build());
/** * Builds the HCatAddPartitionDesc. * * @return the h cat add partition desc * @throws HCatException */ public HCatAddPartitionDesc build() throws HCatException { return hcatPartition == null? new HCatAddPartitionDesc(dbName, tableName, location, partitionSpec) : new HCatAddPartitionDesc(hcatPartition); } }
tbl = hmsClient.getTable(partInfoList.get(0).getDatabaseName(), partInfoList.get(0).getTableName()); HCatTable hcatTable = new HCatTable(tbl); ArrayList<Partition> ptnList = new ArrayList<Partition>(); for (HCatAddPartitionDesc desc : partInfoList) { HCatPartition hCatPartition = desc.getHCatPartition(); hCatPartition = desc.getHCatPartition(hcatTable); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfoList.get(0).getTableName() + " is could not be found.", e); } catch (TException e) {
HCatPartition ptnToAdd1 = (new HCatPartition(tableCreated, ptnDesc1, TestHCatClient.makePartLocation(tableCreated,ptnDesc1))).parameters(props1); client.addPartition(HCatAddPartitionDesc.create(ptnToAdd1).build()); HCatPartition ptnToAdd2 = (new HCatPartition(tableCreated, ptnDesc2, TestHCatClient.makePartLocation(tableCreated,ptnDesc2))).parameters(props2); client.addPartition(HCatAddPartitionDesc.create(ptnToAdd2).build());
/** * Builds the HCatAddPartitionDesc. * * @return the h cat add partition desc * @throws HCatException */ public HCatAddPartitionDesc build() throws HCatException { return hcatPartition == null? new HCatAddPartitionDesc(dbName, tableName, location, partitionSpec) : new HCatAddPartitionDesc(hcatPartition); } }
tbl = hmsClient.getTable(partInfoList.get(0).getDatabaseName(), partInfoList.get(0).getTableName()); HCatTable hcatTable = new HCatTable(tbl); ArrayList<Partition> ptnList = new ArrayList<Partition>(); for (HCatAddPartitionDesc desc : partInfoList) { HCatPartition hCatPartition = desc.getHCatPartition(); hCatPartition = desc.getHCatPartition(hcatTable); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfoList.get(0).getTableName() + " is could not be found.", e); } catch (TException e) {
HCatPartition ptn1 = (new HCatPartition(table2Created, ptnDesc1, makePartLocation(table2Created,ptnDesc1))); sourceMetastore.addPartition(HCatAddPartitionDesc.create(ptn1).build()); HCatPartition ptn = (new HCatPartition(table2Created, ptnDesc, makePartLocation(table2Created,ptnDesc))); sourceMetastore.addPartition(HCatAddPartitionDesc.create(ptn).build()); sourceMetastore.dropPartitions(dbName,tblName2,ptnDesc,true);
Table tbl = null; try { tbl = hmsClient.getTable(partInfo.getDatabaseName(), partInfo.getTableName()); throw new HCatException("The table " + partInfo.getTableName() + " is not partitioned."); HCatPartition hcatPartition = partInfo.getHCatPartition(); hcatPartition = partInfo.getHCatPartition(hcatTable); throw new HCatException("MetaException while adding partition.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfo.getTableName() + " is could not be found.", e); } catch (TException e) {
Table tbl = null; try { tbl = hmsClient.getTable(partInfo.getDatabaseName(), partInfo.getTableName()); throw new HCatException("The table " + partInfo.getTableName() + " is not partitioned."); HCatPartition hcatPartition = partInfo.getHCatPartition(); hcatPartition = partInfo.getHCatPartition(hcatTable); throw new HCatException("MetaException while adding partition.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfo.getTableName() + " is could not be found.", e); } catch (TException e) {
makePartLocation(sourceTable,partitionSpec_1)); sourceMetaStore().addPartition(HCatAddPartitionDesc.create(sourcePartition_1).build()); assertEquals("Unexpected number of partitions. ", 1, sourceMetaStore().getPartitions(dbName, tableName).size()); HCatPartition sourcePartition_2 = new HCatPartition(sourceTable, partitionSpec_2, makePartLocation(sourceTable,partitionSpec_2)); sourceMetaStore().addPartition(HCatAddPartitionDesc.create(sourcePartition_2).build()); addPartitionDescs.add(HCatAddPartitionDesc.create(partition).build());
Table tbl = null; try { tbl = hmsClient.getTable(partInfo.getDatabaseName(), partInfo.getTableName()); throw new HCatException("The table " + partInfo.getTableName() + " is not partitioned."); HCatPartition hcatPartition = partInfo.getHCatPartition(); hcatPartition = partInfo.getHCatPartition(hcatTable); throw new HCatException("MetaException while adding partition.", e); } catch (NoSuchObjectException e) { throw new ObjectNotFoundException("The table " + partInfo.getTableName() + " is could not be found.", e); } catch (TException e) {