You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Andrés de la Peña (JIRA)" <ji...@apache.org> on 2017/08/01 10:03:00 UTC
[jira] [Commented] (CASSANDRA-13573) ColumnMetadata.cellValueType()
doesn't return correct type for non-frozen collection
[ https://issues.apache.org/jira/browse/CASSANDRA-13573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16108673#comment-16108673 ]
Andrés de la Peña commented on CASSANDRA-13573:
-----------------------------------------------
The patch looks good to me, excellent job.
The assertion at {{ColumnMetadata#cellValueType()}} to check that the precondition mentioned in the comment is satisfied makes sense to me.
There are some minor nits about code style:
* There are some missed space-after-comma at {{ViewTest#testFrozenCollectionsWithComplicatedInnerType()}}. Also, it would be nice for the sake of uniformity to align the create table and create view statement as they are in similar tests in the same file.
* It would be good to add a {{@jira_ticket CASSANDRA-13573}} tag in the dtest docstring.
* This is just an idea, but I think that the dtest {{CREATE TABLE}} and insertion could be more readable using a cell per line, something like:
{code}
session.execute('CREATE TABLE ks.cf ('
'key int PRIMARY KEY,'
'list_f frozen<list<int>>,'
'set_f frozen<set<int>>, '
'map_f frozen<map<int,int>>,'
'tuple_f frozen<tuple<int,int>>, '
'user_type_f frozen<user_type>, '
'list_v list<int>,'
'set_v set<int>,'
'map_v map<int,int>,'
'tuple_v tuple<int,int>,'
'user_type_v simple_type)')
...
session.execute(statement, [1,
[1, 2, 3], # list_f
{1, 2, 3}, # set_f
{1: 1, 2: 2, 3: 3}, # map_f
(9, 9), # map_f
FrozenUserType('SG', 100100, {'321', '123'}), # user_type_f
[1, 2], # list_v
{1, 2}, # set_v
{1: 1, 2: 2}, # map_v
(8, 8), # tuple_v
NonFrozenUserType('SG', 100100) # user_type_v
])
{code}
What do you think?
> ColumnMetadata.cellValueType() doesn't return correct type for non-frozen collection
> ------------------------------------------------------------------------------------
>
> Key: CASSANDRA-13573
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13573
> Project: Cassandra
> Issue Type: Bug
> Components: Core, CQL, Materialized Views, Tools
> Reporter: Stefano Ortolani
> Assignee: ZhaoYang
>
> Schema and data"
> {noformat}
> CREATE TABLE ks.cf (
> hash blob,
> report_id timeuuid,
> subject_ids frozen<set<int>>,
> PRIMARY KEY (hash, report_id)
> ) WITH CLUSTERING ORDER BY (report_id DESC);
> INSERT INTO ks.cf (hash, report_id, subject_ids) VALUES (0x1213, now(), {1,2,4,5});
> {noformat}
> sstabledump output is:
> {noformat}
> sstabledump mc-1-big-Data.db
> [
> {
> "partition" : {
> "key" : [ "1213" ],
> "position" : 0
> },
> "rows" : [
> {
> "type" : "row",
> "position" : 16,
> "clustering" : [ "ec01eed0-49d9-11e7-b39a-97a96f529c02" ],
> "liveness_info" : { "tstamp" : "2017-06-05T10:29:57.434856Z" },
> "cells" : [
> { "name" : "subject_ids", "value" : "" }
> ]
> }
> ]
> }
> ]
> {noformat}
> While the values are really there:
> {noformat}
> cqlsh:ks> select * from cf ;
> hash | report_id | subject_ids
> --------+--------------------------------------+-------------
> 0x1213 | 02bafff0-49d9-11e7-b39a-97a96f529c02 | {1, 2, 4}
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org