brianmhess / cassandra-loader

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

ExecutionException java.lang.NullPointerException #86

Open jcompte2 opened 6 years ago

jcompte2 commented 6 years ago

When the schema doesn't include column names:

Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.NullPointerException 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:402) at com.datastax.loader.CqlDelimUnload.main(CqlDelimUnload.java:471) Caused by: java.lang.NullPointerException at com.datastax.loader.CqlDelimParser.schemaBits(CqlDelimParser.java:226) at com.datastax.loader.CqlDelimParser.processCqlSchema(CqlDelimParser.java:194) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

brianmhess commented 6 years ago

Can you share the command-line you used?

KevinGevers commented 5 years ago

I run into a very simular issue when trying to use the program.

sudo ./cassandra-loader -f House1.csv -host 172.21.0.2 -schema "appliances.house1"

Cassandra can load House1.csv with Copy but it takes over 3 min. So the file is fine. Cassandra itself is running in a docker and I confirmed the ip. The namespace and table have been made beforehand.

For completeness sake: 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.CqlDelimLoad.run(CqlDelimLoad.java:659) at com.datastax.loader.CqlDelimLoad.main(CqlDelimLoad.java:704) 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.CqlDelimLoadTask.setup(CqlDelimLoadTask.java:189) at com.datastax.loader.CqlDelimLoadTask.call(CqlDelimLoadTask.java:152) at com.datastax.loader.CqlDelimLoadTask.call(CqlDelimLoadTask.java:53) 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)

EDIT: running an alternative query: ./cassandra-loader -f House1cutHeader.csv -host 172.21.0.2 -schema "appliances.house1(Aggregate, Fridge, Freezer1, Freezer2, WasherDryer, WashingMachine, Dishwasher, Computer, Television, Heater, Random)"

gives me the same nullpointer exception as the OP:

Exception in thread "main" java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at com.datastax.loader.CqlDelimLoad.run(CqlDelimLoad.java:659) at com.datastax.loader.CqlDelimLoad.main(CqlDelimLoad.java:704) Caused by: java.lang.NullPointerException at com.datastax.loader.CqlDelimParser.schemaBits(CqlDelimParser.java:227) at com.datastax.loader.CqlDelimParser.processCqlSchema(CqlDelimParser.java:194) at com.datastax.loader.CqlDelimParser.(CqlDelimParser.java:82) at com.datastax.loader.CqlDelimLoadTask.setup(CqlDelimLoadTask.java:189) at com.datastax.loader.CqlDelimLoadTask.call(CqlDelimLoadTask.java:152) at com.datastax.loader.CqlDelimLoadTask.call(CqlDelimLoadTask.java:53) 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)