Skip to content

NIFI-4545: Improve Hive processors provenance transit URL#2239

Closed
ijokarumawak wants to merge 2 commits intoapache:masterfrom
ijokarumawak:nifi-4545
Closed

NIFI-4545: Improve Hive processors provenance transit URL#2239
ijokarumawak wants to merge 2 commits intoapache:masterfrom
ijokarumawak:nifi-4545

Conversation

@ijokarumawak
Copy link
Member

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit?

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@mattyb149
Copy link
Contributor

Reviewing...

Copy link
Contributor

@mattyb149 mattyb149 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is awesome!!! Great information being added here for provenance and in general. I had just one issue during my testing, for tables that may be input and output tables during execution of Hive statement(s). Other than that, things are looking and working well!

}

@Test
public void parseInsert() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests pass for me, but when I tried on a real NiFi against a Hive with two tables (prov_events and t), running a single flow file into PutHiveQL containing the following:
insert into t values (11,"eleven");
insert into prov_events select * from prov_events where durationmillis = 10;
insert into t values (0,"zero");

I correctly get query.input_tables = "prov_events", but query.output_tables = "t" when it should be "t,prov_events" right?

throw new IllegalStateException("TOK_TABNAME does not have expected children, childCount=" + childCount);
}
// If parent is TOK_TABREF, then it is an input table.
tableName.setInput("TOK_TABREF".equals(tree.getParent().getText()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need setInput and setOutput (and the getters) here, since a table could technically be input and output, either in the same statement or multiple statements. See my other comment for an example, also this one generates nothing in query.input_tables:

insert into t values (8,"eight");
create table if not exists t3 (id int, name string);
insert overwrite table t3 select distinct id,name from t;

- Added 'input' to equals() method so that the same table name can appear
as input and output tables.
@ijokarumawak
Copy link
Member Author

@mattyb149 Thanks for reviewing, glad you like it :) I've updated TableName class equals method and unit tests based on your feedback. Now the same table name can be reported as an input and also an output table.

@mattyb149
Copy link
Contributor

+1 LGTM, ran build with contrib-check and unit tests, also tried various HiveQL commands, verified the input and output tables attributes are being correctly populated. Thanks for this improvement! Merging to master

@asfgit asfgit closed this in 37ef283 Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants