You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Cesare Cugnasco (JIRA)" <ji...@apache.org> on 2012/07/28 20:25:34 UTC

[jira] [Created] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Cesare Cugnasco created CASSANDRA-4468:
------------------------------------------

             Summary: Temporally unreachable Dynamic Composite column names.
                 Key: CASSANDRA-4468
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 1.1.2, 1.1.1, 1.1.0
         Environment: linux, 
            Reporter: Cesare Cugnasco


I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
get frame[int(26)];
RowKey: 0000001a
....
 (column=i@19, value=00000013, timestamp=1343495134729000)
=> (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)

but typing 'get frame[int(26)]['s@step']' I got no result.

I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 

I wrote this java code with hector-core-1.1.0 to reproduce this bug.


public static void main(String[] args) {
        String kname = "testspace3";
        Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
        //creating the keyspace and Column family
        if (myCluster.describeKeyspace(kname) != null) {
            myCluster.dropKeyspace(kname, true);
        }        
        ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
        cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
        KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
        myCluster.addKeyspace(kdf, true);
        Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
        //Hector template definition
        ColumnFamilyTemplate<Integer, DynamicComposite> template =
                new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
                ksp,
                "frame",
                IntegerSerializer.get(),
                DynamicCompositeSerializer.get());
        
        DynamicComposite dc = new DynamicComposite();
        dc.addComponent("step", StringSerializer.get());
        DynamicComposite numdc = new DynamicComposite();
        numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
        ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
        cf.setString(dc, "test value");
        cf.setString(numdc, "altro valore");
        template.update(cf);
        //without this parts it works. It works also with less then 4 insertions
        cf = template.createUpdater(26);
        for (int i = 0; i < 4; i++) {
            DynamicComposite num = new DynamicComposite();
            num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
            cf.setInteger(num, i);
        }
        template.update(cf);
        // end part
        HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
        if (res == null) {
            System.out.println("[FAIL] Row not found");
        } else {
            System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
        }
    }


The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 


Furthermore, after running that code, if I run on the cassandra-cli 
set frame[int(26)]['s@step']=utf8(test);

with a "list frame[int(26)]'
RowKey: 0000001a
=> (column=s@step, value=test value, timestamp=1343499335791000)
=> (column=i@0, value=00000000, timestamp=1343499335816000)
=> (column=i@1, value=00000001, timestamp=1343499335816000)
=> (column=i@2, value=00000002, timestamp=1343499335816000)
=> (column=i@3, value=00000003, timestamp=1343499335816000)
=> (column=s@step, value=test, timestamp=1343499384630000)

I found 2 column with the apparently the same column name. 

How is it possible?


Best regards,


Cesare


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-4468:
--------------------------------------

    Priority: Minor  (was: Major)

Out of curiosity, why can't you use normal CompositeType?
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484823#comment-13484823 ] 

Sylvain Lebresne commented on CASSANDRA-4468:
---------------------------------------------

{quote}
This is a real interesting feature but actually I fear it couldn't help me. 
In the code I developed I insert in the same CF more 'maps' which use different types of data as key. 
{quote}

So a fix is attached to CASSANDRA-4711, but for the record I do think that collections would likely work for what you are doing (at least based on the information provided). Namely, what you are doing is equivalent to defining in CQL3:
{noformat}
CREATE TABLE foo (
  row_key text PRIMARY KEY,
  s set<string>,
  i set<int>,
  d set<double>,
  ...
)
{noformat}
And yes you do declare one CQL column for each type you're using, but that has no performance impact whatsoever and you do have to declare the aliases when you use DynamicCompositeType so it's the same. The advantages of doing this with CQL3 sets being that the API will be much nicer (CQL3 regroups all the value of the same time for you basically instead of having you needing to do that manually). 
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
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

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485927#comment-13485927 ] 

Sylvain Lebresne commented on CASSANDRA-4468:
---------------------------------------------

bq. If I'm right, everything you do with CQL could be made, with more effort, with Thrift but not the opposite, isn't?

No. In theory, there is nothing you can do with thrift that cannot be done with CQL3 (and nothing you can do with CQL3 that cannot be done with thrift). I say "in theory" because I won't pretend having tested everything and there may a few bugs here and there that limit things (typically I haven't tested using DynamicCompositeType with CQL3, but bug excluded, this should be possible. What is true is that CQL3 doesn't provide any help whatsoever to work with DynamicCompositeType, so using it for that won't have any advantage over thrift: you will have to encode/decode the composite names manually (or have your client library do it for you, as would be the case with hector)). The difference is that for a large amount of use cases, CQL3 provides a much more convenient API. 
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
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

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425883#comment-13425883 ] 

Jonathan Ellis commented on CASSANDRA-4468:
-------------------------------------------

Okay.  Fair warning, DCT is fairly low on my priority list right now.  Don't know when I'll be able to look into this.
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cesare Cugnasco updated CASSANDRA-4468:
---------------------------------------

    Comment: was deleted

(was: I didn't know about that usage of CT, it's really interesting!)
    
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425873#comment-13425873 ] 

Cesare Cugnasco commented on CASSANDRA-4468:
--------------------------------------------

This is a real interesting feature but actually I fear it couldn't help me. 
In the code I developed I insert in the same CF more 'maps' which use different types of data as key. 
This was the reason for using dynamic CT. 

The problem of this approach is that when I insert a single string wrapped in a DCT as column name, after it is no possible to retrieve it. 
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cesare Cugnasco updated CASSANDRA-4468:
---------------------------------------

    Attachment: BugFinder.java

The java code to reproduce the bug
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425049#comment-13425049 ] 

Jonathan Ellis commented on CASSANDRA-4468:
-------------------------------------------

That actually sounds pretty similar to what we did for collections (CASSANDRA-3647) with normal CT.
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425045#comment-13425045 ] 

Cesare Cugnasco commented on CASSANDRA-4468:
--------------------------------------------

In the code I'm using the idea is to store different types of value (Utf8, Long..) as column names by wrapping them in a DynamicComposite. In such way I can ensure type safety and correctly sorted column slices queries. 

For instance with these columns:
-column='s:aab'
-column='s:abb'
..
-column='l:1'
-column='l:2'
..
-column='d:0.12'
-column='d:0.32'

I can make a query slice to gather all the longs ordered. 

I think I can't do it with a CompositeType.
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylvain Lebresne resolved CASSANDRA-4468.
-----------------------------------------

    Resolution: Duplicate

Closing in favor of CASSANDRA-4711 since it's the same bug.
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
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

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13425261#comment-13425261 ] 

Cesare Cugnasco commented on CASSANDRA-4468:
--------------------------------------------

I didn't know about that usage of CT, it's really interesting!
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4468) Temporally unreachable Dynamic Composite column names.

Posted by "Cesare Cugnasco (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484830#comment-13484830 ] 

Cesare Cugnasco commented on CASSANDRA-4468:
--------------------------------------------

Thank you Sylvain,

what you have written could be very useful for future works.

Actually, I'm working the code which configures and populates Cassandra from some XML configuration files. All the logic is based on the low level Thrift (wrapped by Hector usually) API interface (no CQL), and that was my problem. I'm thinking about to move to CQL, but I'm not sure it is enough expressive.

If I'm right, everything you do with CQL could be made, with more effort, with  Thrift but not the opposite, isn't? 
                
> Temporally unreachable Dynamic Composite column names.
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4468
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4468
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1, 1.1.2
>         Environment: linux, 
>            Reporter: Cesare Cugnasco
>            Priority: Minor
>              Labels: persistence
>         Attachments: BugFinder.java
>
>
> I was working on a Column family with a DynamicComposite column sorter when I noticed that sometimes, after the insertion of a column with a column name composed by a single string (eg 's@step'),it was possible to be reach the column only by slice query but not by direct access. For example using the cassandra-cli it is possible to query: 
> get frame[int(26)];
> RowKey: 0000001a
> ....
>  (column=i@19, value=00000013, timestamp=1343495134729000)
> => (column=s@step, value=746573742076616c7565, timestamp=1343495134680000)
> but typing 'get frame[int(26)]['s@step']' I got no result.
> I tested this behavior using also other clients such as Hector, Astyanax, Pycassa and directly Thrift. 
> I wrote this java code with hector-core-1.1.0 to reproduce this bug.
> public static void main(String[] args) {
>         String kname = "testspace3";
>         Cluster myCluster = HFactory.getOrCreateCluster("Test-cluster", System.getProperty("location", "localhost:9160"));
>         //creating the keyspace and Column family
>         if (myCluster.describeKeyspace(kname) != null) {
>             myCluster.dropKeyspace(kname, true);
>         }        
>         ColumnFamilyDefinition cfd = HFactory.createColumnFamilyDefinition(kname, "frame", ComparatorType.DYNAMICCOMPOSITETYPE);
>         cfd.setComparatorTypeAlias(DynamicComposite.DEFAULT_DYNAMIC_COMPOSITE_ALIASES);
>         KeyspaceDefinition kdf = HFactory.createKeyspaceDefinition(kname, "SimpleStrategy", 1, Arrays.asList(cfd));
>         myCluster.addKeyspace(kdf, true);
>         Keyspace ksp = HFactory.createKeyspace(kname, myCluster);
>         //Hector template definition
>         ColumnFamilyTemplate<Integer, DynamicComposite> template =
>                 new ThriftColumnFamilyTemplate<Integer, DynamicComposite>(
>                 ksp,
>                 "frame",
>                 IntegerSerializer.get(),
>                 DynamicCompositeSerializer.get());
>         
>         DynamicComposite dc = new DynamicComposite();
>         dc.addComponent("step", StringSerializer.get());
>         DynamicComposite numdc = new DynamicComposite();
>         numdc.addComponent(BigInteger.valueOf(62), BigIntegerSerializer.get());
>         ColumnFamilyUpdater<Integer, DynamicComposite> cf = template.createUpdater(26);
>         cf.setString(dc, "test value");
>         cf.setString(numdc, "altro valore");
>         template.update(cf);
>         //without this parts it works. It works also with less then 4 insertions
>         cf = template.createUpdater(26);
>         for (int i = 0; i < 4; i++) {
>             DynamicComposite num = new DynamicComposite();
>             num.addComponent(BigInteger.valueOf(i), BigIntegerSerializer.get());
>             cf.setInteger(num, i);
>         }
>         template.update(cf);
>         // end part
>         HColumn<DynamicComposite, String> res = template.querySingleColumn(26, dc, StringSerializer.get());
>         if (res == null) {
>             System.out.println("[FAIL] Row not found");
>         } else {
>             System.out.println("[SUCCESS] Returned name " + res.getName().get(0).toString() + " - with value: " + res.getValue());
>         }
>     }
> The code acts three tasks: configure keyspace an CF, insert the data and try to retrieve it. After running the code the data are visible (by list for example) but not reachable directly. Restarting Cassandra the row is again reachable. 
> Furthermore, after running that code, if I run on the cassandra-cli 
> set frame[int(26)]['s@step']=utf8(test);
> with a "list frame[int(26)]'
> RowKey: 0000001a
> => (column=s@step, value=test value, timestamp=1343499335791000)
> => (column=i@0, value=00000000, timestamp=1343499335816000)
> => (column=i@1, value=00000001, timestamp=1343499335816000)
> => (column=i@2, value=00000002, timestamp=1343499335816000)
> => (column=i@3, value=00000003, timestamp=1343499335816000)
> => (column=s@step, value=test, timestamp=1343499384630000)
> I found 2 column with the apparently the same column name. 
> How is it possible?
> Best regards,
> Cesare

--
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