protected int compareTo(ClickHouseVersion o, boolean sameSeriesComparison) {
        if (o == null) {
            o = defaultVersion;
        }

        if (this == o) {
            return 0;
        }

        if (latest) {
            return o.latest ? 0 : 1;
        } else if (o.latest) {
            return -1;
        }

        int result = year - o.year;
        if (result != 0) {
            return result;
        } else if (sameSeriesComparison && o.feature == 0 && o.maintenance == 0 && o.build == 0) {
            return 0;
        }

        result = feature - o.feature;
        if (result != 0) {
            return result;
        } else if (sameSeriesComparison && o.maintenance == 0 && o.build == 0) {
            return 0;
        }

        result = maintenance - o.maintenance;
        if (result != 0) {
            return result;
        } else if (sameSeriesComparison && o.build == 0) {
            return 0;
        }

        return build - o.build;
    }
Compares current version and the given one. When {@code includeEmptyParts} is
{@code true}, this method returns 0(instead of 1) when comparing '21.3.1.2'
with '21.3', because they're in the same series of '21.3'.

@param o                    the object to be compared
@param sameSeriesComparison whether compare if two version are in same series
@return a negative integer, zero, or a positive integer as this object is
        less than, equal to, or greater than the specified object
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseVersion.java