hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soumabrata Chakraborty (JIRA)" <>
Subject [jira] [Commented] (HIVE-20608) Incorrect handling of sql command args in hive service leading to misleading error messages
Date Fri, 26 Oct 2018 14:22:00 GMT


Soumabrata Chakraborty commented on HIVE-20608:

Hi [~daijy]

Yes - the code you pointed out from does trim the statement
and at this moment is the only point from which HiveCommandOperation's runInternal() method
may be reached.

However,  I believe and runInternal() should be self sufficient
and should not depend on operation in another class to trim the statement for it.

In fact, if you look at the current code for then it does trim the
statement on line 109 (self sufficiency) but fails to use this trimmed version in next line
(i.e. line 110).  This is exactly what my change fixes.  (Reference

I agree that functionally it is not a bug at the moment.  That said, I think this change
shall make the code more robust.

I leave it up to your discretion to decide on the course of action.

> Incorrect handling of sql command args in hive service leading to misleading error messages
> -------------------------------------------------------------------------------------------
>                 Key: HIVE-20608
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Soumabrata Chakraborty
>            Assignee: Soumabrata Chakraborty
>            Priority: Major
>         Attachments: HIVE-20608.2.patch, HIVE-20608.patch
> *Steps to reproduce:*
> (1) Connect to HiveServer2 using JDBC driver (not via Beeline)
> (2) Execute a set command with a space before set – e.g. " set hive.exec.dynamic.partiton=true"
> (3) The error that is returned says: 
> {code:java}
> Caused by: org.apache.hive.service.cli.HiveSQLException: Error while processing statement:
Cannot modify set hive.exec.dynamic.partition at runtime. It is not in list of params that
are allowed to be modified at runtime
> {code}
>  (4) However on removing the space before the set command - it works fine.
> *Analysis:*
> Looks like an issue with [] 
> In the runInternal() method, the untrimmed sql statement is split by space (\\s) but
the substring operation to get the command args is done on the trimmed sql statement.  This
causes the issue. 
> {code:java}
> String command = getStatement().trim(); 
> String[] tokens = statement.split("\\s"); 
> String commandArgs = command.substring(tokens[0].length()).trim();
> {code}

This message was sent by Atlassian JIRA

View raw message