Created
June 26, 2015 02:09
-
-
Save frsyuki/54bd9a99cd0d7a2465cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<String> columnNames = task.getColumns(); | |
ImmutableList.Builder<Column> builder = ImmutableList.builder(); | |
int i = 0; | |
for (String columnName : columnNames) { | |
for (Column inputColumn: inputSchema.getColumns()) { | |
if (inputColumn.getName().equals(columnName)) { | |
Column outputColumn = new Column(i++, columnName, inputColumn.getType()); | |
builder.add(outputColumn); | |
break; | |
} | |
} | |
} | |
Schema outputSchema = new Schema(builder.build()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment