public static int readEnumValues(String args, int startIndex, int len, Map<String, Integer> values) {
        String name = null;
        StringBuilder builder = new StringBuilder();
        for (int i = startIndex; i < len; i++) {
            char ch = args.charAt(i);
            if (ch == '\'') {
                i = readNameOrQuotedString(args, i, len, builder);
                name = builder.toString();
                builder.setLength(0);

                int index = args.indexOf('=', i);
                if (index >= i) {
                    for (i = index + 1; i < len; i++) {
                        ch = args.charAt(i);
                        if (ch >= '0' && ch <= '9') {
                            builder.append(ch);
                        } else if (ch == ',') {
                            values.put(name, Integer.parseInt(builder.toString()));
                            builder.setLength(0);
                            break;
                        } else if (ch == ')') {
                            values.put(name, Integer.parseInt(builder.toString()));
                            return i + 1;
                        } else if (!Character.isWhitespace(ch)) {
                            throw new IllegalArgumentException("Invalid character when reading enum");
                        }
                    }
                } else {
                    throw new IllegalArgumentException("Expect = after enum value but not found");
                }
            } else if (!Character.isWhitespace(ch)) {
                throw new IllegalArgumentException("Invalid enum declaration");
            }
        }

        return len;
    }
Skip quoted string, comments, and brackets until seeing all the given
{@code keywords}(with only whitespaces or comments in between) or reaching
end of the given string.

@param args          non-null string to scan
@param startIndex    start index
@param len           end index, usually length of the given string
@param keywords      keywords, null or empty one means any character
@param caseSensitive whether keyword is case sensitive or not
@return index of {@code endChar} or {@code len}
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java