public static int readNameOrQuotedString(String args, int startIndex, int len, StringBuilder builder) {
        char quote = '\0';
        for (int i = startIndex; i < len; i++) {
            char ch = args.charAt(i);
            if (ch == '\\') {
                if (++i < len) {
                    builder.append(args.charAt(i));
                }
            } else if (isQuote(ch)) {
                if (ch == quote) {
                    if (i + 1 < len && args.charAt(i + 1) == ch) {
                        builder.append(ch);
                        i++;
                        continue;
                    }
                    len = i + 1;
                    break;
                } else if (quote == '\0') {
                    quote = ch;
                } else {
                    builder.append(ch);
                }
            } else if (quote == '\0' && (Character.isWhitespace(ch) || isOpenBracket(ch) || isCloseBracket(ch)
                    || isSeparator(ch) || (i + 1 < len && ((ch == '-' && args.charAt(i + 1) == '-')
                            || (ch == '/' && args.charAt(i + 1) == '*'))))) {
                if (builder.length() > 0) {
                    len = i;
                    break;
                }
            } else {
                builder.append(ch);
            }
        }

        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