Throw useful exception when user saves to Cassandra with null partition key

Description

I had a bug in my code where I was calling javaFunctions(rdd).writerBuilder(...).saveToCassandra() but I had left the partition key null on some of the pojos in the RDD I was saving. That gave an NPE with the following stack trace:

Having a null partition key seems like a fairly simple error for the connector to catch, but the exception/stack trace provide no immediate indication of what the problem was, making it harder to diagnose on my end. It would be great to have a more informative exception.

Pull Requests

https://github.com/datastax/spark-cassandra-connector/pull/729 (1.2) https://github.com/datastax/spark-cassandra-connector/pull/730 (1.3) https://github.com/datastax/spark-cassandra-connector/pull/731 (master) https://github.com/datastax/spark-cassandra-connector/pull/747

Activity

Show:

Jacek June 24, 2015 at 6:34 PM

Thanks , I've just replied

June 24, 2015 at 6:26 PM

I commented on the PR

Fixed

Details

Assignee

Reporter

Reviewer

Fix versions

Priority

Created June 17, 2015 at 3:11 PM
Updated June 28, 2015 at 5:47 PM
Resolved June 28, 2015 at 5:47 PM