本文整理汇总了Java中org.embulk.spi.Schema.Builder方法的典型用法代码示例。如果您正苦于以下问题:Java Schema.Builder方法的具体用法?Java Schema.Builder怎么用?Java Schema.Builder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.embulk.spi.Schema
的用法示例。
在下文中一共展示了Schema.Builder方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transaction
import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Override
public void transaction(ConfigSource config, Schema inputSchema, FilterPlugin.Control control)
{
PluginTask task = config.loadConfig(PluginTask.class);
String columnName = task.getQueryStringColumnName();
Schema.Builder builder = Schema.builder();
for (Column inputColumn : inputSchema.getColumns()) {
if (columnName.equals(inputColumn.getName())) {
insertColumns(builder, task.getExpandedColumns());
}
else {
builder.add(inputColumn.getName(), inputColumn.getType());
}
}
control.run(task.dump(), builder.build());
}
示例2: buildOutputSchema
import org.embulk.spi.Schema; //导入方法依赖的package包/类
static Schema buildOutputSchema(PluginTask task, Schema inputSchema)
{
Type jsonColumnType = jsonColumnType(task);
String jsonColumnName = task.getJsonColumn().getName();
Schema.Builder builder = Schema.builder();
int found = 0;
for (Column inputColumns : inputSchema.getColumns()) {
if (jsonColumnName.equals(inputColumns.getName())) {
builder.add(inputColumns.getName(), jsonColumnType);
found = 1;
}
else {
builder.add(inputColumns.getName(), inputColumns.getType());
}
}
if (found == 0) {
builder.add(jsonColumnName, jsonColumnType);
}
return builder.build();
}
示例3: schema
import org.embulk.spi.Schema; //导入方法依赖的package包/类
private static Schema schema(Object... nameAndTypes)
{
Schema.Builder builder = Schema.builder();
for (int i = 0; i < nameAndTypes.length; i += 2) {
builder.add((String) nameAndTypes[i], (Type) nameAndTypes[i + 1]);
}
return builder.build();
}
示例4: schema
import org.embulk.spi.Schema; //导入方法依赖的package包/类
private Schema schema(Object... nameAndTypes)
{
Schema.Builder builder = Schema.builder();
for (int i = 0; i < nameAndTypes.length; i += 2) {
builder.add((String) nameAndTypes[i], (Type) nameAndTypes[i + 1]);
}
return builder.build();
}
示例5: insertColumns
import org.embulk.spi.Schema; //导入方法依赖的package包/类
private void insertColumns(Schema.Builder builder, List<ColumnConfig> expandedColumns)
{
for (ColumnConfig columnConfig : expandedColumns) {
builder.add(columnConfig.getName(), columnConfig.getType());
}
}