stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
14 stars 16 forks source link

Possible inconsistent CQL Identifier to string in ListTables and Metadata commands #1587

Open amorton opened 1 week ago

amorton commented 1 week ago

The following was added to the CqlIdentifierUtil class

  /** Remove the quotes from the identifier */
  public static String externalRepresentation(CqlIdentifier identifier) {
    return identifier.asInternal();
  }

But we already have

  public static String cqlIdentifierToStringForUser(CqlIdentifier identifier) {
    return identifier.asCql(true);
  }

Why do we want to remove the double quotes ? And if we added this function did we consider removing the other one ?

amorton commented 1 week ago

If we do need both, i.e. one way for messages and one for JSON fields names, then we should improve the method names to make it clearer

amorton commented 1 week ago

Suggestion from chat with @tatu-at-datastax for name such as

toCql
toJSON
toMessage

fromJSON
fromCQL