Package org.apache.hadoop.vertica

Examples of org.apache.hadoop.vertica.VerticaRecordReader


    if(!AllTests.isSetup()) {
      return;
    }

    VerticaInputSplit input = getVerticaSplit(false);
    VerticaRecordReader reader = new VerticaRecordReader(input, input
        .getConfiguration());
    TaskAttemptContext context = new TaskAttemptContextImpl(input
        .getConfiguration(), new TaskAttemptID());
    reader.initialize(input, context);

    boolean hasValue = reader.nextKeyValue();
    assertEquals("There should be a record in the database", hasValue, true);
   
    LongWritable key = reader.getCurrentKey();
    VerticaRecord value = reader.getCurrentValue();

    assertEquals("Key should be 1 for first record", key.get(), 1);
    assertEquals("Result type should be VARCHAR", ((Integer)value.getTypes().get(0)).intValue(), Types.VARCHAR);
    assertEquals("Result value should be three", value.getValues().get(0), "three");
    reader.close();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.vertica.VerticaRecordReader

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.