当前位置: 首页>>代码示例>>Java>>正文


Java Schema.getColumn方法代码示例

本文整理汇总了Java中org.embulk.spi.Schema.getColumn方法的典型用法代码示例。如果您正苦于以下问题:Java Schema.getColumn方法的具体用法?Java Schema.getColumn怎么用?Java Schema.getColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.embulk.spi.Schema的用法示例。


在下文中一共展示了Schema.getColumn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildOutputSchema_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchema_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: _id}");
    Schema inputSchema = Schema.builder()
            .add("_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(1, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:21,代码来源:TestBase58FilterPlugin.java

示例2: buildOutputSchemaDecode_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchemaDecode_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: public_id, encode: false}");
    Schema inputSchema = Schema.builder()
            .add("public_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(1, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("public_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:21,代码来源:TestBase58FilterPlugin.java

示例3: buildOutputSchemaPrefix_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchemaPrefix_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: _id, prefix: obj_}");
    Schema inputSchema = Schema.builder()
            .add("_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(1, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:21,代码来源:TestBase58FilterPlugin.java

示例4: buildOutputSchemaDecodePrefix_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchemaDecodePrefix_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: public_id, encode: false, prefix: obj_}");
    Schema inputSchema = Schema.builder()
            .add("public_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(1, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("public_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:21,代码来源:TestBase58FilterPlugin.java

示例5: buildOutputSchemaPrefixNewColumn_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchemaPrefixNewColumn_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: _id, prefix: obj_, new_name: public_id}");
    Schema inputSchema = Schema.builder()
            .add("_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(2, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("_id", column.getName());
        column = outputSchema.getColumn(1);
        assertEquals("public_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:23,代码来源:TestBase58FilterPlugin.java

示例6: buildOutputSchemaDecodePrefixNewColumn_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchemaDecodePrefixNewColumn_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: base58",
            "columns:",
            "  - {name: public_id, encode: false, prefix: obj_, new_name: _id}");
    Schema inputSchema = Schema.builder()
            .add("public_id", STRING)
            .build();

    Schema outputSchema = plugin.buildOutputSchema(task, inputSchema);
    assertEquals(2, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("public_id", column.getName());
        column = outputSchema.getColumn(1);
        assertEquals("_id", column.getName());
    }
}
 
开发者ID:kfitzgerald,项目名称:embulk-filter-base58,代码行数:23,代码来源:TestBase58FilterPlugin.java

示例7: buildOutputSchema_Columns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchema_Columns()
{
    PluginTask task = taskFromYamlString(
            "type: column",
            "columns:",
            "  - {name: timestamp}",
            "  - {name: string}",
            "  - {name: boolean}",
            "  - {name: long}",
            "  - {name: double}",
            "  - {name: json}");
    Schema inputSchema = Schema.builder()
            .add("timestamp", TIMESTAMP)
            .add("string", STRING)
            .add("boolean", BOOLEAN)
            .add("long", LONG)
            .add("double", DOUBLE)
            .add("json", JSON)
            .add("remove_me", STRING)
            .build();

    Schema outputSchema = ColumnFilterPlugin.buildOutputSchema(task, inputSchema);
    assertEquals(6, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("timestamp", column.getName());
    }
}
 
开发者ID:sonots,项目名称:embulk-filter-column,代码行数:32,代码来源:TestColumnFilterPlugin.java

示例8: buildOutputSchema_DropColumns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchema_DropColumns()
{
    PluginTask task = taskFromYamlString(
            "type: column",
            "drop_columns:",
            "  - {name: timestamp}",
            "  - {name: string}",
            "  - {name: boolean}",
            "  - {name: long}",
            "  - {name: double}",
            "  - {name: json}");
    Schema inputSchema = Schema.builder()
            .add("timestamp", TIMESTAMP)
            .add("string", STRING)
            .add("boolean", BOOLEAN)
            .add("long", LONG)
            .add("double", DOUBLE)
            .add("json", JSON)
            .add("keep_me", STRING)
            .build();

    Schema outputSchema = ColumnFilterPlugin.buildOutputSchema(task, inputSchema);
    assertEquals(1, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("keep_me", column.getName());
    }
}
 
开发者ID:sonots,项目名称:embulk-filter-column,代码行数:32,代码来源:TestColumnFilterPlugin.java

示例9: buildOutputSchema_AddColumns

import org.embulk.spi.Schema; //导入方法依赖的package包/类
@Test
public void buildOutputSchema_AddColumns()
{
    PluginTask task = taskFromYamlString(
            "type: column",
            "add_columns:",
            "  - {name: timestamp, type: timestamp, default: 2015-07-13, format: \"%Y-%m-%d\", timezone: UTC}",
            "  - {name: string, type: string, default: string}",
            "  - {name: boolean, type: boolean, default: true}",
            "  - {name: long, type: long, default: 0}",
            "  - {name: double, type: double, default: 0.5}",
            "  - {name: json, type: json, default: \"{\\\"foo\\\":\\\"bar\\\"}\" }");
    Schema inputSchema = Schema.builder()
            .add("keep_me", STRING)
            .build();

    Schema outputSchema = ColumnFilterPlugin.buildOutputSchema(task, inputSchema);
    assertEquals(7, outputSchema.size());

    Column column;
    {
        column = outputSchema.getColumn(0);
        assertEquals("keep_me", column.getName());
    }
    {
        column = outputSchema.getColumn(1);
        assertEquals("timestamp", column.getName());
    }
}
 
开发者ID:sonots,项目名称:embulk-filter-column,代码行数:30,代码来源:TestColumnFilterPlugin.java


注:本文中的org.embulk.spi.Schema.getColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。