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 Thu, 04 Oct 2018 12:56:00 GMT


Soumabrata Chakraborty commented on HIVE-20608:

Well the bug is actually reproducible by using any set command with a space at the beginning. 
The issue is related to incorrect calculator of command args.

For example: given statement " set a.b.c.d=xyz" - the command should be "set" and the command
argument should be "a.b.c.d=xyz".

However, due to this bug,  the command is derived correctly as "set" but the command argument
itself is calculated as "set a.b.c.d=xyz" instead of only "a.b.c.d=xyz" and so it ends up
complaining that "Cannot modify set a.b.c.d at runtime"

Hope this makes it clear

> 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.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