use of org.embulk.spi.Column in project MiscellaneousStudy by mikoto2000.
the class MyPageOutput method transaction.
@Override
public void transaction(ConfigSource config, Schema inputSchema, FilterPlugin.Control control) {
System.out.println("transaction!");
System.out.print("config: ");
System.out.println(config);
System.out.print("inputSchema: ");
System.out.println(inputSchema);
System.out.print("control: ");
System.out.println(control);
PluginTask task = config.loadConfig(PluginTask.class);
java.util.List<Column> newSchemaColumns = inputSchema.getColumns();
Schema.Builder builder = Schema.builder();
// 連番カラムを追加
builder.add("lineNumber", Types.LONG);
for (Column column : newSchemaColumns) {
builder.add(column.getName(), column.getType());
}
// 追加文字列カラムを追加
builder.add("additional", Types.STRING);
Schema outputSchema = builder.build();
control.run(task.dump(), outputSchema);
}
Aggregations