/** * This will look at a footer of one of the files in the delta to see if the * file is in Acid format, i.e. has acid metadata columns. The assumption is * that for any dir, either all files are acid or all are not. */ public static ParsedDelta parsedDelta(Path deltaDir, FileSystem fs) throws IOException { String deltaDirName = deltaDir.getName(); if (deltaDirName.startsWith(DELETE_DELTA_PREFIX)) { return parsedDelta(deltaDir, DELETE_DELTA_PREFIX, fs); } return parsedDelta(deltaDir, DELTA_PREFIX, fs); // default prefix is delta_prefix }
public static ParsedDelta parsedDelta(Path deltaDir) { String deltaDirName = deltaDir.getName(); if (deltaDirName.startsWith(DELETE_DELTA_PREFIX)) { return parsedDelta(deltaDir, DELETE_DELTA_PREFIX); } return parsedDelta(deltaDir, DELTA_PREFIX); // default prefix is delta_prefix }
public static ParsedDelta parsedDelta(Path deltaDir, String deltaPrefix, FileSystem fs) throws IOException { String filename = deltaDir.getName(); boolean isDeleteDelta = deltaPrefix.equals(DELETE_DELTA_PREFIX); if (filename.startsWith(deltaPrefix)) { //small optimization - delete delta can't be in raw format boolean isRawFormat = !isDeleteDelta && MetaDataFile.isRawFormat(deltaDir, fs); return parsedDelta(deltaDir, isRawFormat); } throw new IllegalArgumentException(deltaDir + " does not start with " + deltaPrefix); }
private static ParsedDelta parseDelta(FileStatus path, String deltaPrefix) { ParsedDelta p = parsedDelta(path.getPath(), deltaPrefix); boolean isDeleteDelta = deltaPrefix.equals(DELETE_DELTA_PREFIX); return new ParsedDelta(p.getMinTransaction(), p.getMaxTransaction(), path, p.statementId, isDeleteDelta); }
private static ParsedDelta parseDelta(FileStatus path, String deltaPrefix, FileSystem fs) throws IOException { ParsedDelta p = parsedDelta(path.getPath(), deltaPrefix, fs); boolean isDeleteDelta = deltaPrefix.equals(DELETE_DELTA_PREFIX); return new ParsedDelta(p.getMinWriteId(), p.getMaxWriteId(), path, p.statementId, isDeleteDelta, p.isRawFormat(), p.visibilityTxnId); }
.writingBase(true); } else if (bucketFile.getParent().getName().startsWith(DELTA_PREFIX)) { ParsedDelta parsedDelta = parsedDelta(bucketFile.getParent(), DELTA_PREFIX, bucketFile.getFileSystem(conf)); result .bucket(bucket); } else if (bucketFile.getParent().getName().startsWith(DELETE_DELTA_PREFIX)) { ParsedDelta parsedDelta = parsedDelta(bucketFile.getParent(), DELETE_DELTA_PREFIX, bucketFile.getFileSystem(conf)); result
AcidUtils.ParsedDelta pd = AcidUtils.parsedDelta(parent, AcidUtils.DELTA_PREFIX, parent.getFileSystem(conf)); assert pd.getMinWriteId() == pd.getMaxWriteId() :
.writingBase(true); } else if (bucketFile.getParent().getName().startsWith(DELTA_PREFIX)) { ParsedDelta parsedDelta = parsedDelta(bucketFile.getParent(), DELTA_PREFIX); result .setOldStyle(false) .bucket(bucket); } else if (bucketFile.getParent().getName().startsWith(DELETE_DELTA_PREFIX)) { ParsedDelta parsedDelta = parsedDelta(bucketFile.getParent(), DELETE_DELTA_PREFIX); result .setOldStyle(false)
ReaderKey key = new ReaderKey(); Path deltaFile = AcidUtils.createBucketFile(delta, bucket); AcidUtils.ParsedDelta deltaDir = AcidUtils.parsedDelta(delta); FileSystem fs = deltaFile.getFileSystem(conf); long length = OrcAcidUtils.getLastFlushLength(fs, deltaFile);
} else { AcidUtils.ParsedDelta pd = AcidUtils.parsedDelta(parent, isOriginal); if (validWriteIdList.isWriteIdRangeValid(pd.getMinWriteId(), pd.getMaxWriteId()) == ValidWriteIdList.RangeResponse.ALL) {
AcidUtils.ParsedDelta deltaDir = AcidUtils.parsedDelta(delta, delta.getFileSystem(conf)); if(deltaDir.isRawFormat()) { assert !deltaDir.isDeleteDelta() : delta.toString();