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

Solr SQL doesn't support DESCRIBE table syntax

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Parallel SQL

    Description

      Ugh. Just tried DESCRIBE <table> and got back:

      2021-11-16 16:28:22.141 ERROR (qtp414225167-147) [c:books s:shard1 r:core_node2 x:books_shard1_replica_n1] o.a.s.c.s.i.s.ExceptionStream java.io.IOException: Failed to execute sqlQuery 'DESCRIBE books' against JDBC connection 'jdbc:calcitesolr:'.
      Caused by: Error while executing SQL "DESCRIBE books": From line 1, column 10 to line 1, column 14: Column 'books' not found in any table => java.io.IOException: Failed to execute sqlQuery 'DESCRIBE books' against JDBC connection 'jdbc:calcitesolr:'.
      Caused by: Error while executing SQL "DESCRIBE books": From line 1, column 10 to line 1, column 14: Column 'books' not found in any table
      java.io.IOException: Failed to execute sqlQuery 'DESCRIBE books' against JDBC connection 'jdbc:calcitesolr:'.
      Caused by: Error while executing SQL "DESCRIBE books": From line 1, column 10 to line 1, column 14: Column 'books' not found in any table
      	at org.apache.solr.client.solrj.io.stream.JDBCStream.open(JDBCStream.java:286) ~[?:?]
      	at org.apache.solr.client.solrj.io.stream.ExceptionStream.open(ExceptionStream.java:52) ~[?:?]
      	at org.apache.solr.handler.StreamHandler$TimerStream.open(StreamHandler.java:462) ~[?:?]
      	at org.apache.solr.client.solrj.io.stream.TupleStream.writeMap(TupleStream.java:82) ~[?:?]
      	at org.apache.solr.common.util.JsonTextWriter.writeMap(JsonTextWriter.java:163) ~[?:?]
      	at org.apache.solr.common.util.TextWriter.writeMap(TextWriter.java:219) ~[?:?]
      	at org.apache.solr.common.util.TextWriter.writeVal(TextWriter.java:72) ~[?:?]
      	at org.apache.solr.response.TextResponseWriter.writeVal(TextResponseWriter.java:153) ~[?:?]
      	at org.apache.solr.common.util.JsonTextWriter.writeNamedListAsMapWithDups(JsonTextWriter.java:385) ~[?:?]
      	at org.apache.solr.common.util.JsonTextWriter.writeNamedList(JsonTextWriter.java:291) ~[?:?]
      	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) ~[?:?]
      
      Caused by: java.sql.SQLException: Error while executing SQL "DESCRIBE books": From line 1, column 10 to line 1, column 14: Column 'books' not found in any table
      	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:163) ~[?:?]
      	at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227) ~[?:?]
      	at org.apache.solr.client.solrj.io.stream.JDBCStream.open(JDBCStream.java:283) ~[?:?]
      	... 55 more
      Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 10 to line 1, column 14: Column 'books' not found in any table
      	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
      	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
      	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:506) ~[?:?]
      	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:917) ~[?:?]
      	at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:902) ~[?:?]
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5271) ~[?:?]
      	at org.apache.calcite.sql.validate.DelegatingScope.fullyQualify(DelegatingScope.java:273) ~[?:?]
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateIdentifier(SqlValidatorImpl.java:3211) ~[?:?]
      	at org.apache.calcite.sql.SqlIdentifier.validateExpr(SqlIdentifier.java:305) ~[?:?]
      	at org.apache.calcite.sql.SqlOperator.validateCall(SqlOperator.java:472) ~[?:?]
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateCall(SqlValidatorImpl.java:5951) ~[?:?]
      	at org.apache.calcite.sql.SqlCall.validate(SqlCall.java:138) ~[?:?]
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1044) ~[?:?]
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:750) ~[?:?]
      	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:585) ~[?:?]
      	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:251) ~[?:?]
      	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:215) ~[?:?]
      	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647) ~[?:?]
      	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:513) ~[?:?]
      	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:483) ~[?:?]
      	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:249) ~[?:?]
      	at  ...
      

      Solr has a schema, so we should be able to produce a description of the table!

      Attachments

        Issue Links

          Activity

            People

              thelabdude Timothy Potter
              thelabdude Timothy Potter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m