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

    https://github.com/apache/nifi/pull/3075#discussion_r233524164
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GenerateTableFetch.java
 ---
    @@ -450,7 +450,33 @@ public void onTrigger(final ProcessContext context, 
final ProcessSessionFactory
     
                     // If there are no SQL statements to be generated, still 
output an empty flow file if specified by the user
                     if (numberOfFetches == 0 && 
outputEmptyFlowFileOnZeroResults) {
    -                    session.transfer((fileToProcess == null) ? 
session.create() : session.create(fileToProcess), REL_SUCCESS);
    +                    FlowFile emptyFlowFile = (fileToProcess == null) ? 
session.create() : session.create(fileToProcess);
    +                    Map<String, String> attributesToAdd = new HashMap<>();
    +
    +                    attributesToAdd.put("generatetablefetch.tableName", 
tableName);
    +                    if (columnNames != null) {
    +                        
attributesToAdd.put("generatetablefetch.columnNames", columnNames);
    +                    }
    +                    whereClause = maxValueClauses.isEmpty() ? "1=1" : 
StringUtils.join(maxValueClauses, " AND ");
    +                    if (StringUtils.isNotBlank(whereClause)) {
    --- End diff --
    
    I know it was already like this, but I'm not sure it's even possible for 
`whereClause` to be blank based on the logic here. Same for existing code down 
below for a normal run.


---

Reply via email to