parquet.schema.Type.asGroupType()方法的使用及代码示例

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

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

Type.asGroupType介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

public Group addGroup(int fieldIndex) {
 ParquetGroup g = new ParquetGroup(this.schema.getType(fieldIndex).asGroupType());
 this.data[fieldIndex].add(g);
 return g;
}

代码示例来源:origin: apache/incubator-gobblin

/**
  * Add a {@link Group} given a String key.
  * @param key
  * @param object
  */
 private void addGroup(String key, Group object) {
  int fieldIndex = getIndex(key);
  this.schema.getType(fieldIndex).asGroupType();
  this.data[fieldIndex].add(object);
 }
}

代码示例来源:origin: prestodb/presto

GroupType repeatedType = type.getType(0).asGroupType();

代码示例来源:origin: prestodb/presto

GroupType repeatedType = type.getType(0).asGroupType();
recordConsumer.startGroup();

代码示例来源:origin: prestodb/presto

GroupType groupType = type.asGroupType();
OriginalType originalType = type.getOriginalType();

代码示例来源:origin: julienledem/redelm

/**
 * {@inheritDoc}
 */
public void startGroup() {
 previousField.push(-1);
 types.push(types.peek().asGroupType().getType(fields.peek()));
 delegate.startGroup();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * {@inheritDoc}
 */
public void startGroup() {
 previousField.push(-1);
 types.push(types.peek().asGroupType().getType(fields.peek()));
 delegate.startGroup();
}

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

public Group addGroup(int fieldIndex) {
 ParquetGroup g = new ParquetGroup(this.schema.getType(fieldIndex).asGroupType());
 this.data[fieldIndex].add(g);
 return g;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * {@inheritDoc}
 */
public void endGroup() {
 delegate.endGroup();
 validateMissingFields(types.peek().asGroupType().getFieldCount());
 types.pop();
 previousField.pop();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private void validateMissingFields(int index) {
 for (int i = previousField.peek() + 1; i < index; i++) {
  Type type = types.peek().asGroupType().getType(i);
  if (type.isRepetition(Repetition.REQUIRED)) {
   throw new InvalidRecordException("required field is missing " + type);
  }
 }
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
public Group addGroup(int fieldIndex) {
 SimpleGroup g = new SimpleGroup(schema.getType(fieldIndex).asGroupType());
 add(fieldIndex, g);
 return g;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * {@inheritDoc}
 */
@Override
protected boolean equals(Type otherType) {
 return
   !otherType.isPrimitive()
   && super.equals(otherType)
   && getFields().equals(otherType.asGroupType().getFields());
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-hive

public ParquetMapConverter(Type type, String columnName, GroupType mapType, int fieldIndex)
{
  checkArgument(
      mapType.getFieldCount() == 1,
      "Expected MAP column '%s' to only have one field, but has %s fields",
      mapType.getName(),
      mapType.getFieldCount());
  this.mapType = type;
  this.fieldIndex = fieldIndex;
  parquet.schema.Type entryType = mapType.getFields().get(0);
  entryConverter = new ParquetMapEntryConverter(type, columnName + ".entry", entryType.asGroupType());
}

代码示例来源:origin: com.twitter/parquet-tools

private static void showDetails(PrettyPrintWriter out, Type type, int depth, MessageType container, List<String> cpath) {
  if (type instanceof GroupType) {
   showDetails(out, type.asGroupType(), depth, container, cpath);
   return;
  } else if (type instanceof PrimitiveType) {
   showDetails(out, type.asPrimitiveType(), depth, container, cpath);
   return;
  }
 }
}

代码示例来源:origin: com.twitter/parquet-pig

MapConverter(GroupType parquetSchema, FieldSchema pigSchema, ParentValueContainer parent, boolean numbersDefaultToZero, boolean columnIndexAccess) throws FrontendException {
 if (parquetSchema.getFieldCount() != 1) {
  throw new IllegalArgumentException("maps have only one field. " + parquetSchema);
 }
 this.parent = parent;
 keyValue = new MapKeyValueConverter(parquetSchema.getType(0).asGroupType(), pigSchema.schema.getField(0), numbersDefaultToZero, columnIndexAccess);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

protected static Converter getConverterFromDescription(Type type, int index, ConverterParent parent) {
 if (type == null) {
  return null;
 }
 if (type.isPrimitive()) {
  return getConverterFromDescription(type.asPrimitiveType(), index, parent);
 }
 return getConverterFromDescription(type.asGroupType(), index, parent);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
public void visit(GroupType groupType) {
 if (currentRequestedType.isPrimitive()) {
  incompatibleSchema(groupType, currentRequestedType);
 }
 GroupColumnIO newIO = new GroupColumnIO(groupType, current, currentRequestedIndex);
 current.add(newIO);
 visitChildren(newIO, groupType, currentRequestedType.asGroupType());
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

void checkGroupContains(Type subType) {
 if (subType.isPrimitive()) {
  throw new InvalidRecordException(subType + " found: expected " + this);
 }
 List<Type> fields = subType.asGroupType().getFields();
 for (Type otherType : fields) {
  Type thisType = this.getType(otherType.getName());
  thisType.checkContains(otherType);
 }
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

@Override
protected Type union(Type toMerge, boolean strict) {
 if (toMerge.isPrimitive()) {
  throw new IncompatibleSchemaModificationException("can not merge primitive type " + toMerge + " into group type " + this);
 }
 return new GroupType(toMerge.getRepetition(), getName(), mergeFields(toMerge.asGroupType()));
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private PrimitiveConverter getPrimitiveConverter(ColumnDescriptor path) {
 Type currentType = schema;
 Converter currentConverter = recordConverter;
 for (String fieldName : path.getPath()) {
  final GroupType groupType = currentType.asGroupType();
  int fieldIndex = groupType.getFieldIndex(fieldName);
  currentType = groupType.getType(fieldName);
  currentConverter = currentConverter.asGroupConverter().getConverter(fieldIndex);
 }
 PrimitiveConverter converter = currentConverter.asPrimitiveConverter();
 return converter;
}

相关文章