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

Sam Tunnicliffe commented on CASSANDRA-6071:
--------------------------------------------

This is caused by an additional ColumnDef being added in the CfDef used to 
construct the Pig schema. Where a value_alias is specified for the compact 
value column, CqlStorage.getKeysMeta adds a ColumnDef for it. The additional 
one is then added in AbstractCassandaStorage.getColumnMeta, so I've added an 
additional boolean arg to indicate whether the the value_alias has already been 
processed. I've also refactored ACS.getColumnMeta a bit to (hopefully) make the 
logic clearer. 

                
> CqlStorage loading compact table adds an extraneous field to the pig schema
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6071
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6071
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>            Reporter: Sam Tunnicliffe
>            Assignee: Sam Tunnicliffe
>            Priority: Minor
>         Attachments: 6071.txt
>
>
> {code}
> CREATE TABLE t (
>   key text,
>   field1 int,
>   field2 int
>   PRIMARY KEY (key, field1)
> ) WITH COMPACT STORAGE;
> INSERT INTO t (key,field1,field2) VALUES ('key1',1,2);
> INSERT INTO t (key,field1,field2) VALUES ('key2',1,2);
> INSERT INTO t (key,field1,field2) VALUES ('key3',1,2);
> {code}
> {code}
> grunt> t = LOAD 'cql://ks/t' USING CqlStorage();
> grunt> describe t;                                 
> t: {key: chararray,field1: int,field2: int,value: int}
> dump t;
> (key1,1,2,)
> (key3,1,2,)
> (key2,1,2,)
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to