Vinay Kumar Chella
Vinay Kumar Chella

Reputation: 1729

Composite column query - with only one component specified

I have a ColumnFamily with a composite column which has 2 integer columns in it. I would like to query that column family with Hector with only one one component specified. Is it possible? I have tried this but it is not returning any result

        MultigetSliceQuery<String, Composite, Object> msq = HFactory.createMultigetSliceQuery(dealsReadKeySpace,stringSerializer, compSerializer, objSerializer);
        msq.setKeys(keysList);

        Composite start = new Composite();

        start.addComponent(searchParameter.getStarRating(), intSerializer);

        msq.setColumnNames(start);
        QueryResult<Rows<String, Composite, Object>> result = msq.execute();

Upvotes: 1

Views: 449

Answers (1)

Chris Gerken
Chris Gerken

Reputation: 16392

You need to specify all component values when constructing the start value. I suggest you use a value for the second integer component that is one of:

  • The known minimum of that second value
  • An integer so small that you are positive (no pun intended) that it is smaller than any second value of any composite column name, or
  • The smallest possible integer

Upvotes: 3

Related Questions