@Test public void testCustomSerdeConfig() throws IOException { State state = new State(); state.setProp(HiveOrcSerDeManager.SERDE_TYPE_KEY, OrcSerde.class.getName()); state.setProp(HiveOrcSerDeManager.INPUT_FORMAT_CLASS_KEY, "customInputFormat"); state.setProp(HiveOrcSerDeManager.OUTPUT_FORMAT_CLASS_KEY, "customOutputFormat"); HiveOrcSerDeManager manager = new HiveOrcSerDeManager(state); HiveRegistrationUnit registrationUnit = (new HiveTable.Builder()).withDbName(TEST_DB).withTableName(TEST_TABLE).build(); manager.addSerDeProperties(this.testRegisterPath, registrationUnit); examineSchema(registrationUnit); Assert.assertEquals(registrationUnit.getSerDeType().get(), OrcSerde.class.getName()); Assert.assertEquals(registrationUnit.getInputFormat().get(), "customInputFormat"); Assert.assertEquals(registrationUnit.getOutputFormat().get(), "customOutputFormat"); }
@Override public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException { hiveUnit.setSerDeType(this.serDeWrapper.getSerDe().getClass().getName()); hiveUnit.setInputFormat(this.serDeWrapper.getInputFormatClassName()); hiveUnit.setOutputFormat(this.serDeWrapper.getOutputFormatClassName()); addSchemaProperties(path, hiveUnit); }
HiveOrcSerDeManager extends HiveSerDeManager { @Override public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException { hiveUnit.setSerDeType(this.serDeWrapper.getSerDe().getClass().getName()); hiveUnit.setInputFormat(this.serDeWrapper.getInputFormatClassName()); hiveUnit.setOutputFormat(this.serDeWrapper.getOutputFormatClassName()); addSchemaProperties(path, hiveUnit); } }
HiveOrcSerDeManager extends HiveSerDeManager { @Override public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException { hiveUnit.setSerDeType(this.serDeWrapper.getSerDe().getClass().getName()); hiveUnit.setInputFormat(this.serDeWrapper.getInputFormatClassName()); hiveUnit.setOutputFormat(this.serDeWrapper.getOutputFormatClassName()); addSchemaProperties(path, hiveUnit); } HiveOrcSerDeManager(State props); }
HiveOrcSerDeManager extends HiveSerDeManager { @Override public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException { hiveUnit.setSerDeType(this.serDeWrapper.getSerDe().getClass().getName()); hiveUnit.setInputFormat(this.serDeWrapper.getInputFormatClassName()); hiveUnit.setOutputFormat(this.serDeWrapper.getOutputFormatClassName()); addSchemaProperties(path, hiveUnit); } HiveOrcSerDeManager(State props); @Override //Using LIST_COLUMNS and LIST_COLUMN_TYPES to compare schema boolean haveSameSchema(HiveRegistrationUnit unit1, HiveRegistrationUnit unit2); @Override void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit); @Override void addSerDeProperties(HiveRegistrationUnit source, HiveRegistrationUnit target); @Override void updateSchema(HiveRegistrationUnit existingUnit, HiveRegistrationUnit newUnit); TypeInfo getSchemaFromLatestFile(Path path, FileSystem fs); }
HiveOrcSerDeManager extends HiveSerDeManager { @Override public void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit) throws IOException { hiveUnit.setSerDeType(this.serDeWrapper.getSerDe().getClass().getName()); hiveUnit.setInputFormat(this.serDeWrapper.getInputFormatClassName()); hiveUnit.setOutputFormat(this.serDeWrapper.getOutputFormatClassName()); addSchemaProperties(path, hiveUnit); } HiveOrcSerDeManager(State props); @Override //Using LIST_COLUMNS and LIST_COLUMN_TYPES to compare schema boolean haveSameSchema(HiveRegistrationUnit unit1, HiveRegistrationUnit unit2); @Override void addSerDeProperties(Path path, HiveRegistrationUnit hiveUnit); @Override void addSerDeProperties(HiveRegistrationUnit source, HiveRegistrationUnit target); @Override void updateSchema(HiveRegistrationUnit existingUnit, HiveRegistrationUnit newUnit); TypeInfo getSchemaFromLatestFile(Path path, FileSystem fs); static final String FILE_EXTENSIONS_KEY; static final String DEFAULT_FILE_EXTENSIONS; static final String IGNORED_FILE_PREFIXES_KEY; static final String DEFAULT_IGNORED_FILE_PREFIXES; static final String SERDE_TYPE_KEY; static final String DEFAULT_SERDE_TYPE; static final String INPUT_FORMAT_CLASS_KEY; static final String DEFAULT_INPUT_FORMAT_CLASS; static final String OUTPUT_FORMAT_CLASS_KEY; static final String DEFAULT_OUTPUT_FORMAT_CLASS; static final String HIVE_SPEC_SCHEMA_READING_TIMER; static final String ENABLED_ORC_TYPE_CHECK; static final boolean DEFAULT_ENABLED_ORC_TYPE_CHECK; }