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

  • Home
  • SEARCH
  • 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 7004857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:15:12+00:00 2026-05-27T21:15:12+00:00

Heh, I’m using cf.insert(uuid.uuid1().bytes_le, {‘column1’: ‘val1’}) (pycassa) to create a TimeUUID for Cassandra, but

  • 0

Heh,
I’m using

cf.insert(uuid.uuid1().bytes_le, {'column1': 'val1'}) (pycassa)

to create a TimeUUID for Cassandra, but getting the error

InvalidRequestException: 
InvalidRequestException(why='UUIDs must be exactly 16 bytes')

It doesn’t work with

uuid.uuid1()
uuid.uuid1().bytes
str(uuid.uuid1())

either.

What’s the best way to create a valid TimeUUID to use with the CompareWith=”TimeUUIDType” flag?

Thanks,
Henrik

  • 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-27T21:15:12+00:00Added an answer on May 27, 2026 at 9:15 pm

    You must ensure your column family schema accepts UUID as key. Your code will work with a column family created as (using cassandra-cli):

    create column family MyColumnFamily
      with column_type = 'Standard'
      and comparator = 'AsciiType'
      and default_validation_class = 'BytesType'
      and key_validation_class = 'TimeUUIDType';
    

    To add values to this CF:

    import pycassa
    pool = pycassa.ConnectionPool('Keyspace1')
    cf = pycassa.ColumnFamily(pool, 'MyColumnFamily')
    cf.insert(uuid.uuid1(), {'column1': 'val1'})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a variable length function (obviously, heh) in C++, and what
Heh, I'm using jQuery AJAX Call to pull data from a self hosted webservice
Heh guys, I would like to create and deploy an ASP.NET web form on
New to whole this jQuery (and javascript altogether, heh) and so far it's been
I have an issue, heh. I'm doing some calcs with bitcoins in PHP. When
I've got a drupal site that gets low traffic, but has tons of new
I've seen several questions about password protecting pages, but none of them seem to
ubuntu 10.04, KDE 4.4.5 python 2.6.4 qt 4.6.2 pyqt 4.6.2 I'm trying to create
I now this has been asked a thousand times but that doesn't help me
We're using a third-party middleware product that allows us to write code in an

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.