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


Java Column.getIndex方法代码示例

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


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

示例1: longColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void longColumn(Column column)
{
    if (isNil(value)) {
        pageBuilder.setNull(column);
    }
    else {
        try {
            long longValue = autoTypecasts[column.getIndex()] ? ColumnCaster.asLong(newInteger(value.asLong())) : value.asLong();
            pageBuilder.setLong(column, longValue);
        }
        catch (MessageTypeException e) {
            throw new JsonRecordValidateException(format("failed to get \"%s\" as Long", value), e);
        }
    }
}
 
开发者ID:hiroyuki-sato,项目名称:embulk-parser-jsonpath,代码行数:17,代码来源:ColumnVisitorImpl.java

示例2: doubleColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void doubleColumn(Column column)
{
    if (isNil(value)) {
        pageBuilder.setNull(column);
    }
    else {
        try {
            double doubleValue = autoTypecasts[column.getIndex()] ? ColumnCaster.asDouble(newFloat(value.asDouble())) : value.asDouble();
            pageBuilder.setDouble(column, doubleValue);
        }
        catch (MessageTypeException e) {
            throw new JsonRecordValidateException(format("failed get \"%s\" as Double", value), e);
        }
    }
}
 
开发者ID:hiroyuki-sato,项目名称:embulk-parser-jsonpath,代码行数:17,代码来源:ColumnVisitorImpl.java

示例3: stringColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void stringColumn(Column column)
{
    if (isNil(value)) {
        pageBuilder.setNull(column);
    }
    else {
        final String stringValue = valueAsString();
        try {
            String string = autoTypecasts[column.getIndex()] ? ColumnCaster.asString(newString(stringValue)) : stringValue;
            pageBuilder.setString(column, string);
        }
        catch (MessageTypeException e) {
            throw new JsonRecordValidateException(format("failed to get \"%s\" as String", value), e);
        }
    }
}
 
开发者ID:hiroyuki-sato,项目名称:embulk-parser-jsonpath,代码行数:18,代码来源:ColumnVisitorImpl.java

示例4: booleanColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void booleanColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    Boolean value = pageReader.getBoolean(column);
    Object result = converter.booleanColumn(value);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:12,代码来源:AvroFormatterColumnVisitor.java

示例5: longColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void longColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    Long value = pageReader.getLong(column);
    Object result = converter.longColumn(value);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:12,代码来源:AvroFormatterColumnVisitor.java

示例6: doubleColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void doubleColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    Double value = pageReader.getDouble(column);
    Object result = converter.doubleColumn(value);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:12,代码来源:AvroFormatterColumnVisitor.java

示例7: stringColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void stringColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    String value = pageReader.getString(column);
    Object result = converter.stringColumn(value);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:12,代码来源:AvroFormatterColumnVisitor.java

示例8: timestampColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    Timestamp value = pageReader.getTimestamp(column);
    String formatted = timestampFormatters[column.getIndex()].format(value);
    Object result = converter.timestampColumn(formatted);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:13,代码来源:AvroFormatterColumnVisitor.java

示例9: jsonColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void jsonColumn(Column column) {
    if (pageReader.isNull(column))
        return;
    AbstractAvroValueConverter converter = avroValueConverters[column.getIndex()];
    if (converter == null)
        return;
    Value value = pageReader.getJson(column);
    Object result = converter.jsonColumn(value);
    record.put(column.getName(), result);
}
 
开发者ID:joker1007,项目名称:embulk-formatter-avro,代码行数:12,代码来源:AvroFormatterColumnVisitor.java

示例10: timestampColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(Column column) {
    Value columnName = ValueFactory.newString(column.getName());
    TimestampFormatter formatter = timestampFormatters[column.getIndex()];
    Value value = ValueFactory.newString(formatter.format(reader.getTimestamp(column)));
    builder.put(columnName, value);
}
 
开发者ID:tomykaira,项目名称:embulk-output-s3_per_record,代码行数:8,代码来源:MessagePackMultiColumnVisitor.java

示例11: timestampColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(Column column) {
    Timestamp value = reader.getTimestamp(column);
    TimestampFormatter formatter = timestampFormatters[column.getIndex()];
    try {
        packer.packString(formatter.format(value));
    } catch (IOException e) {
        throw new RuntimeException("cannot write to msgpack");
    }
}
 
开发者ID:tomykaira,项目名称:embulk-output-s3_per_record,代码行数:11,代码来源:MessagePackSingleColumnVisitor.java

示例12: timestampColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(Column column) {
    if (this.value == null) {
        pageBuilder.setNull(column);
    }
    else {
        TimestampParser parser = timestampParsers[column.getIndex()];
        pageBuilder.setTimestamp(column, parser.parse(value));
    }
}
 
开发者ID:joker1007,项目名称:embulk-parser-avro,代码行数:11,代码来源:StringColumnGetter.java

示例13: booleanColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void booleanColumn(Column column)
{
    if (isNil(value)) {
        pageBuilder.setNull(column);
        return;
    }

    final boolean val;
    if (value.isBoolean()) {
        val = value.asBoolean();
    }
    else {
        String stringValue = valueAsString().toLowerCase();
        if (BOOL_TRUE_STRINGS.contains(stringValue)) {
            val = true;
        }
        else if (BOOL_FALSE_STRINGS.contains(stringValue)) {
            val = false;
        }
        else {
            throw new JsonRecordValidateException(format("can not convert '%s' to Boolean", value));
        }
    }

    try {
        boolean booleanValue = autoTypecasts[column.getIndex()] ? ColumnCaster.asBoolean(newBoolean(val)) : val;
        pageBuilder.setBoolean(column, booleanValue);
    }
    catch (MessageTypeException e) {
        throw new JsonRecordValidateException(format("failed to get \"%s\" as Boolean", value), e);
    }
}
 
开发者ID:hiroyuki-sato,项目名称:embulk-parser-jsonpath,代码行数:34,代码来源:ColumnVisitorImpl.java

示例14: timestampColumn

import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(Column column) {
    Timestamp value = reader.getTimestamp(column);
    TimestampFormatter formatter = timestampFormatters[column.getIndex()];
    sb.append(ValueFactory.newString(formatter.format(value)).toJson());
}
 
开发者ID:tomykaira,项目名称:embulk-output-s3_per_record,代码行数:7,代码来源:JsonSingleColumnVisitor.java


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