code: public static <T extends ThriftStruct> Class<T> getThriftClass(Map<String, String> fileMetadata, Configuration conf) throws ClassNotFoundException {
      String className = conf.get(THRIFT_READ_CLASS_KEY, null);
      if (className == null) {
        final ThriftMetaData metaData = ThriftMetaData.fromExtraMetaData(fileMetadata);
        if (metaData == null) {
          throw new ParquetDecodingException("Could not read file as the Thrift class is not provided and could not be resolved from the file");
        }
        return (Class<T>) metaData.getThriftClass();
      } else {
        return (Class<T>) Class.forName(className);
      }
    }
docs: Getting thrift class from extra metadata