code: public static Schema parseSchemaFromFile(Path filePath, FileSystem fs) throws IOException {
      Preconditions.checkArgument(fs.exists(filePath), filePath + " does not exist");
  
      try (FSDataInputStream in = fs.open(filePath)) {
        return new Schema.Parser().parse(in);
      }
    }
docs: Parse Avro schema from a schema file.