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.

Null pointer exception for PagesSpatialIndexSupplier.getEnvelope

See original GitHub issue

I’m running a spatial join with the rtree index by following this improvement My query is: select * from points u, polygons v where st_contains(ST_GeometryFromText(v.wkt), ST_Point(u.longitude, u.latitude))

And it throws the

Query 20190913_052524_00112_ts9wn failed: Internal error
java.lang.NullPointerException
        at com.facebook.presto.operator.PagesSpatialIndexSupplier.getEnvelope(PagesSpatialIndexSupplier.java:149)
        at com.facebook.presto.operator.PagesSpatialIndexSupplier.buildRTree(PagesSpatialIndexSupplier.java:139)
        at com.facebook.presto.operator.PagesSpatialIndexSupplier.<init>(PagesSpatialIndexSupplier.java:94)
        at com.facebook.presto.operator.PagesIndex.createPagesSpatialIndex(PagesIndex.java:471)
        at com.facebook.presto.operator.SpatialIndexBuilderOperator.finish(SpatialIndexBuilderOperator.java:233)
        at com.facebook.presto.operator.Driver.processInternal(Driver.java:397)
        at com.facebook.presto.operator.Driver.lambda$processFor$8(Driver.java:283)
        at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:675)
        at com.facebook.presto.operator.Driver.processFor(Driver.java:276)
        at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
        at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
        at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:483)
        at com.facebook.presto.$gen.Presto_0_220____20190910_150639_1.run(Unknown Source)
        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)

All my points and polygons are valid and I’m not sure why it throws null pointer exceptions.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
liusztc09commented, Sep 16, 2019

@jagill Thank you for quick fix! Yes, I narrow down my data and it is geometry collections causing that issue. Looking forward to your fix 😃

1reaction
jagillcommented, Sep 16, 2019

@liusztc09 Thank you for this test case. The issue is that we weren’t handling GeometryCollections correctly (they require special handling): I’m submitting a fix for it. Until the fix is landed, you can work around it by unnesting your Geometry Collections (or converting them to a homogeneous MultiGeometry), if that’s possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >
java - What is a NullPointerException, and how do I fix it?
A null pointer exception is thrown when an application attempts to use null in a case where an object is required. These include:...
Read more >
Null pointer exception when processing ACH file - IBM
Symptom. ACH Deenvelope recevied critical error processing: Null Pointer Exception. Envelope configuration for the Inbound ACH Batch/Entry ...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException is an unchecked exception, so we don't have to catch it. The null pointer exceptions can be prevented using null checks and ......
Read more >
NullPointerException (Java Platform SE 7 ) - Oracle Help Center
public class NullPointerException extends RuntimeException. Thrown when an application attempts to use null in a case where an object is required.
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