Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

A call to getMetaData().GetColumns() via JDBC is causing an IndexOutOfBoundsException in Impala

Highlighted

A call to getMetaData().GetColumns() via JDBC is causing an IndexOutOfBoundsException in Impala

Explorer

I'm working with a customer who is on Impala (version 2.2.0-cdh5.4.4).

 

Our BI tool connects to Impala via JDBC, and at the beginning of a project the application makes metadata calls to get the schemas, tables, columns, and their types to begin the modeling process.

 

I haven't been able to reproduce this in house, but when the customer begins this process, there is an IndexOutOfBoundsException in Impala's logs. The response from Impala then crashes the JDBC drivers. (We use Hive drivers, not the Simba driver.)

 

Is this a known issue? I believe the customer is going to file a support ticket as well.

 

Here are parts of the Impala logs:

####################################################
## This is the call to getTables()
##
## http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[])
####################################################
I0909 10:16:29.916298 16397 impala-hs2-server.cc:813] GetTables(): request=TGetTablesReq {
  01: sessionHandle (struct) = TSessionHandle {
    01: sessionId (struct) = THandleIdentifier {
      01: guid (string) = "\n\xdeB\xcc\x81\xc2J~\x91\x93\xab\xdbM$\xc0\x13",
      02: secret (string) = "\t\xd0\xea9\xf42M\xad\xb5\xccKB?B\xb3#",
    },
  },
  03: schemaName (string) = "%",
  05: tableTypes (list) = list<string>[2] {
    [0] = "TABLE",
    [1] = "VIEW",
  },
}
I0909 10:16:29.981684 16397 MetadataOp.java:464] Returning 531 tables
I0909 10:16:29.990187 16397 impala-hs2-server.cc:826] GetTables(): return_val=TGetTablesResp {
  01: status (struct) = TStatus {
    01: statusCode (i32) = 0,
  },
  02: operationHandle (struct) = TOperationHandle {
    01: operationId (struct) = THandleIdentifier {
      01: guid (string) = "\xd5\xd0\xd9\x15\xe7pGh\x956N\x90%\xcd\r\xb9",
      02: secret (string) = "\xd5\xd0\xd9\x15\xe7pGh\x956N\x90%\xcd\r\xb9",
    },
    02: operationType (i32) = 4,
    03: hasResultSet (bool) = true,
  },
}
####################################################
## This is the call to getColumns()
##
## http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)
####################################################
I0909 10:16:37.871415 16398 impala-hs2-server.cc:850] GetColumns(): request=TGetColumnsReq {
  01: sessionHandle (struct) = TSessionHandle {
    01: sessionId (struct) = THandleIdentifier {
      01: guid (string) = "\x96\x19Y\xc20\xf9@'\x87\xc3Q\xf0c\x84\x80\x80",
      02: secret (string) = "\x85\xe98h\xbd\xa9I#\xbe\x8b\xb7\xd0<X}\x88",
    },
  },
  03: schemaName (string) = "default",
}
I0909 10:16:37.908409 16398 jni-util.cc:177] java.lang.IndexOutOfBoundsException: Index: 138, Size: 138
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at com.cloudera.impala.service.MetadataOp.getColumns(MetadataOp.java:350)
    at com.cloudera.impala.service.Frontend.execHiveServer2MetadataOp(Frontend.java:1037)
    at com.cloudera.impala.service.JniFrontend.execHiveServer2MetadataOp(JniFrontend.java:467)
I0909 10:16:37.909272 16398 status.cc:114] IndexOutOfBoundsException: Index: 138, Size: 138
    @           0x78bdb3  (unknown)
    @           0xa6a805  (unknown)
    @           0x980e89  (unknown)
    @           0x9ee409  (unknown)
    @           0x9d3d4d  (unknown)
    @           0x9d48c8  (unknown)
    @           0xb3d401  (unknown)
    @           0xb2eaa4  (unknown)
    @           0x9ae92b  (unknown)
    @          0x15748b9  (unknown)
    @          0x156064f  (unknown)
    @          0x1562594  (unknown)
    @           0x92e883  (unknown)
    @           0x92efea  (unknown)
    @           0xaa74da  (unknown)
    @           0xaa9660  (unknown)
    @           0xcaa633  (unknown)
    @       0x3504207851  (unknown)
    @       0x3503ae890d  (unknown)
I0909 10:16:37.909283 16398 impala-server.cc:827] UnregisterQuery(): query_id=8d48ececfe041a99:c60eab4411cf699c
I0909 10:16:37.909291 16398 impala-server.cc:896] Cancel(): query_id=8d48ececfe041a99:c60eab4411cf699c
I0909 10:16:37.909625 16398 impala-hs2-server.cc:863] GetColumns(): return_val=TGetColumnsResp {
  01: status (struct) = TStatus {
    01: statusCode (i32) = 3,
    03: sqlState (string) = "HY000",
    05: errorMessage (string) = "IndexOutOfBoundsException: Index: 138, Size: 138\n",
  },
  02: operationHandle (struct) = TOperationHandle {
    01: operationId (struct) = THandleIdentifier {
      01: guid (string) = "",
      02: secret (string) = "",
    },
    02: operationType (i32) = 6,
    03: hasResultSet (bool) = false,
  },
}

 

1 REPLY 1

Re: A call to getMetaData().GetColumns() via JDBC is causing an IndexOutOfBoundsException in Impala

Explorer

After some additional investigating on site we discovered that the crash happens when the call to getColumns is made with nil, '', or '%' passed to the table name filter. If a table name is used then there is no crash. (I say nil because the app is making the call from JRuby.)

Don't have an account?
Coming from Hortonworks? Activate your account here