Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

withPrimaryKey missing from API?

15 views
Skip to first unread message

Ryan Martin

unread,
May 23, 2022, 9:46:25 AM5/23/22
to DataStax Java Driver for Apache Cassandra User Mailing List
Hello,

A table with only one column is not so typical however. At this point you may provide partition, clustering, regular and static columns using any of the following API methods:

  • withPrimaryKey(name, dataType)
  • withClusteringColumn(name, dataType)
  • withColumn(name, dataType)
  • withStaticColumn(name, dataType)

Primary key precedence is driven by the order of withPrimaryKey and withClusteringKey invocations, for example:


However, searching the github repo for "withPrimaryKey" doesn't bring up any results other than the README.md mentioned above.

Is this a typo in the README.md or should "withPrimaryKey" be implemented within the code?

Thanks

Ryan

Erick Ramirez

unread,
May 24, 2022, 3:08:23 AM5/24/22
to java-dri...@lists.datastax.com
It looks like you're right. It is missing from the API. I'm going to reach out to some of the devs to try and get a bit more info. Cheers!

Erick Ramirez

unread,
May 24, 2022, 5:06:31 AM5/24/22
to java-dri...@lists.datastax.com
After discussing this and reading the doc entry again, we're confirming that it is a typo in the doc:

At this point you may provide partition, clustering, regular and static columns using any of the following API methods:
  • withPrimaryKey(name, dataType)
  • withClusteringColumn(name, dataType)
  • withColumn(name, dataType)
  • withStaticColumn(name, dataType)
Specifically, "provide partition" vs withPrimaryKey. I've logged JAVA-3021 to get it fixed. Cheers!

 
Reply all
Reply to author
Forward
0 new messages