How to get all super column values ​​in a given rowID from columnfamily in Hector Cassandra

I want to get different string id values ​​depending on the name of the super call. For this, I used this code

    SuperColumnQuery<String, String, String, String> superColumnQuery =
            HFactory.createSuperColumnQuery(keyspaceOperator, se, se,se,se);
    superColumnQuery.setColumnFamily(COLUMN_FAMILY).setKey(rowID).setSuperName(superColumnName);
    QueryResult<HSuperColumn<String, String, String>> result = superColumnQuery.execute();
    //rowID contains a list of rows separated by ','

But it does not work.

+3
source share
1 answer

Given that you are trying to select row strings based on column names, I would venture to suggest that your data model is the opposite. Normally you should navigate from the outside: select the row of the row, then the name of the supercolumn, then the name of the column. Otherwise, you'll be stuck in lines in your code, trying to match the column name, instead of using the Cassandra mechanism to select what you need. This approach will never scale.

, - , ColumnFamily, . SQL , NoSQL dbs, Cassandra, - " - ".

+1

All Articles