parquet-thrift/src/main/java/org/apache/parquet/thrift/ThriftSchemaConverter.java
static boolean isListElementType(Type repeatedType,
                                   ThriftField thriftElement) {
    if (repeatedType.isPrimitive() ||
        (repeatedType.asGroupType().getFieldCount() != 1) ||
        (repeatedType.asGroupType().getType(0).isRepetition(REPEATED))) {
      // The repeated type must be the element type because it is an invalid
      // synthetic wrapper. Must be a group with one optional or required field
      return true;
    } else if (thriftElement != null && thriftElement.getType() instanceof StructType) {
      Set<String> fieldNames = new HashSet<String>();
      for (ThriftField field : ((StructType) thriftElement.getType()).getChildren()) {
        fieldNames.add(field.getName());
      }
      // If the repeated type is a subset of the structure of the ThriftField,
      // then it must be the element type.
      return fieldNames.contains(repeatedType.asGroupType().getFieldName(0));
    }
    return false;
  }
static boolean isListElementType(Type repeatedType,
                                   ThriftField thriftElement) {
    if (repeatedType.isPrimitive() ||
        (repeatedType.asGroupType().getFieldCount() != 1) ||
        (repeatedType.asGroupType().getType(0).isRepetition(REPEATED))) {
      // The repeated type must be the element type because it is an invalid
      // synthetic wrapper. Must be a group with one optional or required field
      return true;
    } else if (thriftElement != null && thriftElement.getType() instanceof StructType) {
      Set<String> fieldNames = new HashSet<String>();
      for (ThriftField field : ((StructType) thriftElement.getType()).getChildren()) {
        fieldNames.add(field.getName());
      }
      // If the repeated type is a subset of the structure of the ThriftField,
      // then it must be the element type.
      return fieldNames.contains(repeatedType.asGroupType().getFieldName(0));
    }
    return false;
  }
static boolean isListElementType ( Type repeatedType , ThriftField thriftElement ) { if ( repeatedType . isPrimitive ( ) || ( repeatedType . asGroupType ( ) . getFieldCount ( ) != 1 ) || ( repeatedType . asGroupType ( ) . getType ( 0 ) . isRepetition ( REPEATED ) ) ) { // The repeated type must be the element type because it is an invalid // synthetic wrapper. Must be a group with one optional or required field return true ; } else if ( thriftElement != null && thriftElement . getType ( ) instanceof StructType ) { Set < String > fieldNames = new HashSet < String > ( ) ; for ( ThriftField field : ( ( StructType ) thriftElement . getType ( ) ) . getChildren ( ) ) { fieldNames . add ( field . getName ( ) ) ; } // If the repeated type is a subset of the structure of the ThriftField, // then it must be the element type. return fieldNames . contains ( repeatedType . asGroupType ( ) . getFieldName ( 0 ) ) ; } return false ; }
Returns whether the given type is the element type of a list or is a
synthetic group with one field that is the element type. This is
determined by checking whether the type can be a synthetic group and by
checking whether a potential synthetic group matches the expected
ThriftField.
<p>
This method never guesses because the expected ThriftField is known.

@param repeatedType a type that may be the element type
@param thriftElement the expected Schema for list elements
@return {@code true} if the repeatedType is the element schema
Returns whether the given type is the element type of a list or is a synthetic group with one field that is the element type . This is determined by checking whether the type can be a synthetic group and by checking whether a potential synthetic group matches the expected ThriftField . <p > This method never guesses because the expected ThriftField is known .