Sha256: 4007376c19f945ee17347c06c65a1230a1a808c5f31069e2f7bf5dafa020f930
Contents?: true
Size: 1.44 KB
Versions: 2
Compression:
Stored size: 1.44 KB
Contents
package org.embulk.parser.avro.getter; import org.embulk.spi.Column; import org.embulk.spi.PageBuilder; import org.embulk.spi.time.Timestamp; import org.embulk.spi.time.TimestampParser; public class IntegerColumnGetter extends BaseColumnGetter { protected Integer value; public IntegerColumnGetter(PageBuilder pageBuilder, TimestampParser[] timestampParsers) { super(pageBuilder, timestampParsers); } @Override public void setValue(Object value) { this.value = (Integer) value; } @Override public void longColumn(Column column) { if (value == null) { pageBuilder.setNull(column); } else { pageBuilder.setLong(column, value.longValue()); } } @Override public void doubleColumn(Column column) { if (value == null) { pageBuilder.setNull(column); } else { pageBuilder.setDouble(column, value.doubleValue()); } } @Override public void stringColumn(Column column) { if (value == null) { pageBuilder.setNull(column); } else { pageBuilder.setString(column, value.toString()); } } @Override public void timestampColumn(Column column) { if (this.value == null) { pageBuilder.setNull(column); } else { pageBuilder.setTimestamp(column, Timestamp.ofEpochSecond(value.longValue())); } } }
Version data entries
2 entries across 2 versions & 1 rubygems