Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:19:17+00:00 2026-05-26T18:19:17+00:00

To improve my skills on Hector and cassandra I’m trying diffrent methods to query

  • 0

To improve my skills on Hector and cassandra I’m trying diffrent methods to query data out of cassandra.

Currently I’m trying to make a simple message system. I would like to get the posted messages in chronological order with the last posted message first.

In plain sql it is possible to use ‘order by’. I know it is possible if you use the OrderPreservingPartitioner but this partioner is deprecated and less-efficient than the RandomPartioner. I thought of creating an index on a secondary column with a timestamp als value, but I can’t figure out how to obtain the data. I’m sure that I have to use at least two queries.

My column Family looks like this:

create column family messages
with comparator = UTF8Type
and key_validation_class=LongType
and compression_options =
{sstable_compression:SnappyCompressor, chunk_length_kb:64}
and column_metadata = [
{column_name: message, validation_class: UTF8Type}
{column_name: index, validation_class: DateType, index_type: KEYS}
];

I’m not sure if I should use DataType or long for the index column, but I think that’s not important for this question.

So how can I get the data sorted? If possible I like to know hows its done white the CQL syntax and whitout.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:19:17+00:00Added an answer on May 26, 2026 at 6:19 pm

    I don’t think there’s a completely simple way to do this when using RandomPartitioner.

    The columns within each row are stored in sorted order automatically, so you could store each message as a column, keyed on timestamp.

    Pretty soon, of course, your row would grow large. So you would need to divide up the messages into rows (by day, hour or minute, etc) and your client would need to work out which rows (time periods) to access.

    See also Cassandra time series data
    and http://rubyscale.com/2011/basic-time-series-with-cassandra/
    and https://www.cloudkick.com/blog/2010/mar/02/4_months_with_cassandra/
    and http://pkghosh.wordpress.com/2011/03/02/cassandra-secondary-index-patterns/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to improve my PHP skills and I have a sample below
Hello everyone I'm trying to improve my Java skills by solving some problems from
I'm trying to improve my web development skills. I'm already familiar enough with HTTP,
I trying to improve my skills using Try Catch blocks and better error handling.
I am trying to improve my skills in encryption and decryption, but there are
I'm currently writing some tests so that I may improve my skills with the
I'm trying to learn OpenGL and improve my C++ skills by going through the
I'm trying to improve my TDD/OO skills and each time I try and use
I am new at Lisp, and am trying different things out to improve my
I'm trying to improve my Vim skills through VimGolf ( http://www.vimgolf.com/ ) and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.