Examples of HCatAddPartitionDesc


Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

            }

            Map<String, String> partition = new HashMap<String, String>();
            partition.put("ds", candidatePartition); //yyyyMMDD
            partition.put("region", "in");
            HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
                    DATABASE_NAME, tableName, null, partition).build();
            client.addPartition(addPtn);
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

    @BeforeMethod
    private void addPartitions() throws Exception {
        Map<String, String> firstPtn = new HashMap<String, String>();
        firstPtn.put("ds", "20130903"); //yyyyMMDD
        firstPtn.put("region", "us");
        HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, firstPtn).build();
        client.addPartition(addPtn);

        Map<String, String> secondPtn = new HashMap<String, String>();
        secondPtn.put("ds", "20130903");
        secondPtn.put("region", "in");
        HCatAddPartitionDesc addPtn2 = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, secondPtn).build();
        client.addPartition(addPtn2);

        Map<String, String> thirdPtn = new HashMap<String, String>();
        thirdPtn.put("ds", "20130902");
        thirdPtn.put("region", "in");
        HCatAddPartitionDesc addPtn3 = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, thirdPtn).build();
        client.addPartition(addPtn3);
    }
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

    public void testReInstatePartition() throws Exception {
        Map<String, String> partitionSpec = new HashMap<String, String>();
        partitionSpec.put("ds", "20130918");
        partitionSpec.put("region", "blah");

        HCatAddPartitionDesc first = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(first);

        CatalogPartition partition = CatalogServiceFactory.getCatalogService().getPartition(
                METASTORE_URL, DATABASE_NAME, TABLE_NAME, partitionSpec);
        Assert.assertNotNull(partition);
        final long originalCreateTime = partition.getCreateTime();

        Thread.sleep(1000); // sleep before deletion
        client.dropPartitions(DATABASE_NAME, TABLE_NAME, partitionSpec, true);

        Thread.sleep(1000); // sleep so the next add is delayed a bit

        HCatAddPartitionDesc second = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(second);

        CatalogPartition reInstatedPartition = CatalogServiceFactory.getCatalogService().getPartition(
                METASTORE_URL, DATABASE_NAME, TABLE_NAME, partitionSpec);
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

        client.dropPartitions(DATABASE_NAME, TABLE_NAME, partitionSpec, true);

        Thread.sleep(1000); // sleep so the next add is delayed a bit

        HCatAddPartitionDesc reinstatedPartition = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(reinstatedPartition);

        CatalogPartition reInstatedPartition = CatalogServiceFactory.getCatalogService().getPartition(
                metastoreUrl, DATABASE_NAME, TABLE_NAME, partitionSpec);
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

        client.dropPartitions(DATABASE_NAME, TABLE_NAME, partitionSpec, true);

        Thread.sleep(1000); // sleep so the next add is delayed a bit

        HCatAddPartitionDesc reinstatedPartition = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(reinstatedPartition);

        CatalogPartition reInstatedPartition = CatalogServiceFactory.getCatalogService().getPartition(
                metastoreUrl, DATABASE_NAME, TABLE_NAME, partitionSpec);
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

            }

            Map<String, String> partition = new HashMap<String, String>();
            partition.put("ds", candidatePartition); //yyyyMMDD
            partition.put("region", "in");
            HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
                    DATABASE_NAME, tableName, null, partition).build();
            client.addPartition(addPtn);
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

                pathStr.append("region=in");
                touch(fs, pathStr.toString());
            }

            candidatePartition.put("region", "in");
            HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
                DATABASE_NAME, tableName, null, candidatePartition).build();
            client.addPartition(addPtn);
        }
    }
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

    @BeforeMethod
    private void addPartitions() throws Exception {
        Map<String, String> firstPtn = new HashMap<String, String>();
        firstPtn.put("ds", "20130903"); //yyyyMMDD
        firstPtn.put("region", "us");
        HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, firstPtn).build();
        client.addPartition(addPtn);

        Map<String, String> secondPtn = new HashMap<String, String>();
        secondPtn.put("ds", "20130903");
        secondPtn.put("region", "in");
        HCatAddPartitionDesc addPtn2 = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, secondPtn).build();
        client.addPartition(addPtn2);

        Map<String, String> thirdPtn = new HashMap<String, String>();
        thirdPtn.put("ds", "20130902");
        thirdPtn.put("region", "in");
        HCatAddPartitionDesc addPtn3 = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, thirdPtn).build();
        client.addPartition(addPtn3);
    }
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

    public void testReInstatePartition() throws Exception {
        Map<String, String> partitionSpec = new HashMap<String, String>();
        partitionSpec.put("ds", "20130918");
        partitionSpec.put("region", "blah");

        HCatAddPartitionDesc first = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(first);

        CatalogPartition partition = CatalogServiceFactory.getCatalogService().getPartition(
                METASTORE_URL, DATABASE_NAME, TABLE_NAME, partitionSpec);
        Assert.assertNotNull(partition);
        final long originalCreateTime = partition.getCreateTime();

        Thread.sleep(1000); // sleep before deletion
        client.dropPartitions(DATABASE_NAME, TABLE_NAME, partitionSpec, true);

        Thread.sleep(1000); // sleep so the next add is delayed a bit

        HCatAddPartitionDesc second = HCatAddPartitionDesc.create(
                DATABASE_NAME, TABLE_NAME, null, partitionSpec).build();
        client.addPartition(second);

        CatalogPartition reInstatedPartition = CatalogServiceFactory.getCatalogService().getPartition(
                METASTORE_URL, DATABASE_NAME, TABLE_NAME, partitionSpec);
View Full Code Here

Examples of org.apache.hcatalog.api.HCatAddPartitionDesc

        Map<String, String> partitions = new HashMap<String, String>();
        for (String part : parts) {
            String[] split = part.split("=");
            partitions.put(split[0], split[1]);
        }
        HCatAddPartitionDesc addPtn = HCatAddPartitionDesc.create(db, table, location, partitions).build();
        hcatClient.addPartition(addPtn);
        assertNotNull(hcatClient.getPartition(db, table, partitions));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.