class TableSchemaUtils {

	public static TableSchema projectSchema(TableSchema tableSchema, int[][] projectedFields) {
		checkArgument(!containsGeneratedColumns(tableSchema), "It's illegal to project on a schema contains computed columns.");
		TableSchema.Builder schemaBuilder = TableSchema.builder();
		List<TableColumn> tableColumns = tableSchema.getTableColumns();
		for (int[] fieldPath : projectedFields) {
			checkArgument(fieldPath.length == 1, "Nested projection push down is not supported yet.");
			TableColumn column = tableColumns.get(fieldPath[0]);
			schemaBuilder.field(column.getName(), column.getType());
		}
		return schemaBuilder.build();
	}

}