@Test public void testOrcSchemaLiteral() throws IOException { State state = new State(); HiveOrcSerDeManager manager = new HiveOrcSerDeManager(state); HiveRegistrationUnit registrationUnit = (new HiveTable.Builder()).withDbName(TEST_DB).withTableName(TEST_TABLE).build(); manager.addSerDeProperties(this.testRegisterPath, registrationUnit); List<String> columns = Arrays.asList(registrationUnit.getSerDeProps().getProp(serdeConstants.LIST_COLUMNS).split(",")); Assert.assertTrue(columns.get(0).equals("name")); Assert.assertTrue(columns.get(1).equals("timestamp")); List<String> columnTypes = Arrays.asList(registrationUnit.getSerDeProps().getProp(serdeConstants.LIST_COLUMN_TYPES).split(",")); Assert.assertTrue(columnTypes.get(0).equals("string")); Assert.assertTrue(columnTypes.get(1).equals("bigint")); }
@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; }