hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Peña (JIRA) <>
Subject [jira] [Commented] (HIVE-16935) Hive should strip comments from input before choosing which CommandProcessor to run.
Date Thu, 06 Jul 2017 20:23:00 GMT


Sergio Peña commented on HIVE-16935:

The code looks very good [~asherman]

> Hive should strip comments from input before choosing which CommandProcessor to run.
> ------------------------------------------------------------------------------------
>                 Key: HIVE-16935
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Andrew Sherman
>            Assignee: Andrew Sherman
>         Attachments: HIVE-16935.1.patch, HIVE-16935.2.patch, HIVE-16935.3.patch, HIVE-16935.4.patch
> While using Beeswax, Hue fails to execute statement with following error:
> Error while compiling statement: FAILED: ParseException line 3:4 missing KW_ROLE at 'a'
near 'a' line 3:5 missing EOF at '=' near 'a'
> {quote}
> -- comment
> SET a=1;
> {quote}
> The same code works in Beeline and in Impala.
> The same code fails in CliDriver 
> h2. Background
> Hive deals with sql comments (“-- to end of line”) in different places.
> Some clients attempt to strip comments. For example BeeLine was recently enhanced in to strip comments from multi-line commands
before they are executed.
> Other clients such as Hue or Jdbc do not strip comments before sending text.
> Some tests such as TestCliDriver strip comments before running tests.
> When Hive gets a command the CommandProcessorFactory looks at the text to determine which
CommandProcessor should handle the command. In the bug case the correct CommandProcessor is
SetProcessor, but the comments confuse the CommandProcessorFactory and so the command is treated
as sql. Hive’s sql parser understands and ignores comments, but it does not understand the
set commands usually handled by SetProcessor and so we get the ParseException shown above.

This message was sent by Atlassian JIRA

View raw message