Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-3219

Concurrency problems using prepared statements on JDBC driver

    XMLWordPrintableJSON

Details

    Description

      Executing selects using JDBC41 driver in a concurrent environment throws exceptions on accessing the result set. Enviroment must match the following:

      1. Concurrency
      2. Use of prepared statements even without parameters (does not happen with statements)
      3. Queries having a very different schema (in column types and number of columns)

      Debugging i have found that when i receive an error there is a S41ForwardResultSet having a m_resultSetMetadata (S41ResultSetMetadata) with the columns of one query and m_parentStatement(S41PreparedStatement) with a m_preparedSql from other query

      Exceptions obtained from the driver are like the following:

      java.sql.SQLException: [Simba][JDBC](10340) Invalid column index: 9.
      	at com.cloudera.exceptions.ExceptionConverter.toSQLException(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.checkIfValidColumnNumber(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.getData(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.getObject(Unknown Source)
      
       [Simba][JDBC](10140) Error converting value to long.
      	at com.cloudera.exceptions.ExceptionConverter.toSQLException(Unknown Source)
      	at com.cloudera.utilities.conversion.TypeConverter.toLong(Unknown Source)
      	at com.cloudera.utilities.conversion.TypeConverter.toObject(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.getObject(Unknown Source)
      
      java.sql.SQLException: [JDBC Driver]1
      	at com.cloudera.hivecommon.api.HS2Client.getData(Unknown Source)
      	at com.cloudera.hivecommon.dataengine.HiveJDBCResultSet.getData(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.getData(Unknown Source)
      	at com.cloudera.jdbc.common.SForwardResultSet.getObject(Unknown Source)
      

      Original use case is a client using connection pool but i managed to reproduce the problem using the Java class attached (Main.java). This class needs to be updated with connection parameters and at least two threads with queries having a very different schema (different data types and column number)

      Attachments

        1. Main.java
          3 kB
          Jacobo Sánchez López

        Activity

          People

            Unassigned Unassigned
            jacobo Jacobo Sánchez López
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: