parquet-avro/src/main/java/org/apache/parquet/avro/AvroRecordConverter.java
static boolean isElementType(Type repeatedType, Schema elementSchema) {
    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 (elementSchema != null &&
        elementSchema.getType() == Schema.Type.RECORD) {
      Schema schemaFromRepeated = CONVERTER.convert(repeatedType.asGroupType());
      if (checkReaderWriterCompatibility(elementSchema, schemaFromRepeated)
          .getType() == COMPATIBLE) {
        return true;
      }
    }
    return false;
  }
static boolean isElementType(Type repeatedType, Schema elementSchema) {
    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 (elementSchema != null &&
        elementSchema.getType() == Schema.Type.RECORD) {
      Schema schemaFromRepeated = CONVERTER.convert(repeatedType.asGroupType());
      if (checkReaderWriterCompatibility(elementSchema, schemaFromRepeated)
          .getType() == COMPATIBLE) {
        return true;
      }
    }
    return false;
  }
static boolean isElementType ( Type repeatedType , Schema elementSchema ) { 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 ( elementSchema != null && elementSchema . getType ( ) == Schema . Type . RECORD ) { Schema schemaFromRepeated = CONVERTER . convert ( repeatedType . asGroupType ( ) ) ; if ( checkReaderWriterCompatibility ( elementSchema , schemaFromRepeated ) . getType ( ) == COMPATIBLE ) { return true ; } } 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 schema.
<p>
Unlike {@link AvroSchemaConverter#isElementType(Type, String)}, this
method never guesses because the expected schema is known.

@param repeatedType a type that may be the element type
@param elementSchema 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 schema . <p > Unlike { @link AvroSchemaConverter#isElementType ( Type String ) } this method never guesses because the expected schema is known .