lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Minoru Osuka (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-9141) ClassCastException occurs in /sql handler with GROUP BY aggregationMode=facet and single shard
Date Thu, 26 May 2016 13:48:12 GMT

    [ https://issues.apache.org/jira/browse/SOLR-9141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302079#comment-15302079
] 

Minoru Osuka commented on SOLR-9141:
------------------------------------

‚Äč[~joel.bernstein], +1. ((Number)bucket.get("count")).longValue(); seems faster than my
patch (on my Macbook).

{noformat}
package test;

import java.util.ArrayList;
import java.util.List;

public class CastTest {
	public static void main(String[] args) {
		List<Object> objList = new ArrayList<Object>();
		for (int i = 0; i < 10000; i++) {
			objList.add(new Integer(i));
		}

		long start = System.nanoTime();
		for (Object obj : objList) {
			long l = new Long(obj.toString()).longValue();
		}
		long end = System.nanoTime();
		System.out.println(String.format("new Long(obj.toString()).longValue(); : %1$,10d ns", (end
- start)));

		start = System.nanoTime();
		for (Object obj : objList) {
			long l = ((Number)obj).longValue();
		}
		end = System.nanoTime();
		System.out.println(String.format("((Number)obj).longValue();            : %1$,10d ns", (end
- start)));
	}
}
{noformat}

{noformat}
new Long(obj.toString()).longValue(); : 11,301,332 ns
((Number)obj).longValue();            :    831,366 ns
{noformat}


> ClassCastException occurs in /sql handler with GROUP BY aggregationMode=facet and single
shard
> ----------------------------------------------------------------------------------------------
>
>                 Key: SOLR-9141
>                 URL: https://issues.apache.org/jira/browse/SOLR-9141
>             Project: Solr
>          Issue Type: Bug
>          Components: Parallell SQL
>    Affects Versions: 6.0
>            Reporter: Minoru Osuka
>            Assignee: Joel Bernstein
>         Attachments: SOLR-9141-test.patch, SOLR-9141-test.patch, SOLR-9141.patch
>
>
> ClassCastException occurs in /sql request handler using -ORDER BY- GROUP BY clause.
> {noformat}
> $ 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}]}}
> {noformat}
> See following error messages:
> {noformat}
> 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
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message