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

    https://github.com/apache/nifi/pull/384#discussion_r61502555
  
    --- Diff: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/ExecuteHiveQL.java
 ---
    @@ -152,8 +152,23 @@ public void process(final OutputStream out) throws 
IOException {
     
                 logger.info("{} contains {} Avro records; transferring to 
'success'",
                         new Object[]{fileToProcess, nrOfRows.get()});
    -            session.getProvenanceReporter().modifyContent(fileToProcess, 
"Retrieved " + nrOfRows.get() + " rows",
    -                    stopWatch.getElapsed(TimeUnit.MILLISECONDS));
    +
    +            if (context.hasIncomingConnection()) {
    +                // If the flow file came from an incoming connection, 
issue a Modify Content provenance event
    +
    +                
session.getProvenanceReporter().modifyContent(fileToProcess, "Retrieved " + 
nrOfRows.get() + " rows",
    +                        stopWatch.getElapsed(TimeUnit.MILLISECONDS));
    +            } else {
    +                // If we created a flow file from rows received from Hive, 
issue a Receive provenance event
    +                // Determine the database URL from the connection metadata
    +                String url = "jdbc:hive2://unknown-host";
    +                try {
    +                    url = con.getMetaData().getURL();
    --- End diff --
    
    In your testing did con.getMetaData().getUrl() return a value? 
    
    Testing on a VM I am always getting unknown-host in my provenance events. 
I'm wondering should we just take the value from the Database Connection URL 
property and use that as the URI here, instead of relying on the connection 
object.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to