0

Can somebody explains what is going on with this example. My CF has one single row (key is a string: manju) which in turn has one single column. The column name is dynamic composite with two components: ("review","T23333"). The value is the boolean true.

Now, I want to retrieve information from this CF. The following work with a simple slicequery.

1) 
      key: manju
      start range: ("review","T23333")
      end range: ("review","T23333ZZZZZZZZZZZZZZZZ")

2) 
      key: manju
      start range: ("review")
      end range: ("reviewZZZZZZZZZZZZZZZZZZ")

3) 
      key: manju
      start range: ("review",null)
      end range: ("review","nullZZZZZZZZZZZZZZZZZZ")

The followng does not work:

1) 
     key: manju
     start range: ("review","a")
     end range: ("review","aZZZZZZZZZZZZZZZZ")

2) 
    key: manju
    start range: ("review","")
    end range: ("review","ZZZZZZZZZZZZZZZZ")


3) 
    key: manju
    start range: ("review")
    end range: ("review")

4) 
      key: manju
      start range: ("review","null")
      end range: ("review","nullZZZZZZZZZZZZZZZZZZ")

5) 
      key: manju
      start range: ("review",null)
      end range: ("review","ZZZZZZZZZZZZZZZZZZ")

For the following case, I even get an eerror:

1) 
      key: manju
      start range: ("review","aaaa")
      end range: ("review","ZZZZZZZZZZZZZZZZZZ")
      Error: me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:range finish must come after start in the order of traversal)

I guess what I am trying to understand is how does Cassandra use the range values to determine matches? what would be the recommended ranges for what i am trying to do?

thanks, Pee

Pee One
  • 3
  • 3
  • Well, I'd go so far as to say that using DynamicCompositeType is a design smell. Otherwise, I can't help. – jbellis May 27 '13 at 19:55
  • Thanks for the input. DynamicComposite is really returning different results than Composite in many of these cases. I have a followup question regarding Composite here: http://stackoverflow.com/questions/16795873/composite-type-wildcard-on-last-component. Any input would be appreciated. – Pee One May 28 '13 at 15:30
  • 1
    DCT is a very different beast than CT. If you're not sure why, you definitely shouldn't be using it. :) – jbellis May 29 '13 at 18:31

0 Answers0