本文整理汇总了Java中parquet.schema.Type.isPrimitive方法的典型用法代码示例。如果您正苦于以下问题:Java Type.isPrimitive方法的具体用法?Java Type.isPrimitive怎么用?Java Type.isPrimitive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parquet.schema.Type
的用法示例。
在下文中一共展示了Type.isPrimitive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeTuple
import parquet.schema.Type; //导入方法依赖的package包/类
private void writeTuple(Tuple tuple, GroupType type) {
for (int index = 0; index < type.getFieldCount(); index++) {
Type fieldType = type.getType(index);
String fieldName = fieldType.getName();
// empty fields have to be omitted
if (tuple.isNull(index))
continue;
recordConsumer.startField(fieldName, index);
if (fieldType.isPrimitive()) {
tuple.writePrimitiveValue(recordConsumer, index, (PrimitiveType)fieldType);
}
else {
recordConsumer.startGroup();
writeTuple(tuple.getTuple(index), fieldType.asGroupType());
recordConsumer.endGroup();
}
recordConsumer.endField(fieldName, index);
}
}
示例2: createConverter
import parquet.schema.Type; //导入方法依赖的package包/类
private Converter createConverter(Type field) {
if (field.isPrimitive()) {
OriginalType otype = field.getOriginalType();
if (otype != null) {
switch (otype) {
case MAP: break;
case LIST: break;
case UTF8: return new StringConverter(field.getName());
case MAP_KEY_VALUE: break;
case ENUM: break;
}
}
return new SimplePrimitiveConverter(field.getName());
}
return new SimpleRecordConverter(field.asGroupType(), field.getName(), this);
}
示例3: getOriginalType
import parquet.schema.Type; //导入方法依赖的package包/类
private OriginalType getOriginalType(Type type, String[] path, int depth) {
if (type.isPrimitive()) {
return type.getOriginalType();
}
Type t = ((GroupType) type).getType(path[depth]);
return getOriginalType(t, path, depth + 1);
}
示例4: isComplex
import parquet.schema.Type; //导入方法依赖的package包/类
private static boolean isComplex(ParquetMetadata footer) {
MessageType schema = footer.getFileMetaData().getSchema();
for (Type type : schema.getFields()) {
if (!type.isPrimitive()) {
return true;
}
}
for (ColumnDescriptor col : schema.getColumns()) {
if (col.getMaxRepetitionLevel() > 0) {
return true;
}
}
return false;
}
示例5: contains
import parquet.schema.Type; //导入方法依赖的package包/类
private boolean contains(GroupType group, String[] path, int index) {
if (index == path.length) {
return false;
}
if (group.containsField(path[index])) {
Type type = group.getType(path[index]);
if (type.isPrimitive()) {
return index + 1 == path.length;
} else {
return contains(type.asGroupType(), path, index + 1);
}
}
return false;
}
示例6: convertField
import parquet.schema.Type; //导入方法依赖的package包/类
private Column convertField(final Type fieldType) {
if (fieldType.isPrimitive()) {
return convertPrimitiveField(fieldType);
} else {
return convertComplexField(fieldType);
}
}