BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); cols.resetValid(8);
reader.next(rowID); BytesRefArrayWritable cols = new BytesRefArrayWritable(); reader.getCurrentRow(cols);
boolean more = reader.next(rowID); if (!more) { break;
protected boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } long lastSeenSyncPos = in.lastSeenSyncPos(); if (lastSeenSyncPos >= end) { more = false; return more; } return more; }
protected boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); long lastSeenSyncPos = in.lastSeenSyncPos(); if (lastSeenSyncPos >= end) { if(useCache) { syncCache.put(split, lastSeenSyncPos); } more = false; return more; } return more; }
private boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } if (in.lastSeenSyncPos() >= end) { more = false; return more; } return more; }
private boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } if (in.lastSeenSyncPos() >= end) { more = false; return more; } return more; }
private boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } if (in.lastSeenSyncPos() >= end) { more = false; return more; } return more; }
private boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } if (in.lastSeenSyncPos() >= end) { more = false; return more; } return more; }
return (ret > 0) && next(readRows);
int actualRead = 0; BytesRefArrayWritable cols = new BytesRefArrayWritable(); while (reader.next(rowID)) { reader.getCurrentRow(cols); cols.resetValid(8);
while (reader.next(rowID)) { reader.getCurrentRow(cols); boolean ok = true;
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; }
return (ret > 0) && next(readRows);
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; }
protected boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); long lastSeenSyncPos = in.lastSeenSyncPos(); if (lastSeenSyncPos >= end) { if(useCache) { syncCache.put(split, lastSeenSyncPos); } more = false; return more; } return more; }
@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(); }
protected boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); long lastSeenSyncPos = in.lastSeenSyncPos(); if (lastSeenSyncPos >= end) { if(useCache) { syncCache.put(split, lastSeenSyncPos); } more = false; return more; } return more; }
private boolean next(LongWritable key) throws IOException { if (!more) { return false; } more = in.next(key); if (!more) { return false; } if (in.lastSeenSyncPos() >= end) { more = false; return more; } return more; }