@Test public void testGetPartitionAndDataColumns() throws Exception { Configuration conf = new Configuration(); Job myJob = new Job(conf, "hcatTest"); HCatInputFormat.setInput(myJob, "default", "testHCIFMethods"); HCatSchema cols = HCatInputFormat.getDataColumns(myJob.getConfiguration()); Assert.assertTrue(cols.getFields() != null); Assert.assertEquals(cols.getFields().size(), 2); Assert.assertTrue(cols.getFields().get(0).getName().equals("a")); Assert.assertTrue(cols.getFields().get(1).getName().equals("b")); Assert.assertTrue(cols.getFields().get(0).getType().equals(HCatFieldSchema.Type.STRING)); Assert.assertTrue(cols.getFields().get(1).getType().equals(HCatFieldSchema.Type.INT)); HCatSchema pcols = HCatInputFormat.getPartitionColumns(myJob.getConfiguration()); Assert.assertTrue(pcols.getFields() != null); Assert.assertEquals(pcols.getFields().size(), 2); Assert.assertTrue(pcols.getFields().get(0).getName().equals("x")); Assert.assertTrue(pcols.getFields().get(1).getName().equals("y")); Assert.assertTrue(pcols.getFields().get(0).getType().equals(HCatFieldSchema.Type.STRING)); Assert.assertTrue(pcols.getFields().get(1).getType().equals(HCatFieldSchema.Type.STRING)); }