QueryBuilder.quote applies duplicate double quotes for some valid identifiers.
QueryBuilder.quote can apply duplicate double quotes to valid identifiers. For example 'foo.bar', 'foo bar', 'foo!bar' are all valid column names.
The CQL Spec defines a quoted identifier as:
...quoted identifiers [are] defined by enclosing an arbitrary sequence of characters in double-quotes(")
QueryBuilder.quote makes use of Utils.appendName. Since its possible for a valid quoted identifier to not match cnamePattern even though it is a valid identifier, it gets quoted twice.
Given that quoted-identifiers are an arbitrary sequence of characters, should consider quoting any sequence of characters given to QueryBuilder.quote.
Fix: changed quote to blindly apply quotes to its input. See discussion on pull request for more details.
The solution here as discussed with Andrew Tolbert, would be to extend cnamePattern to match more valid identifiers. Since indeed when using a valid quoted identifier in quote() , it will apply extra double quotes. Hence, cnamePattern will be a combination of quoted and unquoted identifiers.