Trying to work on HIVE-1378. My first step is to get the Hive JDBC driver to return actual values for mapcol in the result set of "select mapcol, bigintcol, stringcol from foo", where mapcol is a map<string,string> column, instead of the current behavior of complaining that mapcol's column type is not recognized.
I changed HiveResultSetMetaData.{getColumnType,getColumnTypeName} to recognize the map type, but then the returned value for mapcol is always {}, even though mapcol does contain some key-value entries. Turns out this is happening in HiveQueryResultSet.next: 1. The call to client.fetchOne returns the string "{"a":"b","x":"y"} 123 abc". 2. The serde (DynamicSerDe ds) deserializes the string to the list [{},123,"abc"]. The serde cannot correctly deserialize the map because apparently the map is not in the serde's expected serialization format. The serde has been initialized with TCTLSeparatedProtocol. Should we make client.fetchOne return a ctrl-separated string? Or should we use a different serde/format in HiveQueryResultSet? It seems the first way is right; correct me if that's wrong. And how do we do that? Thanks. Steven