Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9141

ClassCastException occurs in /sql handler with GROUP BY aggregationMode=facet and single shard

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0
    • None
    • Parallel SQL
    • None

    Description

      ClassCastException occurs in /sql request handler using ORDER BY GROUP BY clause.

      $ curl --data-urlencode "stmt=select count(*) from access_log" "http://localhost:8983/solr/access_log/sql?aggregationMode=facet"
      {"result-set":{"docs":[
      {"count(*)":1309},
      {"EOF":true,"RESPONSE_TIME":239}]}}
      
      $ curl --data-urlencode 'stmt=select response, count(*) as count from access_log group by response' "http://localhost:8983/solr/access_log/sql?aggregationMode=facet"
      {"result-set":{"docs":[
      {"EXCEPTION":"java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long","EOF":true,"RESPONSE_TIME":53}]}}
      

      See following error messages:

      2016-05-19 10:18:06.477 ERROR (qtp1791930789-21) [c:access_log s:shard1 r:core_node1 x:access_log_shard1_replica1] o.a.s.c.s.i.s.ExceptionStream java.io.IOException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
          at org.apache.solr.client.solrj.io.stream.FacetStream.open(FacetStream.java:300)
          at org.apache.solr.handler.SQLHandler$LimitStream.open(SQLHandler.java:1265)
          at org.apache.solr.client.solrj.io.stream.SelectStream.open(SelectStream.java:153)
          at org.apache.solr.handler.SQLHandler$MetadataStream.open(SQLHandler.java:1511)
          at org.apache.solr.client.solrj.io.stream.ExceptionStream.open(ExceptionStream.java:47)
          at org.apache.solr.handler.StreamHandler$TimerStream.open(StreamHandler.java:362)
          at org.apache.solr.response.TextResponseWriter.writeTupleStream(TextResponseWriter.java:301)
          at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:167)
          at org.apache.solr.response.JSONWriter.writeNamedListAsMapWithDups(JSONResponseWriter.java:183)
          at org.apache.solr.response.JSONWriter.writeNamedList(JSONResponseWriter.java:299)
          at org.apache.solr.response.JSONWriter.writeResponse(JSONResponseWriter.java:95)
          at org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:60)
          at org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:65)
          at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:725)
          at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:469)
          at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:229)
          at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:184)
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
          at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:308)
          at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:262)
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
          at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
          at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
          at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
          at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)
          at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
          at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
          at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
          at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
          at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
          at org.eclipse.jetty.server.Server.handle(Server.java:518)
          at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
          at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)
          at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
          at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
          at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
          at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:246)
          at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:156)
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
          at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
          at org.apache.solr.client.solrj.io.stream.FacetStream.fillTuples(FacetStream.java:461)
          at org.apache.solr.client.solrj.io.stream.FacetStream.getTuples(FacetStream.java:420)
          at org.apache.solr.client.solrj.io.stream.FacetStream.open(FacetStream.java:297)
          ... 43 more
      

      Attachments

        1. SOLR-9141.patch
          1 kB
          Minoru Osuka
        2. SOLR-9141-test.patch
          1 kB
          James Dyer
        3. SOLR-9141-test.patch
          9 kB
          James Dyer
        4. SOLR-9141.patch
          9 kB
          James Dyer
        5. SOLR-9141.patch
          9 kB
          James Dyer

        Activity

          People

            jdyer James Dyer
            minoru Minoru Osuka
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: