DataStax Help Center

"Column family [<cf name>] does not exist" for existing table seen when importing via Sqoop

Summary

In DSE 3.2.x Sqoop reports column family does not exist when importing into cassandra even though the table can be seen in cqlsh.

Symptoms

The following error will be seen when running the sqoop import:

15/09/01 14:06:35 DEBUG cassandra.CassandraUtil: Keyspace myks exists
15/09/01 14:06:35 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Error verifying schema.
...
Caused by: InvalidRequestException(why:column family [mytable] does not exist.)
    at org.apache.sqoop.cassandra.CassandraUtil.verifySchema(CassandraUtil.java:203)
    at org.apache.sqoop.mapreduce.CassandraImportJob.jobSetup(CassandraImportJob.java:189)
    ... 12 more

 

Cause

Although the table was created in cqlsh it was not created with the additional 

WITH COMPACT STORAGE

Therefore it was not backwardly compatible with thrift, the import syntax used was as follows:

import
--connect
jdbc:oracle:thin:@localhost:1521/PASSWORD
--username
<USERNAME>
--password
<PASSWORD>
--columns
col1,col2,col3
--table
SOURCETABLE
--cassandra-keyspace
MYKS 
--cassandra-column-family
MYTABLE
--cassandra-thrift-host
localhost
--map-column-java
col3=Integer

Solution

Create the table with the additional

WITH COMPACT STORAGE

Note when using the above option please note the caveats mentioned in the docs as to what can be done with this table once created

 http://docs.datastax.com/en/cql/3.1/cql/cql_reference/create_table_r.html#reference_ds_v3f_vfk_xj__using-compact-storage

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk