reader.getCurrentRow(cols); cols.resetValid(8); Object row = serDe.deserialize(cols);
reader.next(rowID); BytesRefArrayWritable cols = new BytesRefArrayWritable(); reader.getCurrentRow(cols); cols.resetValid(8); Object row = serDe.deserialize(cols);
reader.getCurrentRow(cols); cols.resetValid(8);
BytesRefArrayWritable rowBatchBytes = new BytesRefArrayWritable(); rowBatchBytes.resetValid(columns.size()); reader.getCurrentRow(rowBatchBytes);
addPartitionCols = false; in.getCurrentRow(colsCache);
BytesRefArrayWritable rowBatchBytes = new BytesRefArrayWritable(); rowBatchBytes.resetValid(columns.size()); reader.getCurrentRow(rowBatchBytes);
@Override public boolean nextKeyValue() throws IOException, InterruptedException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean next(LongWritable key, BytesRefArrayWritable value) throws IOException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean next(LongWritable key, BytesRefArrayWritable value) throws IOException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); cols.resetValid(8); Object row = serDe.deserialize(cols);
BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); boolean ok = true; if (chechCorrect) {
public int performRCFileReadFirstColumnTest(FileSystem fs, Path file, int allColumnsNumber, boolean chechCorrect) throws IOException { byte[][] checkBytes = null; BytesRefArrayWritable checkRow = new BytesRefArrayWritable(allColumnsNumber); if (chechCorrect) { resetRandomGenerators(); checkBytes = new byte[allColumnsNumber][]; } int actualReadCount = 0; java.util.ArrayList<Integer> readCols = new java.util.ArrayList<Integer>(); readCols.add(Integer.valueOf(0)); ColumnProjectionUtils.appendReadColumns(conf, readCols); RCFile.Reader reader = new RCFile.Reader(fs, file, conf); LongWritable rowID = new LongWritable(); BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); boolean ok = true; if (chechCorrect) { nextRandomRow(checkBytes, checkRow); ok = ok && (checkRow.get(0).equals(cols.get(0))); } if (!ok) { throw new IllegalStateException("Compare read and write error."); } actualReadCount++; } return actualReadCount; }
public int performRCFileFullyReadColumnTest(FileSystem fs, Path file, int allColumnsNumber, boolean chechCorrect) throws IOException { byte[][] checkBytes = null; BytesRefArrayWritable checkRow = new BytesRefArrayWritable(allColumnsNumber); if (chechCorrect) { resetRandomGenerators(); checkBytes = new byte[allColumnsNumber][]; } int actualReadCount = 0; ColumnProjectionUtils.setReadAllColumns(conf); RCFile.Reader reader = new RCFile.Reader(fs, file, conf); LongWritable rowID = new LongWritable(); BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); boolean ok = true; if (chechCorrect) { nextRandomRow(checkBytes, checkRow); ok = ok && checkRow.equals(cols); } if (!ok) { throw new IllegalStateException("Compare read and write error."); } actualReadCount++; } return actualReadCount; }
@Test public void testReadOldFileHeader() throws IOException { String[] row = new String[]{"Tester", "Bart", "333 X St.", "Reno", "NV", "USA"}; RCFile.Reader reader = new RCFile.Reader(fs, new Path(HiveTestUtils.getFileFromClasspath("rc-file-v0.rc")), conf); LongWritable rowID = new LongWritable(); BytesRefArrayWritable cols = new BytesRefArrayWritable(); assertTrue("old file reader first row", reader.next(rowID)); reader.getCurrentRow(cols); assertEquals(row.length, cols.size()); for (int i=0; i < cols.size(); ++i) { assertEquals(row[i], new String(cols.get(i).getBytesCopy())); } assertFalse("old file reader end", reader.next(rowID)); reader.close(); }
@Override public boolean next(LongWritable key, BytesRefArrayWritable value) throws IOException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean next(LongWritable key, BytesRefArrayWritable value) throws IOException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }
@Override public boolean nextKeyValue() throws IOException, InterruptedException { more = next(key); if (more) { in.getCurrentRow(value); } return more; }