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

Jonathan Ellis edited comment on CASSANDRA-3068 at 8/22/11 8:07 PM:
--------------------------------------------------------------------

count() is part of the SQL standard and should operate on rows as defined 
there.  Redefining it is gratuitously confusing to users ([1], [2]), and breaks 
compatibility with Hive.

(I acknowledge my culpability in +1ing the idea in CASSANDRA-1704. I plead 
temporary insanity since I'd obviously come to my senses by [1].)

Note that we do not need a replacement column-specific count function; the 
"transposed" queries from CASSANDRA-2474 means you can count the columns in a 
row with (normal row-based) count(), against the transposed row.

Additional note: count() is also odd in special-casing its return value in a 
CqlResult.num field.  "normal" behavior that JDBC, DBAPI, etc. expect would be 
to return a CqlResult.rows with a single column named "count," and an int value 
of the result.  Let's fix this at the same time as long as we're going to bite 
the incompatibility bullet.

[1] 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/python-cql-driver-select-count-failed-td6410310.html
[2] 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-COUNT-Not-Accurate-td6611854.html


      was (Author: jbellis):
    count() is part of the SQL standard and should operate on rows as defined 
there.  Redefining it is gratuitously confusing to users ([1], [2]), and breaks 
compatibility with Hive.

(I acknowledge my culpability in +1ing the idea in CASSANDRA-1704. I plead 
temporary insanity since I'd obviously come to my senses by [1].)

Note that we do not need a replacement column-specific count function; the 
"transposed" queries from CASSANDRA-2 means you can count the columns in a row 
with (normal row-based) count(), against the transposed row.

Additional note: count() is also odd in special-casing its return value in a 
CqlResult.num field.  "normal" behavior that JDBC, DBAPI, etc. expect would be 
to return a CqlResult.rows with a single column named "count," and an int value 
of the result.  Let's fix this at the same time as long as we're going to bite 
the incompatibility bullet.

[1] 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/python-cql-driver-select-count-failed-td6410310.html
[2] 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-COUNT-Not-Accurate-td6611854.html

  
> Fix count()
> -----------
>
>                 Key: CASSANDRA-3068
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3068
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API, Core
>            Reporter: Jonathan Ellis
>             Fix For: 1.0
>
>
> count() has been broken since it was introduced in CASSANDRA-1704.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to