@Test public void testGetSchemaFromUrlUsingHiveSchema() throws IOException, HiveException { FileSystem fs = FileSystem.getLocal(new Configuration()); String jobId = "123"; State state = new State(); state.setProp(ConfigurationKeys.JOB_ID_KEY, jobId); AvroSchemaManager asm = new AvroSchemaManager(fs, state); Partition partition = getTestPartition(new Table("testDb", "testTable")); Path schemaPath = asm.getSchemaUrl(partition); Schema actualSchema = AvroUtils.parseSchemaFromFile(schemaPath, fs); String expectedSchema = new String(Files.readAllBytes( Paths.get(getClass().getClassLoader().getResource("avroSchemaManagerTest/expectedSchema.avsc").getFile()))); Assert.assertEquals(actualSchema.toString(), expectedSchema); }
public Path getSchemaUrl(Table table) throws IOException { return getSchemaUrl(table.getTTable().getSd()); }
AvroSchemaManager { public Path getSchemaUrl(Table table) throws IOException { return getSchemaUrl(table.getTTable().getSd()); } }
AvroSchemaManager { public Path getSchemaUrl(Table table) throws IOException { return getSchemaUrl(table.getTTable().getSd()); } AvroSchemaManager(FileSystem fs, State state); }
AvroSchemaManager { public Path getSchemaUrl(Table table) throws IOException { return getSchemaUrl(table.getTTable().getSd()); } AvroSchemaManager(FileSystem fs, State state); Path getSchemaUrl(Table table); Path getSchemaUrl(Partition partition); void cleanupTempSchemas(); static Schema getSchemaFromUrl(Path schemaUrl, FileSystem fs); }
AvroSchemaManager { public Path getSchemaUrl(Table table) throws IOException { return getSchemaUrl(table.getTTable().getSd()); } AvroSchemaManager(FileSystem fs, State state); Path getSchemaUrl(Table table); Path getSchemaUrl(Partition partition); void cleanupTempSchemas(); static Schema getSchemaFromUrl(Path schemaUrl, FileSystem fs);  }