brianmhess / cassandra-loader

Delimited file loader for Cassandra
Apache License 2.0
197 stars 93 forks source link

java.lang.StringIndexOutOfBoundsException: String index out of range: -2 When I run: ./cassandra-unloader -f stdout -host xx.xxx.xx.xxx -port 9042 -user admin -pw xxxxxx -schema "keyspace.table" #93

Closed kunal-plume closed 6 years ago

kunal-plume commented 6 years ago

I downloaded the version through wget as provided in the readme.

Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.datastax.loader.CqlDelimUnload.run(CqlDelimUnload.java:456) at com.datastax.loader.CqlDelimUnload.main(CqlDelimUnload.java:471) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2 at java.lang.String.substring(String.java:1967) at com.datastax.loader.CqlDelimParser.processCqlSchema(CqlDelimParser.java:191) at com.datastax.loader.CqlDelimParser.(CqlDelimParser.java:82) at com.datastax.loader.CqlDelimUnload$ThreadExecute.setup(CqlDelimUnload.java:561) at com.datastax.loader.CqlDelimUnload$ThreadExecute.call(CqlDelimUnload.java:531) at com.datastax.loader.CqlDelimUnload$ThreadExecute.call(CqlDelimUnload.java:479) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

jcross-linkup commented 6 years ago

You have to specify the columns you want. A schema of just "keyspace.table" will give you that error. Try "keyspace.table(col1, col2)" etc.

kunal-plume commented 6 years ago

Thanks a ton!