spotify / hdfs2cass

Hadoop mapreduce job to bulk load data into Cassandra
Apache License 2.0
75 stars 21 forks source link

throw a better exception if requested CF not found #9

Closed mattnworb closed 9 years ago

mattnworb commented 9 years ago

If someone tries to import data to a cassandra column family that doesn't actually exist (maybe they forgot to create the table), the Crunch job fails with a NullPointerException at the tableMetadata.getColumns() line since there is no metadata for the table. Throw a more descriptive error message in this case.

rzvoncek commented 9 years ago

Matt, I will close this one. There was another bug related to this. Just throwing an exception if keyspace/table does not exist was not good enough. The java driver connection used to fetch metadata was left open, what caused the job to hang (and not fail).

I've done a patch in https://github.com/spotify/hdfs2cass/pull/10.

mattnworb commented 9 years ago

I'm glad there is a better fix than mine :) I was simply assuming that throwing any RuntimeException would abort the job.