@Override public SplitInfos applySargToMetadata( SearchArgument sarg, ByteBuffer fileMetadata) throws IOException { // TODO: ideally we should store shortened representation of only the necessary fields // in HBase; it will probably require custom SARG application code. OrcTail orcTail = ReaderImpl.extractFileTail(fileMetadata); OrcProto.Footer footer = orcTail.getFooter(); int stripeCount = footer.getStripesCount(); boolean[] result = OrcInputFormat.pickStripesViaTranslatedSarg( sarg, orcTail.getWriterVersion(), footer.getTypesList(), orcTail.getStripeStatistics(), stripeCount); // For ORC case, send the boundaries of the stripes so we don't have to send the footer. SplitInfos.Builder sb = SplitInfos.newBuilder(); List<StripeInformation> stripes = orcTail.getStripes(); boolean isEliminated = true; for (int i = 0; i < result.length; ++i) { if (result != null && !result[i]) continue; isEliminated = false; StripeInformation si = stripes.get(i); if (LOG.isDebugEnabled()) { LOG.debug("PPD is adding a split " + i + ": " + si.getOffset() + ", " + si.getLength()); } sb.addInfos(SplitInfo.newBuilder().setIndex(i) .setOffset(si.getOffset()).setLength(si.getLength())); } return isEliminated ? null : sb.build(); }
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder addInfos( int index, org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.add(index, builderForValue.build()); onChanged(); } else { infosBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder setInfos( int index, org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.set(index, builderForValue.build()); onChanged(); } else { infosBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder addInfos( org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.add(builderForValue.build()); onChanged(); } else { infosBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder addInfos( int index, org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.add(index, builderForValue.build()); onChanged(); } else { infosBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
public Builder clone() { return create().mergeFrom(buildPartial()); }
private static Builder create() { return new Builder(); }
public Builder mergeFrom(org.apache.hadoop.hive.metastore.Metastore.SplitInfo other) { if (other == org.apache.hadoop.hive.metastore.Metastore.SplitInfo.getDefaultInstance()) return this; if (other.hasOffset()) { setOffset(other.getOffset()); } if (other.hasLength()) { setLength(other.getLength()); } if (other.hasIndex()) { setIndex(other.getIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public org.apache.hadoop.hive.metastore.Metastore.SplitInfo build() { org.apache.hadoop.hive.metastore.Metastore.SplitInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@Override public SplitInfos applySargToMetadata( SearchArgument sarg, ByteBuffer fileMetadata) throws IOException { // TODO: ideally we should store shortened representation of only the necessary fields // in HBase; it will probably require custom SARG application code. OrcTail orcTail = ReaderImpl.extractFileTail(fileMetadata); OrcProto.Footer footer = orcTail.getFooter(); int stripeCount = footer.getStripesCount(); boolean[] result = OrcInputFormat.pickStripesViaTranslatedSarg( sarg, orcTail.getWriterVersion(), footer.getTypesList(), orcTail.getStripeStatistics(), stripeCount); // For ORC case, send the boundaries of the stripes so we don't have to send the footer. SplitInfos.Builder sb = SplitInfos.newBuilder(); List<StripeInformation> stripes = orcTail.getStripes(); boolean isEliminated = true; for (int i = 0; i < result.length; ++i) { if (result != null && !result[i]) continue; isEliminated = false; StripeInformation si = stripes.get(i); if (LOG.isDebugEnabled()) { LOG.debug("PPD is adding a split " + i + ": " + si.getOffset() + ", " + si.getLength()); } sb.addInfos(SplitInfo.newBuilder().setIndex(i) .setOffset(si.getOffset()).setLength(si.getLength())); } return isEliminated ? null : sb.build(); }
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder setInfos( int index, org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.set(index, builderForValue.build()); onChanged(); } else { infosBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .org.apache.hadoop.hive.metastore.SplitInfo infos = 1;</code> */ public Builder addInfos( org.apache.hadoop.hive.metastore.Metastore.SplitInfo.Builder builderForValue) { if (infosBuilder_ == null) { ensureInfosIsMutable(); infos_.add(builderForValue.build()); onChanged(); } else { infosBuilder_.addMessage(builderForValue.build()); } return this; } /**
public Builder clone() { return create().mergeFrom(buildPartial()); }
public Builder mergeFrom(org.apache.hadoop.hive.metastore.Metastore.SplitInfo other) { if (other == org.apache.hadoop.hive.metastore.Metastore.SplitInfo.getDefaultInstance()) return this; if (other.hasOffset()) { setOffset(other.getOffset()); } if (other.hasLength()) { setLength(other.getLength()); } if (other.hasIndex()) { setIndex(other.getIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
private static Builder create() { return new Builder(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
public org.apache.hadoop.hive.metastore.Metastore.SplitInfo build() { org.apache.hadoop.hive.metastore.Metastore.SplitInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }