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 805881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:09:30+00:00 2026-05-15T00:09:30+00:00

I am new to Cassandra. I am trying to insert some values to the

  • 0

I am new to Cassandra. I am trying to insert some values to the columnfamily. The definition of columnfamily in the config file is as follows.

<ColumnFamily Name="CommandQueue"
                    ColumnType="Super"
                    CompareWith="TimeUUIDType"
                    CompareSubcolumnsWith="UTF8Type"/>

When ever I try to insert values to I always get “InvalidRequestException(why: UUIDs must be exactly 16 bytes)”.

I am using batch_mutate() to insert column.

How can I insert values to the column family.

  • 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-15T00:09:30+00:00Added an answer on May 15, 2026 at 12:09 am

    Below is a code snippet (from Nick Berardi’s Coder Journal)

    public static Guid GenerateTimeBasedGuid(DateTime dateTime)
        {
            long ticks = dateTime.Ticks - GregorianCalendarStart.Ticks;
    
            byte[] guid = new byte[ByteArraySize];
            byte[] clockSequenceBytes = BitConverter.GetBytes(Convert.ToInt16(Environment.TickCount
                % Int16.MaxValue));
            byte[] timestamp = BitConverter.GetBytes(ticks);
    
            // copy node
            Array.Copy(Node, 0, guid, NodeByte, Node.Length);
    
            // copy clock sequence
            Array.Copy(clockSequenceBytes, 0, guid, GuidClockSequenceByte,clockSequenceBytes.Length);
    
            // copy timestamp
            Array.Copy(timestamp, 0, guid, 0, timestamp.Length);
    
            // set the variant
            guid[VariantByte] &= (byte)VariantByteMask;
            guid[VariantByte] |= (byte)VariantByteShift;
    
            // set the version
            guid[VersionByte] &= (byte)VersionByteMask;
            guid[VersionByte] |= (byte)((int)GuidVersion.TimeBased << VersionByteShift);
    
            return new Guid(guid);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to insert a keyspace into cassandra using hector and the SchemaManipulation example
I'm new in cassandra and I wanna get the values from a column family,
I'm new to cassandra and hector so i'm trying to execute cql queries but
I'm using Cassandra 0.6.4 and I'm trying to insert an UUID for a column
I'm investigating both Cassandra and MongoDB for a new project because they share some
I have the following Cassandra configuration: <ColumnFamily CompareWith=LongType Name=MiFamily> But when I try to
I am relatively new to cassandra and its data model. I have a large
I am pretty new to Cassandra, just started learning Cassandra a week ago. I
i am new in Cassandra db. need help to create data model. i have
We are starting a new java web-project with Cassandra as the database. The team

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.