当前位置: 首页>>代码示例>>Java>>正文


Java AddOrGetResult类代码示例

本文整理汇总了Java中org.apache.drill.exec.vector.AddOrGetResult的典型用法代码示例。如果您正苦于以下问题:Java AddOrGetResult类的具体用法?Java AddOrGetResult怎么用?Java AddOrGetResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AddOrGetResult类属于org.apache.drill.exec.vector包,在下文中一共展示了AddOrGetResult类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:22,代码来源:BaseRepeatedValueVector.java

示例2: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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);
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:23,代码来源:BaseRepeatedValueVector.java

示例3: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:RepeatedListVector.java

示例4: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:10,代码来源:RepeatedListVector.java

示例5: addOrGet

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:10,代码来源:RepeatedListVector.java

示例6: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  throw new UnsupportedOperationException();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:RepeatedMapVector.java

示例7: ListVectorStruct

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的package包/类
ListVectorStruct(final ListVector vector) {
  super(vector, (field, clazz) -> {
    AddOrGetResult result = vector.addOrGetVector(new VectorDescriptor(field));
    return result.getVector();
  });
}
 
开发者ID:fineoio,项目名称:drill-dynamo-adapter,代码行数:7,代码来源:DynamoRecordReader.java

示例8: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的package包/类
@Override
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) {
  AddOrGetResult<T> result = super.addOrGetVector(descriptor);
  reader = new UnionListReader(this);
  return result;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:7,代码来源:ListVector.java

示例9: addOrGetVector

import org.apache.drill.exec.vector.AddOrGetResult; //导入依赖的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);
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:10,代码来源:ContainerVectorLike.java


注:本文中的org.apache.drill.exec.vector.AddOrGetResult类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。