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

Better error handling for Parallel SQL queries

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 8.0
    • None
    • Parallel SQL
    • None

    Description

      While building examples in Parallel SQL queries, we encountered strange error messages which didn't make sense unless you look deeply into the code, in my case, using debugger on source code to understand better.

      e.g.

      curl --data-urlencode 'stmt=select emp_no_s,emp_no_s from salaries 
          group by emp_no_s
          limit 10' http://localhost:8983/solr/employees/sql?aggregationMode=map_reduce
      

      aggregate-field 'emp_no_s' is asked to group-by twice and hence this is runtime SQL error, while error message received in solr logs:

      Caused by: java.sql.SQLException: Error while executing SQL "select emp_no_s,emp_no_s from salaries 
          group by emp_no_s
          limit 10": 1
              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)
              ... 41 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
              at org.apache.solr.handler.sql.SolrTable.buildBuckets(SolrTable.java:559)
              at org.apache.solr.handler.sql.SolrTable.handleGroupByMapReduce(SolrTable.java:445)
              at org.apache.solr.handler.sql.SolrTable.query(SolrTable.java:135)
              at org.apache.solr.handler.sql.SolrTable.access$100(SolrTable.java:64)
              at org.apache.solr.handler.sql.SolrTable$SolrQueryable.query(SolrTable.java:859)
              at Baz.bind(Unknown Source)
              at org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:335)
              at org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:294)
              at org.apache.calcite.jdbc.CalciteMetaImpl._createIterable(CalciteMetaImpl.java:559)
              at org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:550)
              at org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:204)
              at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67)
              at org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44)
              at org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:630)
              at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:607)
              at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:638)
              at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:149)
              ... 43 more
      

      Attachments

        1. SOLR-12010.patch
          1 kB
          Amrit Sarkar
        2. SOLR-12010.patch
          4 kB
          Amrit Sarkar

        Activity

          People

            Unassigned Unassigned
            sarkaramrit2@gmail.com Amrit Sarkar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: