[cdc-common] Support adding Column directly in schema builder

This closes 
pull/2749/head
Qingsheng Ren committed by Leonard Xu
parent 51554d8630
commit 6506ba788d

@ -298,6 +298,12 @@ public class Schema implements Serializable {
return this; return this;
} }
public Builder column(Column column) {
checkColumn(column.getName(), column.getType());
columns.add(column);
return this;
}
private void checkColumn(String columnName, DataType type) { private void checkColumn(String columnName, DataType type) {
Preconditions.checkNotNull(columnName, "Column name must not be null."); Preconditions.checkNotNull(columnName, "Column name must not be null.");
Preconditions.checkNotNull(type, "Data type must not be null."); Preconditions.checkNotNull(type, "Data type must not be null.");

Loading…
Cancel
Save