NPE Exception in Java client with nested query

When I switched over to the 90.0 version from 20.4, I started seeing some
null pointer exceptions in the Java client from my integration tests. The
problem is not reproducible using the REST API.

It seems to occur when you do a nested query against multiple indices and
one of the indices has no documents that match a query (but does have some
documents in it).

The problem occurs in the AggregatedDfs.writeTo method because of the
entries in the fieldStatistics map has an entry with a null key.

A highly abbreviated call stack of where the exception occurs:
at
org.elasticsearch.common.io.stream.HandlesStreamOutput.writeString(HandlesStreamOutput.java:55)
at
org.elasticsearch.search.dfs.AggregatedDfs.writeTo(AggregatedDfs.java:106)
at
org.elasticsearch.search.query.QuerySearchRequest.writeTo(QuerySearchRequest.java:69)
at
org.elasticsearch.transport.netty.NettyTransport.sendRequest(NettyTransport.java:546)

I've created a Gist that reproduces the problem:

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Nice finding, I think it would be a good thing to open an issue on
github with the full stack trace.

Jörg

Am 08.05.13 20:38, schrieb JBartak:

When I switched over to the 90.0 version from 20.4, I started seeing
some null pointer exceptions in the Java client from my integration
tests. The problem is not reproducible using the REST API.

It seems to occur when you do a nested query against multiple indices
and one of the indices has no documents that match a query (but does
have some documents in it).

The problem occurs in the AggregatedDfs.writeTo method because of the
entries in the fieldStatistics map has an entry with a null key.

A highly abbreviated call stack of where the exception occurs:
at
org.elasticsearch.common.io.stream.HandlesStreamOutput.writeString(HandlesStreamOutput.java:55)
at
org.elasticsearch.search.dfs.AggregatedDfs.writeTo(AggregatedDfs.java:106)
at
org.elasticsearch.search.query.QuerySearchRequest.writeTo(QuerySearchRequest.java:69)
at
org.elasticsearch.transport.netty.NettyTransport.sendRequest(NettyTransport.java:546)

I've created a Gist that reproduces the problem:
ES0.90.0 NPE.txt · GitHub

You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Posted in https://github.com/elasticsearch/elasticsearch/issues/3014

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.