[ 
https://issues.apache.org/jira/browse/NIFI-5095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16443620#comment-16443620
 ] 

ASF GitHub Bot commented on NIFI-5095:
--------------------------------------

GitHub user ijokarumawak opened a pull request:

    https://github.com/apache/nifi/pull/2645

    NIFI-5095: Suppress SET property parse failure at Hive processors

    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:
    - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
         in the commit message?
    
    - [x] 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.
    
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    - [x] Is your initial contribution a single, squashed commit?
    
    ### For code changes:
    - [x] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
    - [x] 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](http://www.apache.org/legal/resolved.html#category-a)? 
    - [ ] 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.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ijokarumawak/nifi nifi-5095

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/2645.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2645
    
----
commit 6e31d726078d8c95bb222eb6c0f2a52b32c5611a
Author: Koji Kawamura <ijokarumawak@...>
Date:   2018-04-19T06:45:16Z

    NIFI-5095: Suppress SET property parse failure at Hive processors

----


> PutHiveQL should not log warning message when it fails to parse SET property 
> command
> ------------------------------------------------------------------------------------
>
>                 Key: NIFI-5095
>                 URL: https://issues.apache.org/jira/browse/NIFI-5095
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.5.0
>            Reporter: Koji Kawamura
>            Assignee: Koji Kawamura
>            Priority: Minor
>
> PutHiveQL can accept multiple queries separated by a specified delimiter 
> string, ';' by default. It supports users to specify Hive parameters by 'SET' 
> statement. E.g. set 'hive.exec.dynamic.partition.mode'=nonstrict
> PutHiveQL also parses each query string with Hive ParseDriver, in order to 
> find input/output table names within queries. However, the aforementioned 
> 'SET' command is not a valid Hive query. The only query can start with 'SET' 
> is 'SET ROLE'. 
> [https://raw.githubusercontent.com/apache/hive/master/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g]
>  When set property statement is parsed, following warning message is logged 
> and shown in the NiFi UI:
> {code:java}
> 2018-04-19 05:34:05,616 WARN [Timer-Driven Process Thread-8] 
> o.apache.nifi.processors.hive.PutHiveQL 
> PutHiveQL[id=db408703-0162-1000-0000-000073ad3455] Failed to parse hiveQL: 
> set hive.exec.dynamic.partition.mode=nonstrict due to 
> org.apache.hadoop.hive.ql.parse.ParseException: line 1:4 missing KW_ROLE at 
> 'hive' near 'hive' line 1:8 missing EOF at '.' near 'hive':
> {code}
> In case there are other DML statements such as 'INSERT ...' in the same 
> FlowFile content, those queries are performed successfully regardless of 
> having above parse failure. However, the warning message is mis-leading, it 
> looks as if queries have failed. We should not show such warning message for 
> set property commands.
> We can short-circuit query parse logic if statement starts with 'set', since 
> 'set role' does not have any target table. As a reference Hive HCatCli.java 
> has the similar filtering logic.
>  
> [https://github.com/apache/hive/blob/master/hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/HCatCli.java#L283]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to