org.apache.parquet.schema.Types.buildGroup()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.apache.parquet.schema.Types.buildGroup()方法的一些代码示例,展示了Types.buildGroup()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.buildGroup()方法的具体详情如下:
包路径:org.apache.parquet.schema.Types
类名称:Types
方法名:buildGroup

Types.buildGroup介绍

暂无

代码示例

代码示例来源:origin: apache/hive

return Types.buildGroup(fieldType.getRepetition())
 .addFields(typesArray)
 .named(fieldType.getName());
   subFieldType = getProjectedType(elemType, subFieldType);
  return Types.buildGroup(Repetition.OPTIONAL).as(OriginalType.LIST).addFields(
   subFieldType).named(fieldType.getName());

代码示例来源:origin: org.apache.parquet/parquet-arrow

@Override
public TypeMapping visit(Struct_ type) {
 List<TypeMapping> parquetTypes = fromArrow(children);
 return new StructTypeMapping(field, addToBuilder(parquetTypes, Types.buildGroup(OPTIONAL)).named(fieldName), parquetTypes);
}

代码示例来源:origin: org.apache.parquet/parquet-arrow

@Override
public TypeMapping visit(Union type) {
 // TODO(PARQUET-756): add Union OriginalType
 List<TypeMapping> parquetTypes = fromArrow(children);
 return new UnionTypeMapping(field, addToBuilder(parquetTypes, Types.buildGroup(OPTIONAL)).named(fieldName), parquetTypes);
}

代码示例来源:origin: Netflix/iceberg

public GroupType struct(StructType struct, Type.Repetition repetition, int id, String name) {
 Types.GroupBuilder<GroupType> builder = Types.buildGroup(repetition);
 for (NestedField field : struct.fields()) {
  builder.addField(field(field));
 }
 return builder.id(id).named(name);
}

代码示例来源:origin: com.alibaba.blink/flink-table

private static GroupType convertListType(final String name, final ArrayType arrayType) {
  final InternalType subType = arrayType.getElementInternalType();
  return Types
    .buildGroup(Type.Repetition.OPTIONAL).as(OriginalType.LIST)
    .addField(convertType("array", subType))
    .named(name);
}

代码示例来源:origin: org.lasersonlab.apache.parquet/parquet-column

@Override
protected Type build(String name) {
 Preconditions.checkState(logicalTypeAnnotation == null,
   "LIST is already the logical type and can't be changed");
 Preconditions.checkNotNull(elementType, "List element type");
 GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.LIST);
 if (id != null) {
  builder.id(id.intValue());
 }
 return builder
   .repeatedGroup().addFields(elementType).named("list")
   .named(name);
}

代码示例来源:origin: org.apache.parquet/parquet-column

@Override
protected Type build(String name) {
 Preconditions.checkState(originalType == null,
   "LIST is already the logical type and can't be changed");
 Preconditions.checkNotNull(elementType, "List element type");
 GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.LIST);
 if (id != null) {
  builder.id(id.intValue());
 }
 return builder
   .repeatedGroup().addFields(elementType).named("list")
   .named(name);
}

代码示例来源:origin: org.apache.parquet/parquet-column

@Override
 protected Type build(String name) {
  Preconditions.checkState(originalType == null,
    "MAP is already a logical type and can't be changed.");
  if (keyType == null) {
   keyType = STRING_KEY;
  }
  GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.MAP);
  if (id != null) {
   builder.id(id.intValue());
  }
  if (valueType != null) {
   return builder
     .repeatedGroup().addFields(keyType, valueType).named("map")
     .named(name);
  } else {
   return builder
     .repeatedGroup().addFields(keyType).named("map")
     .named(name);
  }
 }
}

代码示例来源:origin: org.lasersonlab.apache.parquet/parquet-column

@Override
 protected Type build(String name) {
  Preconditions.checkState(logicalTypeAnnotation == null,
    "MAP is already a logical type and can't be changed.");
  if (keyType == null) {
   keyType = STRING_KEY;
  }
  GroupBuilder<GroupType> builder = buildGroup(repetition).as(OriginalType.MAP);
  if (id != null) {
   builder.id(id.intValue());
  }
  if (valueType != null) {
   return builder
     .repeatedGroup().addFields(keyType, valueType).named("map")
     .named(name);
  } else {
   return builder
     .repeatedGroup().addFields(keyType).named("map")
     .named(name);
  }
 }
}

相关文章