This query is directly from a web browser to eliminate any downstream
components (we use Talend ESB to read / write data into our web
application)

Any of these queries fail -

the URL format is

http://localhost:8983/solr/data/sql?stmt=select id from data limit 10

http://localhost:8983/solr/data/sql?stmt=select * from data limit 10

http://localhost:8983/solr/data/sql?stmt=select id, WellboreUWI, SystemID,
datatype from data where datatype='Well'  limit 10

- As mentioned if I export and import the records any of those queries will
then work

Here is the trace from solr.log

Error while executing SQL "select id from data limit 10": null
at
org.apache.solr.client.solrj.io.stream.JDBCStream.open(JDBCStream.java:271)
at
org.apache.solr.client.solrj.io.stream.ExceptionStream.open(ExceptionStream.java:54)
at
org.apache.solr.handler.StreamHandler$TimerStream.open(StreamHandler.java:394)
at
org.apache.solr.client.solrj.io.stream.TupleStream.writeMap(TupleStream.java:78)
at
org.apache.solr.common.util.JsonTextWriter.writeMap(JsonTextWriter.java:164)
at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:69)
at
org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:152)
at
org.apache.solr.common.util.JsonTextWriter.writeNamedListAsMapWithDups(JsonTextWriter.java:386)
at
org.apache.solr.common.util.JsonTextWriter.writeNamedList(JsonTextWriter.java:292)
at org.apache.solr.response.JSONWriter.writeResponse(JSONWriter.java:73)
at
org.apache.solr.response.JSONResponseWriter.write(JSONResponseWriter.java:66)
at
org.apache.solr.response.QueryResponseWriterUtil.writeQueryResponse(QueryResponseWriterUtil.java:65)
at org.apache.solr.servlet.HttpSolrCall.writeResponse(HttpSolrCall.java:788)
at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:525)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:395)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:341)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
at
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
at
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:502)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:132)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Error while executing SQL "select id from
data limit 10": null
at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
at
org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:218)
at
org.apache.solr.client.solrj.io.stream.JDBCStream.open(JDBCStream.java:269)
... 48 more
Caused by: java.lang.NullPointerException
at
org.apache.solr.handler.sql.SolrSchema.getRelDataType(SolrSchema.java:103)
at org.apache.solr.handler.sql.SolrTable.getRowType(SolrTable.java:83)
at org.apache.calcite.sql.validate.EmptyScope.resolve_(EmptyScope.java:159)
at
org.apache.calcite.sql.validate.EmptyScope.resolveTable(EmptyScope.java:99)
at
org.apache.calcite.sql.validate.DelegatingScope.resolveTable(DelegatingScope.java:202)
at
org.apache.calcite.sql.validate.IdentifierNamespace.resolveImpl(IdentifierNamespace.java:104)
at
org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:167)
at
org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:939)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:920)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2954)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2939)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3181)
at
org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60)
at
org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:939)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:920)
at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:220)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:895)
at
org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:605)
at
org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:550)
at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:264)
at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:228)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:784)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:639)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:609)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214)
at
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:603)
at
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
... 50 more


On Thu, 18 Apr 2019 at 10:46, Joel Bernstein <joels...@gmail.com> wrote:

> This let's make sure the jdbc URL is correct.
>
> Reloading the collection shouldn't effect much unless the schema is
> different.
>
> But as Shawn mentioned the stack trace is not coming from Solr. Is there
> more in the logs beyond the Calcite exception?
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Thu, Apr 18, 2019 at 11:04 AM Shawn Heisey <apa...@elyograg.org> wrote:
>
> > On 4/18/2019 1:47 AM, David Barnett wrote:
> > > I have a large solr 7.3 collection 400m + documents.
> > >
> > > I’m trying to use the Solr JDBC driver to query the data but I get a
> > >
> > > java.io.IOException: Failed to execute sqlQuery 'select id from
> document
> > limit 10' against JDBC connection 'jdbc:calcitesolr:'.
> > > Error while executing SQL "select id from document limit 10": null
> >
> > <snip>
> >
> > By the way, either that JDBC url is extremely incomplete or you nuked it
> > from the log before sharing.  Seeing the construction of the full URL
> > might be helpful.  If you need to redact it in some way for privacy
> > concerns, do so in a way so that we can still tell what the URL was -
> > change a real password to PASSWORD, change things like host names to
> > something like HOST_NAME, etc.
> >
> > > Caused by: java.lang.NullPointerException
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.validate(VolcanoPlanner.java:891
> > >          at
> >
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:866)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:883)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:101)
> > >          at
> >
> org.apache.calcite.rel.AbstractRelNode.onRegister(AbstractRelNode.java:336)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1496)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:863)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:883)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:101)
> > >          at
> >
> org.apache.calcite.rel.AbstractRelNode.onRegister(AbstractRelNode.java:336)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1496)
> > >          at
> >
> org.apache.calcite.plan.volcano.VolcanoPlanner.setRoot(VolcanoPlanner.java:308)
> > >          at org.apache.calcite.tools.Programs$5.run(Programs.java:309)
> > >          at
> > org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:387)
> > >          at
> org.apache.calcite.prepare.Prepare.optimize(Prepare.java:186)
> > >          at
> > org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:319)
> > >          at
> > org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:228)
> > >          at
> >
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:784)
> > >          at
> >
> org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:639)
> > >          at
> >
> org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:609)
> > >          at
> >
> org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214)
> > >          at
> >
> org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:603)
> > >          at
> >
> org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
> > >          at
> >
> org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
> >
> > The root cause is an NPE in pure calcite code (no Solr classes listed).
> > Calcite didn't like the SQL query for some reason.  I'm not at all
> > familiar with Calcite.
> >
> > Did you try to query a single core (shard replica) rather than the
> > collection?  I wonder if doing that might make the driver think it's not
> > talking to SolrCloud.  Joel is the expert here, I don't know much about
> it.
> >
> > What context is this being used in?  The dataimport handler, or
> > something you wrote yourself?  I don't know if this information is
> > important, just trying to provide as much information for Joel as I can.
> >
> > Thanks,
> > Shawn
> >
>


-- 
*David Barnett*
O&G Technology Consulting Ltd
oand...@gmail.com
+44 (0) 7753 235608

Reply via email to