Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

landonvg_125049 avatar image
landonvg_125049 asked ·

Error when faceting with "missing":true

Using DSE 5.1.15, when I attempt to do a Solr query that includes missing facets, I get a null-pointer exception. Here's an example:

cqlsh> select * from group where solr_query='{"q":"id:*","facet":{"field":"s_pr3","missing":true}}';
ServerError: com.fasterxml.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]

I assume the NPE is due to the null value that it's trying to serialize into JSON as the facet field name. I can work around this by using `pivot` instead of `field`, but I don't want to pivot, just use simple field facets.

https://datastaxacademy.slack.com/archives/C27T9EEP9/p1561130834018700

Here is the stack trace from system.log:

ERROR [Native-Transport-Requests-1] 2019-06-21 15:10:32,548  CqlSolrQueryExecutor.java:436 - com.fasterxml.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]
java.lang.RuntimeException: com.fasterxml.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler.handle(FacetResponseHandler.java:109)
        at com.datastax.bdp.search.solr.cql.CustomPayloadResponseDecorator.handle(CustomPayloadResponseDecorator.java:37)
        at com.datastax.bdp.search.solr.cql.CqlSolrQueryExecutor.handleSolrResponse(CqlSolrQueryExecutor.java:421)
        at com.datastax.bdp.search.solr.cql.CqlSolrQueryExecutor.execute(CqlSolrQueryExecutor.java:134)
        at com.datastax.bdp.cassandra.cql3.SolrOperationFactory$SolrStatementExecution.execute(SolrOperationFactory.java:74)
        at com.datastax.bdp.cassandra.cql3.DseQueryHandler$Operation.executeWithTiming(DseQueryHandler.java:388)
        at com.datastax.bdp.cassandra.cql3.DseQueryHandler$Operation.executeAndMaybeWriteToAuditLog(DseQueryHandler.java:439)
        at com.datastax.bdp.cassandra.cql3.DseQueryHandler.process(DseQueryHandler.java:165)
        at com.datastax.bdp.cassandra.cql3.DseQueryHandler.process(DseQueryHandler.java:116)
        at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:112)
        at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:548)
        at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:442)
        at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
        at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35)
        at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:347)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
        at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: [no message for java.lang.NullPointerException]
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._wrapAsIOE(DefaultSerializerProvider.java:509)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:482)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2643)
        at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:381)
        at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1726)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler$NamedListSerializer.serialize(FacetResponseHandler.java:152)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler$NamedListSerializer.serialize(FacetResponseHandler.java:138)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
        at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3893)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3207)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler.fillFacetColumns(FacetResponseHandler.java:133)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler.handle(FacetResponseHandler.java:97)
        ... 20 common frames omitted
Caused by: java.lang.NullPointerException: null
        at com.fasterxml.jackson.core.json.WriterBasedJsonGenerator._writeString(WriterBasedJsonGenerator.java:964)
        at com.fasterxml.jackson.core.json.WriterBasedJsonGenerator._writeFieldName(WriterBasedJsonGenerator.java:174)
        at com.fasterxml.jackson.core.json.WriterBasedJsonGenerator.writeFieldName(WriterBasedJsonGenerator.java:139)
        at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1725)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler$NamedListSerializer.serialize(FacetResponseHandler.java:152)
        at com.datastax.bdp.search.solr.cql.FacetResponseHandler$NamedListSerializer.serialize(FacetResponseHandler.java:138)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
        ... 32 common frames omitted
faceting
3 comments
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

@landonvg_125049 could you post the full error message with stack trace from the system.log?

0 Likes 0 · ·

@Erick Ramirez added stack trace to initial post.

1 Like 1 · ·

@landonvg_125049 FYI I'm asking internally at DataStax for a response.

0 Likes 0 · ·

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

Thanks for bringing this to our attention. We can confirm that this is a bug and we have logged a new ticket. The internal DataStax ID is DSP-19351. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.