You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Cathy Daw (JIRA)" <ji...@apache.org> on 2011/05/03 02:50:03 UTC
[jira] [Created] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
CQL: Errors when running unqualified "select column" statement (no where clause)
---------------------------------------------------------------------------------
Key: CASSANDRA-2593
URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
Project: Cassandra
Issue Type: Bug
Affects Versions: 0.8.0
Reporter: Cathy Daw
Priority: Minor
*Seed Data*
{code}
CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
USE cqldb;
CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
{code}
*Query #1 - select varchar column*
{code}
cqlsh> select state from users;
u'user1' | u'state',u'TX'
Exception: 'NoneType' object has no attribute 'decode'
cqlsh> select birth_year from users where KEY='user1';
u'user1' | u'birth_year',1968
{code}
*Query #2 - select bigint column*
{code}
cqlsh> select birth_year from users;
Exception: unpack requires a string argument of length 8
cqlsh> select state from users where KEY='user1';
u'user1' | u'state',u'TX'
{code}
*A simple 'SELECT *' with no WHERE clause works fine*
{code}
cqlsh> select * from users;
u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
u'user0' | u'password',u'ch@ngem3'
u'user3' | u'password',u'ch@ngem3c'
u'user2' | u'password',u'ch@ngem3b'
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028270#comment-13028270 ]
Pavel Yaskevich commented on CASSANDRA-2593:
--------------------------------------------
If there are no columns to show why show we show an empty key?
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (CASSANDRA-2593) CQL: Errors when
running unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028309#comment-13028309 ]
Pavel Yaskevich edited comment on CASSANDRA-2593 at 5/3/11 5:39 PM:
--------------------------------------------------------------------
removed check from CQLSH and added a test.
was (Author: xedin):
remove check from CQLSH and added a test.
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593-v2.patch, CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Yaskevich updated CASSANDRA-2593:
---------------------------------------
Attachment: CASSANDRA-2593-v2.patch
remove check from CQLSH and added a test.
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593-v2.patch, CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (CASSANDRA-2593) CQL: Errors when
running unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028270#comment-13028270 ]
Pavel Yaskevich edited comment on CASSANDRA-2593 at 5/3/11 3:49 PM:
--------------------------------------------------------------------
If there are no columns to show why should we show an empty key?
was (Author: xedin):
If there are no columns to show why show we show an empty key?
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Yaskevich updated CASSANDRA-2593:
---------------------------------------
Attachment: CASSANDRA-2593.patch
branch: cassandra-0.8 (can be applied to trunk also). In the cql/decoders.py we skip a column with an empty value instead of trying to decode it.
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028268#comment-13028268 ]
Jonathan Ellis commented on CASSANDRA-2593:
-------------------------------------------
{code}
+ if len(row) < 2:
+ continue # if there are no columns, we skip
{code}
This looks unrelated to the empty column fix. (It sort of looks like an attempt at addressing CASSANDRA-2548.)
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028377#comment-13028377 ]
Hudson commented on CASSANDRA-2593:
-----------------------------------
Integrated in Cassandra-0.8 #62 (See [https://builds.apache.org/hudson/job/Cassandra-0.8/62/])
fix returning null column values in the python cql driver
patch by Pavel Yaskevich; reviewed by jbellis for CASSANDRA-2593
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
> Attachments: CASSANDRA-2593-v2.patch, CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jonathan Ellis updated CASSANDRA-2593:
--------------------------------------
Component/s: API
Affects Version/s: (was: 0.8.0)
0.8 beta 1
Fix Version/s: 0.8.0
Assignee: Pavel Yaskevich
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028293#comment-13028293 ]
Jonathan Ellis commented on CASSANDRA-2593:
-------------------------------------------
bq. The thing is that when you do "select name from users" and only few of the rows have a "name" column, cqlsh will output all other keys as empty.
Right. (And this part, at least, *is* intuitive to someone coming from SQL: if I have a null column, I still want to see the row included.)
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Cathy Daw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Cathy Daw updated CASSANDRA-2593:
---------------------------------
Description:
*Seed Data*
{code}
CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
USE cqldb;
CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
{code}
*Query #1 - select varchar column*
{code}
cqlsh> select state from users;
u'user1' | u'state',u'TX'
Exception: 'NoneType' object has no attribute 'decode'
cqlsh> select state from users where KEY='user1';
u'user1' | u'state',u'TX'
{code}
*Query #2 - select bigint column*
{code}
cqlsh> select birth_year from users;
Exception: unpack requires a string argument of length 8
cqlsh> select birth_year from users where KEY='user1';
u'user1' | u'birth_year',1968
{code}
*A simple 'SELECT *' with no WHERE clause works fine*
{code}
cqlsh> select * from users;
u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
u'user0' | u'password',u'ch@ngem3'
u'user3' | u'password',u'ch@ngem3c'
u'user2' | u'password',u'ch@ngem3b'
{code}
was:
*Seed Data*
{code}
CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
USE cqldb;
CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
{code}
*Query #1 - select varchar column*
{code}
cqlsh> select state from users;
u'user1' | u'state',u'TX'
Exception: 'NoneType' object has no attribute 'decode'
cqlsh> select birth_year from users where KEY='user1';
u'user1' | u'birth_year',1968
{code}
*Query #2 - select bigint column*
{code}
cqlsh> select birth_year from users;
Exception: unpack requires a string argument of length 8
cqlsh> select state from users where KEY='user1';
u'user1' | u'state',u'TX'
{code}
*A simple 'SELECT *' with no WHERE clause works fine*
{code}
cqlsh> select * from users;
u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
u'user0' | u'password',u'ch@ngem3'
u'user3' | u'password',u'ch@ngem3c'
u'user2' | u'password',u'ch@ngem3b'
{code}
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028278#comment-13028278 ]
Jonathan Ellis commented on CASSANDRA-2593:
-------------------------------------------
Short answer, same reason Cathy linked over there: http://wiki.apache.org/cassandra/FAQ#range_ghosts.
Longer answer, I plan to address on 2548. For now let's fix the empty column bug.
Can you add a test_cql.py test that catches the problem, to prevent a regression?
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Cathy Daw (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028411#comment-13028411 ]
Cathy Daw commented on CASSANDRA-2593:
--------------------------------------
The patch works as expected:
{code}
cqlsh> select state from users;
u'user1' | u'state',u'TX'
u'user0'
u'user3'
u'user2'
cqlsh> select birth_year from users;
u'user1' | u'birth_year',1968
u'user0'
u'user3'
u'user2'
{code}
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0
>
> Attachments: CASSANDRA-2593-v2.patch, CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-2593) CQL: Errors when running
unqualified "select column" statement (no where clause)
Posted by "Pavel Yaskevich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-2593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028287#comment-13028287 ]
Pavel Yaskevich commented on CASSANDRA-2593:
--------------------------------------------
The thing is that when you do "select name from users" and only few of the rows have a "name" column, cqlsh will output all other keys as empty. If you want I can remove check from the CQLSH
> CQL: Errors when running unqualified "select column" statement (no where clause)
> ---------------------------------------------------------------------------------
>
> Key: CASSANDRA-2593
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2593
> Project: Cassandra
> Issue Type: Bug
> Components: API
> Affects Versions: 0.8 beta 1
> Reporter: Cathy Daw
> Assignee: Pavel Yaskevich
> Priority: Minor
> Labels: cql
> Fix For: 0.8.0 beta 2
>
> Attachments: CASSANDRA-2593.patch
>
>
> *Seed Data*
> {code}
> CREATE KEYSPACE cqldb with strategy_class = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options:replication_factor=2;
> USE cqldb;
> CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar, gender varchar, session_token varchar, state varchar, birth_year bigint);
> INSERT INTO users (KEY, password) VALUES ('user0', 'ch@ngem3');
> INSERT INTO users (KEY, password, gender, state, birth_year) VALUES ('user1', 'ch@ngem3a', 'f', 'TX', '1968');
> INSERT INTO users (KEY, password) VALUES ('user2', 'ch@ngem3b');
> INSERT INTO users (KEY, password) VALUES ('user3', 'ch@ngem3c');
> {code}
> *Query #1 - select varchar column*
> {code}
> cqlsh> select state from users;
> u'user1' | u'state',u'TX'
> Exception: 'NoneType' object has no attribute 'decode'
> cqlsh> select state from users where KEY='user1';
> u'user1' | u'state',u'TX'
> {code}
> *Query #2 - select bigint column*
> {code}
> cqlsh> select birth_year from users;
> Exception: unpack requires a string argument of length 8
> cqlsh> select birth_year from users where KEY='user1';
> u'user1' | u'birth_year',1968
> {code}
> *A simple 'SELECT *' with no WHERE clause works fine*
> {code}
> cqlsh> select * from users;
> u'user1' | u'birth_year',1968 | u'gender',u'f' | u'password',u'ch@ngem3a' | u'state',u'TX'
> u'user0' | u'password',u'ch@ngem3'
> u'user3' | u'password',u'ch@ngem3c'
> u'user2' | u'password',u'ch@ngem3b'
> {code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira