public static ClickHouseCompression fromFileName(String file) {
        ClickHouseCompression compression = null;

        int index = 0;
        if (file != null && (index = file.lastIndexOf('.')) > 0) {
            String ext = file.substring(index + 1).toLowerCase(Locale.ROOT);
            for (ClickHouseCompression c : values()) {
                if (c.fileExt.equals(ext)) {
                    compression = c;
                    break;
                }
            }
        }

        return compression;
    }
Get compression algorithm based on given file name.

@param file file name
@return compression algorithm, could be null
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseCompression.java