question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NPE When Using Table.read().csv()

See original GitHub issue

Using a super basic example provided on tablesaw page I ran across, I get a NPE:

        String location =
                "https://raw.githubusercontent.com/jtablesaw/tablesaw/master/data/bush.csv";
        try (InputStream input = new URL(location).openStream()) {
            Table table = Table.read().csv(input, "test"); // <-- line 39 in stack trace
            Plot.show(TimeSeriesPlot.create("Fox approval ratings", table, "date", "approval"));
        }
Exception in thread "main" java.lang.NullPointerException
	at java.io.FileInputStream.<init>(FileInputStream.java:130)
	at tech.tablesaw.io.csv.CsvReader.getColumnTypes(CsvReader.java:208)
	at tech.tablesaw.io.csv.CsvReader.read(CsvReader.java:121)
	at tech.tablesaw.io.DataFrameReader.csv(DataFrameReader.java:62)
	at tech.tablesaw.io.DataFrameReader.csv(DataFrameReader.java:58)
	at tech.tablesaw.io.DataFrameReader.csv(DataFrameReader.java:50)
	at com.example.main(Test.java:39)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
lwhite1commented, Jan 23, 2019

fixed

0reactions
benmccanncommented, Feb 2, 2019

I’ve released a new version with this fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException exception while reading csv file
I'm trying to calcule the distance and travel time between origins and destinations using the distance matrix API. I used the following code...
Read more >
Csv does not exist or could not be read NullPointerException
I have a .csv file with coordinates information that I want to draw. ... getRowCount() + " total rows in table"); for (TableRow...
Read more >
What Happens behind the Scenes with Spark - Manning
SparkSession spark = SparkSession.builder() . ... At t 4, each task continues by reading a part of the CSV file as illustrated in...
Read more >
Spark Replace NULL Values on DataFrame
DataFrame API provides DataFrameNaFunctions class with fill() function to ... Before we start, Let's read a CSV into Spark DataFrame file, ...
Read more >
Read CSV fails with null pointer exception
The error thar rapid miner shows is: The setup does not seem to contain any obvius error, and in the log says: Log...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found