Sha256: 95c7d838f3d1e5bd3ed29eb10321613d79d52483fdb8173de5dc0cb7a3894a83

Contents?: true

Size: 1.32 KB

Versions: 10

Compression:

Stored size: 1.32 KB

Contents

package org.embulk.input.redshift.getter;

import org.embulk.input.jdbc.AbstractJdbcInputPlugin.PluginTask;
import org.embulk.input.jdbc.JdbcColumn;
import org.embulk.input.jdbc.JdbcColumnOption;
import org.embulk.input.jdbc.JdbcInputConnection;
import org.embulk.input.jdbc.getter.ColumnGetter;
import org.embulk.input.jdbc.getter.ColumnGetterFactory;
import org.embulk.input.jdbc.getter.TimestampWithTimeZoneIncrementalHandler;
import org.embulk.input.jdbc.getter.TimestampWithoutTimeZoneIncrementalHandler;
import org.embulk.spi.PageBuilder;
import org.joda.time.DateTimeZone;

public class RedshiftColumnGetterFactory extends ColumnGetterFactory
{
    public RedshiftColumnGetterFactory(PageBuilder to, DateTimeZone defaultTimeZone)
    {
        super(to, defaultTimeZone);
    }

    @Override
    public ColumnGetter newColumnGetter(JdbcInputConnection con, PluginTask task, JdbcColumn column, JdbcColumnOption option)
    {
        ColumnGetter getter = super.newColumnGetter(con, task, column, option);

        // incremental loading wrapper
        switch (column.getTypeName()) {
        case "timestamptz":
            return new TimestampWithTimeZoneIncrementalHandler(getter);
        case "timestamp":
            return new TimestampWithoutTimeZoneIncrementalHandler(getter);
        default:
            return getter;
        }
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
embulk-input-redshift-0.10.1 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.10.0 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.9.3 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.9.2 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.9.1 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.9.0 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.8.6 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.8.5 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.8.4 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java
embulk-input-redshift-0.8.3 src/main/java/org/embulk/input/redshift/getter/RedshiftColumnGetterFactory.java