Github user mattyb149 commented on a diff in the pull request:
    --- Diff: 
    @@ -859,4 +859,33 @@ public static DateTimeFormatter 
getDateTimeFormatter(String pattern) {
             void processRow(ResultSet resultSet) throws IOException;
    +    /**
    +     * Returns the table name.
    +     * 
    +     * @param meta
    +     *            - metadata
    +     * @return the table name or an empty string if the driver does not 
    +     *         {@link ResultSetMetaData#getTableName(int)}.
    +     */
    +    private static String getTableNameFromMeta(final ResultSetMetaData 
meta) {
    +        try {
    +            return meta.getTableName(1);
    +        } catch (SQLException e) {
    +            return "";
    --- End diff --
    Not having the table name can cause problems with state in the DB fetch 
processors. If you have two tables with the same max-value column name, the 
state can get corrupted since we use the table name + column name as a key to 
store the max value (and column type). In 
 we know it's a Hive ResultSet so we can get the table name as the prefix of 
each column name, and each column name as the suffix.
    Ideally, at least for the DB fetch processors, we'd have a Hive DB Adapter 
like we do for Oracle, MySQL, etc. and we can ask it to give us the table name 
from the metadata (and also whether isSigned is supported). That was the goal 
of #1281 , but in order to support ExecuteSQL, he added the Database Adapter 
property and had it become a "DB fetch processor" in order to use some of the 
other common logic.
    What do you think about starting with #1281, creating your own branch from 
it, rebasing against master, and fixing whatever issues you find? That PR has 
the same issue with setQueryTimeout so I'd like to see that handled using the 
approach from #2138.


Reply via email to