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

    https://github.com/apache/nifi/pull/2695#discussion_r189075604
  
    --- Diff: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java
 ---
    @@ -311,7 +340,15 @@ private void onTrigger(final ProcessContext context, 
final ProcessSession sessio
             try (final Connection con = 
dbcpService.getConnection(fileToProcess == null ? Collections.emptyMap() : 
fileToProcess.getAttributes());
                  final Statement st = (flowbased ? 
con.prepareStatement(selectQuery) : con.createStatement())
             ) {
    -
    +            Pair<String,SQLException> failure = 
executeConfigStatements(con, preQueries);
    +            if (failure != null) {
    +                // In case of failure, assigning config query to 
"selectQuery" var will allow to avoid major changes in error handling (catch 
block),
    --- End diff --
    
    @pvillard31 , I think if I just rename this var into "hqlStatement" - that 
will remove confusions and make reusing it for pre- and post- queries natural. 
Going to push updates for this.


---

Reply via email to