[ 
https://issues.apache.org/jira/browse/CASSANDRA-8005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14155324#comment-14155324
 ] 

Tyler Hobbs commented on CASSANDRA-8005:
----------------------------------------

bq. What I'm not convinced of is the usefulness of exposing such methods to 
clients through the addition of DESCRIBE to CQL, because drivers already 
provide it and I generally prefer not having 2 ways to do the same thing.

I agree, but I would prefer for server-side DESCRIBE to be the (eventual) only 
way to do it.

bq. The reason drivers provides a sort of DESCRIBE is just that generating it 
from those APIs is a small amount of trivial code and there is thus no reason 
for drivers not to provide it out of the box.

It is neither small nor trivial, especially when multiple versions of Cassandra 
have to be supported.

For example, see the methods to {{DESCRIBE TABLE}} in the python driver: 
https://github.com/datastax/python-driver/blob/master/cassandra/metadata.py#L843.
  There have been multiple subtle bugs in this.

There are also other tricky details, like listing {{CREATE TYPE}} statements in 
an order that handles cross-type dependencies.  (Even cqlsh got this wrong at 
first.)

bq. Once OPSC moves to the python-driver, it will also no longer have to 
reinvent this logic, and use the driver's. And for CASSANDRA-7190 we don't 
really need a DESCRIBE statement in CQL.

There is a lot of value in having Cassandra create the schema file itself.  
Other processes can easily have permissions problems (I know that OpsCenter 
certainly had a lot of them).  This doesn't mean that {{DESCRIBE}} has to be in 
CQL, but we need that same logic anyway.

> Server-side DESCRIBE
> --------------------
>
>                 Key: CASSANDRA-8005
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8005
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Tyler Hobbs
>            Priority: Minor
>              Labels: cql3
>             Fix For: 3.0
>
>
> The various {{DESCRIBE}} commands are currently implemented by cqlsh, and 
> nearly identical implementations exist in many drivers.  There are several 
> motivations for making {{DESCRIBE}} part of the CQL language:
> * Eliminate the (fairly complex) duplicate implementations across drivers and 
> cqlsh
> * Get closer to allowing drivers to not have to fetch the schema tables. 
> (Minor changes to prepared statements are also needed.)
> * Have instantaneous support for new schema features in cqlsh.  (You 
> currently have to update the bundled python driver.)
> * Support writing out schemas where it makes sense.  One good example of this 
> is backups.  You need to restore the schema before restoring data in the case 
> of total loss, so it makes sense to write out the schema alongside snapshots.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to