public Object getFieldValue(_Fields field) { switch (field) { case SCHEMA_EVOLUTION_HISTORY: return getSchema_evolution_history(); } throw new IllegalStateException(); }
@Override public SchemaEvolution fromExternalToWrapperSchemaEvolution( org.apache.carbondata.format.SchemaEvolution externalSchemaEvolution) { List<SchemaEvolutionEntry> wrapperSchemaEvolEntryList = new ArrayList<SchemaEvolutionEntry>(); for (org.apache.carbondata.format.SchemaEvolutionEntry schemaEvolutionEntry : externalSchemaEvolution.getSchema_evolution_history()) { wrapperSchemaEvolEntryList .add(fromExternalToWrapperSchemaEvolutionEntry(schemaEvolutionEntry)); } SchemaEvolution wrapperSchemaEvolution = new SchemaEvolution(); wrapperSchemaEvolution.setSchemaEvolutionEntryList(wrapperSchemaEvolEntryList); return wrapperSchemaEvolution; }
@Override public TableInfo fromExternalToWrapperTableInfo( org.apache.carbondata.format.TableInfo externalTableInfo, String dbName, String tableName, String tablePath) { TableInfo wrapperTableInfo = new TableInfo(); List<org.apache.carbondata.format.SchemaEvolutionEntry> schemaEvolutionList = externalTableInfo.getFact_table().getSchema_evolution().getSchema_evolution_history(); wrapperTableInfo.setLastUpdatedTime( schemaEvolutionList.get(schemaEvolutionList.size() - 1).getTime_stamp()); wrapperTableInfo.setDatabaseName(dbName); wrapperTableInfo.setTableUniqueName(CarbonTable.buildUniqueName(dbName, tableName)); wrapperTableInfo.setFactTable( fromExternalToWrapperTableSchema(externalTableInfo.getFact_table(), tableName)); if (null != externalTableInfo.getDataMapSchemas()) { wrapperTableInfo.setDataMapSchemaList( fromExternalToWrapperChildSchemaList(externalTableInfo.getDataMapSchemas())); } wrapperTableInfo.setTablePath(tablePath); return wrapperTableInfo; }
org.apache.carbondata.format.SchemaEvolutionEntry schemaEvolutionEntry = new org.apache.carbondata.format.SchemaEvolutionEntry(tableInfo.getLastUpdatedTime()); thriftTableInfo.getFact_table().getSchema_evolution().getSchema_evolution_history() .add(schemaEvolutionEntry);