/** * Gets the cols. * * @return the cols */ @Deprecated // @deprecated in favour of {@link HCatTable.#getCols()}. To be removed in Hive 0.16. public List<HCatFieldSchema> getCols() { return this.hcatTable.getCols(); }
@Test public void testUpdateTableSchema() throws Exception { try { HCatClient client = HCatClient.create(new Configuration(hcatConf)); final String dbName = "testUpdateTableSchema_DBName"; final String tableName = "testUpdateTableSchema_TableName"; client.dropDatabase(dbName, true, HCatClient.DropDBMode.CASCADE); client.createDatabase(HCatCreateDBDesc.create(dbName).build()); List<HCatFieldSchema> oldSchema = Arrays.asList(new HCatFieldSchema("foo", Type.INT, ""), new HCatFieldSchema("bar", Type.STRING, "")); client.createTable(HCatCreateTableDesc.create(dbName, tableName, oldSchema).build()); List<HCatFieldSchema> newSchema = Arrays.asList(new HCatFieldSchema("completely", Type.DOUBLE, ""), new HCatFieldSchema("new", Type.STRING, ""), new HCatFieldSchema("fields", Type.STRING, "")); client.updateTableSchema(dbName, tableName, newSchema); assertArrayEquals(newSchema.toArray(), client.getTable(dbName, tableName).getCols().toArray()); client.dropDatabase(dbName, false, HCatClient.DropDBMode.CASCADE); } catch (Exception exception) { LOG.error("Unexpected exception.", exception); assertTrue("Unexpected exception: " + exception.getMessage(), false); } }
assertEquals("Column schema doesn't match.", sourceTable.getCols(), addedPartition_1.getColumns()); assertEquals("InputFormat doesn't match.", sourceTable.getInputFileFormat(), addedPartition_1.getInputFormat()); assertEquals("OutputFormat doesn't match.", sourceTable.getOutputFileFormat(), addedPartition_1.getOutputFormat());
assertEquals("Column schema doesn't match.", sourceTable.getCols(), addedPartition_1.getColumns()); assertEquals("InputFormat doesn't match.", sourceTable.getInputFileFormat(), addedPartition_1.getInputFormat()); assertEquals("OutputFormat doesn't match.", sourceTable.getOutputFileFormat(), addedPartition_1.getOutputFormat());
/** * Gets the cols. * * @return the cols */ @Deprecated // @deprecated in favour of {@link HCatTable.#getCols()}. To be removed in Hive 0.16. public List<HCatFieldSchema> getCols() { return this.hcatTable.getCols(); }
/** * Gets the cols. * * @return the cols */ @Deprecated // @deprecated in favour of {@link HCatTable.#getCols()}. To be removed in Hive 0.16. public List<HCatFieldSchema> getCols() { return this.hcatTable.getCols(); }
/** * Gets the cols. * * @return the cols */ @Deprecated // @deprecated in favour of {@link HCatTable.#getCols()}. To be removed in Hive 0.16. public List<HCatFieldSchema> getCols() { return this.hcatTable.getCols(); }
TableDataBuilder(HCatTable table) { schema = new HCatSchema(ImmutableList .<HCatFieldSchema> builder() .addAll(table.getCols()) .addAll(table.getPartCols()) .build()); partitionColumns = table.getPartCols(); withAllColumns(); }
TableDataBuilder(HCatTable table) { schema = new HCatSchema(ImmutableList .<HCatFieldSchema> builder() .addAll(table.getCols()) .addAll(table.getPartCols()) .build()); partitionColumns = table.getPartCols(); withAllColumns(); }