use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column in project SpinalTap by airbnb.
the class Table method toThriftTable.
public static com.airbnb.jitney.event.spinaltap.v1.Table toThriftTable(Table table) {
Set<String> primaryKey = ImmutableSet.of();
if (table.getPrimaryKey().isPresent()) {
primaryKey = ImmutableSet.copyOf(table.getPrimaryKey().get().getColumns().values().stream().map(ColumnMetadata::getName).sorted().collect(Collectors.toList()));
}
Map<String, Column> columns = table.getColumns().values().stream().map(c -> {
com.airbnb.jitney.event.spinaltap.v1.Column column = new com.airbnb.jitney.event.spinaltap.v1.Column(c.getColType().getCode(), c.isPrimaryKey(), c.getName());
column.setPosition(c.getPosition());
return column;
}).collect(Collectors.toMap(c -> c.getName(), c -> c));
com.airbnb.jitney.event.spinaltap.v1.Table thriftTable = new com.airbnb.jitney.event.spinaltap.v1.Table(table.getId(), table.getName(), table.getDatabase(), primaryKey, columns);
if (!Strings.isNullOrEmpty(table.getOverridingDatabase())) {
thriftTable.setOverridingDatabase(table.getOverridingDatabase());
}
return thriftTable;
}
Aggregations