Github user gardellajuanpablo commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2507#discussion_r174227238
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/JdbcCommon.java
 ---
    @@ -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 
support
    +     *         {@link ResultSetMetaData#getTableName(int)}.
    +     */
    +    private static String getTableNameFromMeta(final ResultSetMetaData 
meta) {
    +        try {
    +            return meta.getTableName(1);
    +        } catch (SQLException e) {
    +            return "";
    --- End diff --
    
    Awesome feedback, thanks. It makes sense to me. 
    
    May I ask if we can apply these changes later in another JIRA? I'm asking 
because in current state, we cannot use it in Hive. But, as you describe above, 
maybe the patch, in some scenarios, it could cause problems.
    
    The changes I suggested are working now in our environment (actually it 
requires 
https://issues.apache.org/jira/browse/NIFI-2575?focusedCommentId=16382049&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16382049
 patch).  
    
    I will try to work on your feedback if you think the patch should not be 
used as is. 


---

Reply via email to