本文整理汇总了Java中org.apache.arrow.vector.types.pojo.ArrowType.Int方法的典型用法代码示例。如果您正苦于以下问题:Java ArrowType.Int方法的具体用法?Java ArrowType.Int怎么用?Java ArrowType.Int使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.arrow.vector.types.pojo.ArrowType
的用法示例。
在下文中一共展示了ArrowType.Int方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildIntegerGlobalDictionary
import org.apache.arrow.vector.types.pojo.ArrowType; //导入方法依赖的package包/类
private static VectorContainer buildIntegerGlobalDictionary(List<Dictionary> dictionaries, VectorContainer existingDict, ColumnDescriptor columnDescriptor, BufferAllocator bufferAllocator) {
final Field field = new Field(SchemaPath.getCompoundPath(columnDescriptor.getPath()).getAsUnescapedPath(), true, new ArrowType.Int(32, true), null);
final VectorContainer input = new VectorContainer(bufferAllocator);
final NullableIntVector intVector = input.addOrGet(field);
intVector.allocateNew();
final SortedSet<Integer> values = Sets.newTreeSet();
for (Dictionary dictionary : dictionaries) {
for (int i = 0; i <= dictionary.getMaxId(); ++i) {
values.add(dictionary.decodeToInt(i));
}
}
if (existingDict != null) {
final NullableIntVector existingDictValues = existingDict.getValueAccessorById(NullableIntVector.class, 0).getValueVector();
for (int i = 0; i < existingDict.getRecordCount(); ++i) {
values.add(existingDictValues.getAccessor().get(i));
}
}
final Iterator<Integer> iter = values.iterator();
int recordCount = 0;
while (iter.hasNext()) {
intVector.getMutator().setSafe(recordCount++, iter.next());
}
intVector.getMutator().setValueCount(recordCount);
input.setRecordCount(recordCount);
input.buildSchema(BatchSchema.SelectionVectorMode.NONE);
return input;
}
示例2: buildLongGlobalDictionary
import org.apache.arrow.vector.types.pojo.ArrowType; //导入方法依赖的package包/类
private static VectorContainer buildLongGlobalDictionary(List<Dictionary> dictionaries, VectorContainer existingDict, ColumnDescriptor columnDescriptor, BufferAllocator bufferAllocator) {
final Field field = new Field(SchemaPath.getCompoundPath(columnDescriptor.getPath()).getAsUnescapedPath(), true, new ArrowType.Int(64, true), null);
final VectorContainer input = new VectorContainer(bufferAllocator);
final NullableBigIntVector longVector = input.addOrGet(field);
longVector.allocateNew();
SortedSet<Long> values = Sets.newTreeSet();
for (Dictionary dictionary : dictionaries) {
for (int i = 0; i <= dictionary.getMaxId(); ++i) {
values.add(dictionary.decodeToLong(i));
}
}
if (existingDict != null) {
final NullableBigIntVector existingDictValues = existingDict.getValueAccessorById(NullableBigIntVector.class, 0).getValueVector();
for (int i = 0; i < existingDict.getRecordCount(); ++i) {
values.add(existingDictValues.getAccessor().get(i));
}
}
final Iterator<Long> iter = values.iterator();
int recordCount = 0;
while (iter.hasNext()) {
longVector.getMutator().setSafe(recordCount++, iter.next());
}
longVector.getMutator().setValueCount(recordCount);
input.setRecordCount(recordCount);
input.buildSchema(BatchSchema.SelectionVectorMode.NONE);
return input;
}
示例3: getType
import org.apache.arrow.vector.types.pojo.ArrowType; //导入方法依赖的package包/类
@Override
ArrowType getType() {
return new ArrowType.Int(64, true);
}