本文整理汇总了Java中org.apache.drill.exec.vector.VectorDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java VectorDescriptor类的具体用法?Java VectorDescriptor怎么用?Java VectorDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VectorDescriptor类属于org.apache.drill.exec.vector包,在下文中一共展示了VectorDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
boolean created = false;
if (vector == DEFAULT_DATA_VECTOR && descriptor.getType().getMinorType() != TypeProtos.MinorType.LATE) {
final MaterializedField field = descriptor.withName(DATA_VECTOR_NAME).getField();
vector = TypeHelper.getNewVector(field, allocator);
// returned vector must have the same field
assert field.equals(vector.getField());
getField().addChild(field);
created = true;
}
final TypeProtos.MajorType actual = vector.getField().getType();
if (!actual.equals(descriptor.getType())) {
final String msg = String.format("Inner vector type mismatch. Requested type: [%s], actual type: [%s]",
descriptor.getType(), actual);
throw new SchemaChangeRuntimeException(msg);
}
return new AddOrGetResult<>((T)vector, created);
}
示例2: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
boolean created = false;
if (vector == DEFAULT_DATA_VECTOR && descriptor.getType().getMinorType() != TypeProtos.MinorType.LATE) {
final MaterializedField field = descriptor.withName(DATA_VECTOR_NAME).getField();
vector = BasicTypeHelper.getNewVector(field, allocator);
// returned vector must have the same field
assert field.equals(vector.getField());
getField().addChild(field);
created = true;
}
final TypeProtos.MajorType actual = vector.getField().getType();
if (!actual.equals(descriptor.getType())) {
final String msg = String.format("Inner vector type mismatch. Requested type: [%s], actual type: [%s]",
descriptor.getType(), actual);
throw new SchemaChangeRuntimeException(msg);
}
return new AddOrGetResult<>((T)vector, created);
}
示例3: getWriter
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
protected FieldWriter getWriter(MinorType type) {
if (state == State.UNION) {
return writer;
}
if (state == State.UNTYPED) {
if (type == null) {
return null;
}
ValueVector v = listVector.addOrGetVector(new VectorDescriptor(Types.optional(type))).getVector();
v.allocateNew();
setWriter(v);
writer.setPosition(position);
}
if (type != this.type) {
return promoteToUnion();
}
return writer;
}
示例4: load
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) {
final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0);
offsets.load(offsetMetadata, buffer);
final int offsetLength = offsetMetadata.getBufferLength();
final UserBitShared.SerializedField bitMetadata = metadata.getChild(1);
final int bitLength = bitMetadata.getBufferLength();
bits.load(bitMetadata, buffer.slice(offsetLength, bitLength));
final UserBitShared.SerializedField vectorMetadata = metadata.getChild(2);
if (getDataVector() == DEFAULT_DATA_VECTOR) {
addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType()));
}
final int vectorLength = vectorMetadata.getBufferLength();
vector.load(vectorMetadata, buffer.slice(offsetLength + bitLength, vectorLength));
}
示例5: DelegateTransferPair
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
public DelegateTransferPair(DelegateRepeatedVector target) {
this.target = Preconditions.checkNotNull(target);
if (target.getDataVector() == DEFAULT_DATA_VECTOR) {
target.addOrGetVector(VectorDescriptor.create(getDataVector().getField()));
target.getDataVector().allocateNew();
}
this.children = new TransferPair[] {
getOffsetVector().makeTransferPair(target.getOffsetVector()),
getDataVector().makeTransferPair(target.getDataVector())
};
}
示例6: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
final AddOrGetResult<T> result = delegate.addOrGetVector(descriptor);
if (result.isCreated() && callBack != null) {
callBack.doWork();
}
return result;
}
示例7: load
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public void load(UserBitShared.SerializedField metadata, DrillBuf buffer) {
final UserBitShared.SerializedField offsetMetadata = metadata.getChild(0);
offsets.load(offsetMetadata, buffer);
final UserBitShared.SerializedField vectorMetadata = metadata.getChild(1);
if (getDataVector() == DEFAULT_DATA_VECTOR) {
addOrGetVector(VectorDescriptor.create(vectorMetadata.getMajorType()));
}
final int offsetLength = offsetMetadata.getBufferLength();
final int vectorLength = vectorMetadata.getBufferLength();
vector.load(vectorMetadata, buffer.slice(offsetLength, vectorLength));
}
示例8: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
final AddOrGetResult<T> result = delegate.addOrGetVector(descriptor);
if (result.isCreated() && callBack != null) {
callBack.doWork();
}
this.field = delegate.getField();
return result;
}
示例9: transferTo
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
public void transferTo(ListVector target) {
offsets.makeTransferPair(target.offsets).transfer();
bits.makeTransferPair(target.bits).transfer();
if (target.getDataVector() instanceof ZeroVector) {
target.addOrGetVector(new VectorDescriptor(vector.getField().getType()));
}
getDataVector().makeTransferPair(target.getDataVector()).transfer();
}
示例10: addOrGet
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
/**
* @deprecated
* prefer using {@link #addOrGetVector(org.apache.drill.exec.vector.VectorDescriptor)} instead.
*/
@Override
public <T extends ValueVector> T addOrGet(String name, MajorType type, Class<T> clazz) {
final AddOrGetResult<T> result = addOrGetVector(VectorDescriptor.create(type));
return result.getVector();
}
示例11: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
throw new UnsupportedOperationException();
}
示例12: ListVectorStruct
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
ListVectorStruct(final ListVector vector) {
super(vector, (field, clazz) -> {
AddOrGetResult result = vector.addOrGetVector(new VectorDescriptor(field));
return result.getVector();
});
}
示例13: TransferImpl
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
public TransferImpl(MaterializedField field, BufferAllocator allocator) {
to = new ListVector(field, allocator, null);
to.addOrGetVector(new VectorDescriptor(vector.getField().getType()));
}
示例14: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
AddOrGetResult<T> result = super.addOrGetVector(descriptor);
reader = new UnionListReader(this);
return result;
}
示例15: addOrGetVector
import org.apache.drill.exec.vector.VectorDescriptor; //导入依赖的package包/类
/**
* Creates and adds a child vector if none with the same name exists, else returns the vector instance.
*
* @param descriptor vector descriptor
* @return result of operation wrapping vector corresponding to the given descriptor and whether it's newly created
* @throws org.apache.drill.common.exceptions.DrillRuntimeException
* if schema change is not permissible between the given and existing data vector types.
*/
<T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor);