本文整理汇总了Java中org.embulk.spi.Column.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Column.getName方法的具体用法?Java Column.getName怎么用?Java Column.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.embulk.spi.Column
的用法示例。
在下文中一共展示了Column.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildOuputSchema
import org.embulk.spi.Column; //导入方法依赖的package包/类
private Schema buildOuputSchema(final PluginTask task, final Schema inputSchema)
{
List<ColumnConfig> columnConfigs = task.getColumns();
ImmutableList.Builder<Column> builder = ImmutableList.builder();
int i = 0;
for (Column inputColumn : inputSchema.getColumns()) {
String name = inputColumn.getName();
Type type = inputColumn.getType();
ColumnConfig columnConfig = getColumnConfig(name, columnConfigs);
if (columnConfig != null) {
type = columnConfig.getType();
}
Column outputColumn = new Column(i++, name, type);
builder.add(outputColumn);
}
return new Schema(builder.build());
}
示例2: longColumn
import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void longColumn(final Column inputColumn)
{
String name = inputColumn.getName();
if (! shouldCast(name)){
if (pageReader.isNull(inputColumn)) {
pageBuilder.setNull(inputColumn);
}
else {
pageBuilder.setLong(inputColumn, pageReader.getLong(inputColumn));
}
}
else {
final Column outputColumn = outputColumnMap.get(name);
PageBuildable op = new PageBuildable() {
public void run() throws DataException {
columnCaster.setFromLong(outputColumn, pageReader.getLong(inputColumn));
}
};
withStopOnInvalidRecord(op, inputColumn, outputColumn);
}
}
示例3: doubleColumn
import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void doubleColumn(final Column inputColumn)
{
String name = inputColumn.getName();
if (! shouldCast(name)){
if (pageReader.isNull(inputColumn)) {
pageBuilder.setNull(inputColumn);
}
else {
pageBuilder.setDouble(inputColumn, pageReader.getDouble(inputColumn));
}
}
else {
final Column outputColumn = outputColumnMap.get(inputColumn.getName());
PageBuildable op = new PageBuildable() {
public void run() throws DataException {
columnCaster.setFromDouble(outputColumn, pageReader.getDouble(inputColumn));
}
};
withStopOnInvalidRecord(op, inputColumn, outputColumn);
}
}
示例4: stringColumn
import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void stringColumn(final Column inputColumn)
{
String name = inputColumn.getName();
if (! shouldCast(name)){
if (pageReader.isNull(inputColumn)) {
pageBuilder.setNull(inputColumn);
}
else {
pageBuilder.setString(inputColumn, pageReader.getString(inputColumn));
}
}
else {
final Column outputColumn = outputColumnMap.get(inputColumn.getName());
PageBuildable op = new PageBuildable() {
public void run() throws DataException {
columnCaster.setFromString(outputColumn, pageReader.getString(inputColumn));
}
};
withStopOnInvalidRecord(op, inputColumn, outputColumn);
}
}
示例5: timestampColumn
import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void timestampColumn(final Column inputColumn)
{
String name = inputColumn.getName();
if (! shouldCast(name)){
if (pageReader.isNull(inputColumn)) {
pageBuilder.setNull(inputColumn);
}
else {
pageBuilder.setTimestamp(inputColumn, pageReader.getTimestamp(inputColumn));
}
}
else {
final Column outputColumn = outputColumnMap.get(inputColumn.getName());
PageBuildable op = new PageBuildable() {
public void run() throws DataException {
columnCaster.setFromTimestamp(outputColumn, pageReader.getTimestamp(inputColumn));
}
};
withStopOnInvalidRecord(op, inputColumn, outputColumn);
}
}
示例6: jsonColumn
import org.embulk.spi.Column; //导入方法依赖的package包/类
@Override
public void jsonColumn(final Column inputColumn)
{
String name = inputColumn.getName();
if (! shouldCast(name)){
if (pageReader.isNull(inputColumn)) {
pageBuilder.setNull(inputColumn);
}
else {
pageBuilder.setJson(inputColumn, pageReader.getJson(inputColumn));
}
}
else {
final Column outputColumn = outputColumnMap.get(inputColumn.getName());
PageBuildable op = new PageBuildable() {
public void run() throws DataException {
columnCaster.setFromJson(outputColumn, pageReader.getJson(inputColumn));
}
};
withStopOnInvalidRecord(op, inputColumn, outputColumn);
}
}
示例7: buildOutputSchema
import org.embulk.spi.Column; //导入方法依赖的package包/类
/**
* @param task
* @param inputSchema
* @return
*/
private Schema buildOutputSchema(PluginTask task, Schema inputSchema) {
ImmutableList.Builder<Column> builder = ImmutableList.builder();
int i = 0;
for (Column inputColumn: inputSchema.getColumns()) {
Column outputColumn = new Column(i++, inputColumn.getName(), inputColumn.getType());
builder.add(outputColumn);
}
for (String keyName : task.getKeyNames()) {
builder.add(new Column(i++, keyName + task.getOutKeyNameSuffix(), Types.STRING));
}
Schema outputSchema = new Schema(builder.build());
return outputSchema;
}
开发者ID:toyama0919,项目名称:embulk-filter-google_translate_api,代码行数:19,代码来源:GoogleTranslateApiFilterPlugin.java