[ https://issues.apache.org/jira/browse/NIFI-3596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15941011#comment-15941011 ]
ASF GitHub Bot commented on NIFI-3596: -------------------------------------- Github user mattyb149 commented on a diff in the pull request: https://github.com/apache/nifi/pull/1596#discussion_r107984019 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestGenerateTableFetch.java --- @@ -207,6 +207,12 @@ public void testAddedRows() throws ClassNotFoundException, SQLException, Initial assertEquals("SELECT * FROM TEST_QUERY_DB_TABLE ORDER BY name OFFSET 4 ROWS FETCH NEXT 2 ROWS ONLY", new String(flowFile.toByteArray())); flowFile = runner.getFlowFilesForRelationship(REL_SUCCESS).get(3); assertEquals("SELECT * FROM TEST_QUERY_DB_TABLE ORDER BY name OFFSET 6 ROWS FETCH NEXT 2 ROWS ONLY", new String(flowFile.toByteArray())); + assertEquals("TEST_QUERY_DB_TABLE", flowFile.getAttribute("generatetablefetch.tableName")); + assertEquals(null, flowFile.getAttribute("generatetablefetch.columnNames")); --- End diff -- All added asserts for columns are checking for null, can you update a test (or add one) that sets the Columns To Return property? Otherwise, looks good to me, will build and run on a real NiFi in the meantime > GenerateTableFetch - Add attributes to generated flow files to ease SQL query > overwrite > --------------------------------------------------------------------------------------- > > Key: NIFI-3596 > URL: https://issues.apache.org/jira/browse/NIFI-3596 > Project: Apache NiFi > Issue Type: Improvement > Components: Extensions > Reporter: Pierre Villard > Assignee: Pierre Villard > Priority: Trivial > Fix For: 1.2.0 > > > The GenerateTableFetch processor will generate a SQL query based on the > provided parameters but, if the specific DB adapter is not available, it > might be necessary to overwrite the SQL query in the ExecuteSQL processor. To > do that it would be nice to have each part of the query as attributes to take > advantage of expression language. > Current workaround (when using GenerateTableFetch against a DB2 database for > example) is to have an intermediary ExtractText processor and have a regex > extracting each part of the generated query. -- This message was sent by Atlassian JIRA (v6.3.15#6346)