Package org.apache.sqoop.common

Examples of org.apache.sqoop.common.MutableContext


    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.tableName = tableName;
    jobConf.table.columns = tableColumns;

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcExportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here


    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.sql = tableSql;

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcExportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here

  public void tearDown() {
    executor.close();
  }

  public void testQuery() throws Exception {
    MutableContext context = new MutableMapContext();
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_DRIVER,
        GenericJdbcTestConstants.DRIVER);
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_URL,
        GenericJdbcTestConstants.URL);
    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL,
        "SELECT * FROM " + executor.delimitIdentifier(tableName)
            + " WHERE ${CONDITIONS}");

    ConnectionConfiguration connConf = new ConnectionConfiguration();
    ImportJobConfiguration jobConf = new ImportJobConfiguration();
View Full Code Here

    partition.setConditions("16.666666666666667 <= DCOL AND DCOL <= 50.0");
    extractor.run(context, connConf, jobConf, partition, writer);
  }

  public void testSubquery() throws Exception {
    MutableContext context = new MutableMapContext();
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_DRIVER,
        GenericJdbcTestConstants.DRIVER);
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_URL,
        GenericJdbcTestConstants.URL);
    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL,
        "SELECT SQOOP_SUBQUERY_ALIAS.ICOL,SQOOP_SUBQUERY_ALIAS.VCOL FROM "
            + "(SELECT * FROM " + executor.delimitIdentifier(tableName)
            + " WHERE ${CONDITIONS}) SQOOP_SUBQUERY_ALIAS");

    ConnectionConfiguration connConf = new ConnectionConfiguration();
View Full Code Here

  public void tearDown() {
    executor.close();
  }

  public void testInsert() throws Exception {
    MutableContext context = new MutableMapContext();

    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_DRIVER,
        GenericJdbcTestConstants.DRIVER);
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_URL,
        GenericJdbcTestConstants.URL);
    context.setString(GenericJdbcConnectorConstants.CONNECTOR_JDBC_DATA_SQL,
        "INSERT INTO " + executor.delimitIdentifier(tableName)
            + " VALUES (?,?,?)");

    Loader loader = new GenericJdbcExportLoader();
    DummyReader reader = new DummyReader();
View Full Code Here

    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.tableName = tableName;

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcImportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here

    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.tableName = tableName;
    jobConf.table.columns = tableColumns;

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcImportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here

    connConf.connection.jdbcDriver = GenericJdbcTestConstants.DRIVER;
    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.sql = tableSql;
    jobConf.table.partitionColumn = "DCOL";

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcImportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here

    connConf.connection.connectionString = GenericJdbcTestConstants.URL;
    jobConf.table.sql = tableSql;
    jobConf.table.columns = tableColumns;
    jobConf.table.partitionColumn = "DCOL";

    MutableContext context = new MutableMapContext();

    Initializer initializer = new GenericJdbcImportInitializer();
    initializer.initialize(context, connConf, jobConf);

    verifyResult(context,
View Full Code Here

  private static final int START = -5;
  private static final int NUMBER_OF_ROWS = 11;

  public void testIntegerEvenPartition() throws Exception {
    MutableContext context = new MutableMapContext();
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNNAME,
        "ICOL");
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_COLUMNTYPE,
        String.valueOf(Types.INTEGER));
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MINVALUE,
        String.valueOf(START));
    context.setString(
        GenericJdbcConnectorConstants.CONNECTOR_JDBC_PARTITION_MAXVALUE,
        String.valueOf(START + NUMBER_OF_ROWS - 1));

    ConnectionConfiguration connConf = new ConnectionConfiguration();
    ImportJobConfiguration jobConf = new ImportJobConfiguration();
View Full Code Here

TOP

Related Classes of org.apache.sqoop.common.MutableContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.