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


Java NullableIntVector.Mutator方法代码示例

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


在下文中一共展示了NullableIntVector.Mutator方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCopier

import org.apache.drill.exec.vector.NullableIntVector; //导入方法依赖的package包/类
private Copier<?> getCopier(int jdbcType, int offset, ResultSet result, ValueVector v) {

    if (v instanceof NullableBigIntVector) {
      return new BigIntCopier(offset, result, (NullableBigIntVector.Mutator) v.getMutator());
    } else if (v instanceof NullableFloat4Vector) {
      return new Float4Copier(offset, result, (NullableFloat4Vector.Mutator) v.getMutator());
    } else if (v instanceof NullableFloat8Vector) {
      return new Float8Copier(offset, result, (NullableFloat8Vector.Mutator) v.getMutator());
    } else if (v instanceof NullableIntVector) {
      return new IntCopier(offset, result, (NullableIntVector.Mutator) v.getMutator());
    } else if (v instanceof NullableVarCharVector) {
      return new VarCharCopier(offset, result, (NullableVarCharVector.Mutator) v.getMutator());
    } else if (v instanceof NullableVarBinaryVector) {
      return new VarBinaryCopier(offset, result, (NullableVarBinaryVector.Mutator) v.getMutator());
    } else if (v instanceof NullableDateVector) {
      return new DateCopier(offset, result, (NullableDateVector.Mutator) v.getMutator());
    } else if (v instanceof NullableTimeVector) {
      return new TimeCopier(offset, result, (NullableTimeVector.Mutator) v.getMutator());
    } else if (v instanceof NullableTimeStampVector) {
      return new TimeStampCopier(offset, result, (NullableTimeStampVector.Mutator) v.getMutator());
    } else if (v instanceof NullableBitVector) {
      return new BitCopier(offset, result, (NullableBitVector.Mutator) v.getMutator());
    }

    throw new IllegalArgumentException("Unknown how to handle vector.");
  }
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:27,代码来源:JdbcRecordReader.java

示例2: testNullableFixedVector

import org.apache.drill.exec.vector.NullableIntVector; //导入方法依赖的package包/类
@Test
public void testNullableFixedVector() {

  @SuppressWarnings("resource")
  NullableIntVector vector = new NullableIntVector(makeField(MinorType.INT, DataMode.OPTIONAL), fixture.allocator() );
  vector.allocateNew( );

  NullableIntVector.Mutator mutator = vector.getMutator();
  for (int i = 0; i < 2 * ValueVector.MAX_ROW_COUNT; i++) {
    try {
      mutator.setScalar(i, i);
    } catch (VectorOverflowException e) {
      assertEquals(IntVector.MAX_SCALAR_COUNT, i);
      break;
    }
  }

  vector.close();
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:20,代码来源:TestVectorLimits.java

示例3: testNullable

import org.apache.drill.exec.vector.NullableIntVector; //导入方法依赖的package包/类
@SuppressWarnings("resource")
@Test
public void testNullable() {
  MaterializedField nullableIntSchema =
      SchemaBuilder.columnSchema("a", MinorType.INT, DataMode.OPTIONAL);
  NullableIntVector sourceVector = new NullableIntVector(nullableIntSchema, fixture.allocator());
  NullableIntVector.Mutator sourceMutator = sourceVector.getMutator();
  sourceVector.allocateNew(100);
  for (int i = 0; i < 100; i++) {
    sourceMutator.set(i, i * 10);
  }
  sourceMutator.setValueCount(100);

  NullableIntVector destVector = new NullableIntVector(nullableIntSchema, fixture.allocator());

  sourceVector.toNullable(destVector);

  assertEquals(0, sourceVector.getAccessor().getValueCount());
  NullableIntVector.Accessor destAccessor = destVector.getAccessor();
  assertEquals(100, destAccessor.getValueCount());
  for (int i = 0; i < 100; i++) {
    assertFalse(destAccessor.isNull(i));
    assertEquals(i * 10, destAccessor.get(i));
  }

  destVector.clear();

  // Don't clear the intVector, it should be empty.
  // If it is not, the test will fail with a memory leak error.
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:31,代码来源:TestToNullable.java

示例4: doTest

import org.apache.drill.exec.vector.NullableIntVector; //导入方法依赖的package包/类
@Override
public void doTest() {
  try (NullableIntVector vector = new NullableIntVector(field, fixture.allocator());) {
    vector.allocateNew(4096);
    NullableIntVector.Mutator mutator = vector.getMutator();
    timer.start();
    for (int i = 0; i < ROW_COUNT; i++) {
      mutator.setSafe(i, 1234);
    }
    timer.stop();
  }
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:13,代码来源:PerformanceTool.java

示例5: IntCopier

import org.apache.drill.exec.vector.NullableIntVector; //导入方法依赖的package包/类
public IntCopier(int offset, ResultSet set, NullableIntVector.Mutator mutator) {
  super(offset, set, mutator);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:4,代码来源:JdbcRecordReader.java


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