You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by Charuta Rajopadhye <ch...@gmail.com> on 2017/10/04 09:16:02 UTC

Resolving Maps in RecordReader

Hi Team,

I am trying to implement storage plugin for a custom database. It supports
objects, as datatype. As it uses Postgres JDBC driver, i am using the JDBC
storage plugin for reference.
In the RecordReader, for the datatype JAVA_OBJECT, i convert it into a
string and pass it to the VarChar Copier.
The result set has the entire object ( internally a Map ) though, which i
parse, match the column name with the keys in the map and dispay the value
in the respective column.

But when there are columns with same name in the query or AS is used in the
query, drill renames them/suffixes them with ints, in order to identify
them uniquely. In this case, the column name and key in the map differs, i
cannot string match and display the value.
I tried checking the ResultSetMetaData but getColumnLabel and getColumnName
return the same  string.
I also referred the dynamo db storage plugin
<https://github.com/jyates/drill-dynamo-adapter>, Objects/Maps seem to be
resolved here, but not to much avail.
Can anybody please suggest a way around this?

Thanks,
Charuta