@Test public void testCreatesRecordReader() throws IOException { verify(mockOutputFormat).getRecordUpdater(eq(PATH), captureOptions.capture()); Options options = captureOptions.getValue(); assertThat(options.getBucketId(), is(BUCKET_ID)); assertThat(options.getConfiguration(), is((Configuration) configuration)); assertThat(options.getInspector(), is(mockObjectInspector)); assertThat(options.getRecordIdColumn(), is(RECORD_ID_COLUMN)); assertThat(options.getMinimumWriteId(), is(WRITE_ID)); assertThat(options.getMaximumWriteId(), is(WRITE_ID)); }
AcidOutputFormat.Options acidIOOptions = AcidUtils.parseBaseOrDeltaBucketFilename(split.getPath(), conf); if(acidIOOptions.getBucketId() < 0) { LOG.warn("Can't determine bucket ID for " + split.getPath() + "; ignoring"); bucket = acidIOOptions.getBucketId(); if(split.isOriginal()) { mergerOptions.copyIndex(acidIOOptions.getCopyNumber()).bucketPath(split.getPath());
if (options.getOldStyle()) { return new Path(directory, String.format(LEGACY_FILE_BUCKET_DIGITS, options.getBucketId()) + "_0"); } else if (options.isWritingBase()) { subdir = BASE_PREFIX + String.format(DELTA_DIGITS, return createBucketFile(new Path(directory, subdir), options.getBucketId());
assertEquals(567, opts.getMaximumWriteId()); assertEquals(0, opts.getMinimumWriteId()); assertEquals(123, opts.getBucketId()); opts = AcidUtils.parseBaseOrDeltaBucketFilename( new MockPath(fs, dir + "/delta_000005_000006/bucket_00001"), conf); assertEquals(6, opts.getMaximumWriteId()); assertEquals(5, opts.getMinimumWriteId()); assertEquals(1, opts.getBucketId()); opts = AcidUtils.parseBaseOrDeltaBucketFilename( new MockPath(fs, dir + "/delete_delta_000005_000006/bucket_00001"), conf); assertEquals(6, opts.getMaximumWriteId()); assertEquals(5, opts.getMinimumWriteId()); assertEquals(1, opts.getBucketId()); opts = AcidUtils.parseBaseOrDeltaBucketFilename(new Path(dir, "000123_0"), conf); assertEquals(true, opts.getOldStyle()); assertEquals(true, opts.isWritingBase()); assertEquals(123, opts.getBucketId()); assertEquals(0, opts.getMinimumWriteId()); assertEquals(0, opts.getMaximumWriteId());