def parse_connector_version(version):
    """Parse a connector version string into a tuple (hadoop version, major version, minor version, patch version, release candidate)."""
    hadoop_version, version = version.split("-", maxsplit=1)
    hadoop_version = int(hadoop_version[6:])

    release_candidate = None
    if "-" in version:
        version, tag = version.split("-", maxsplit=1)
        if tag.startswith("RC"):
            release_candidate = int(tag[2:])

    major_version, minor_version, patch_version = map(int, version.split("."))

    return (hadoop_version, major_version, minor_version, patch_version, release_candidate or float("inf"))