You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Sahil Takiar (JIRA)" <ji...@apache.org> on 2016/09/30 22:58:21 UTC

[jira] [Created] (HIVE-14871) Window PARTITION BY clause throw "ParseException line ?:? missing ) at '?' near"

Sahil Takiar created HIVE-14871:
-----------------------------------

             Summary: Window PARTITION BY clause throw "ParseException line ?:? missing ) at '?' near"
                 Key: HIVE-14871
                 URL: https://issues.apache.org/jira/browse/HIVE-14871
             Project: Hive
          Issue Type: Bug
          Components: Hive
    Affects Versions: 2.1.0
            Reporter: Sahil Takiar


Queries such as:

{code}
SELECT
LEAD(True, 54) OVER (PARTITION BY (a1.smallint_col_18) / (a1.decimal0101_col_25)) AS boolean_col
FROM table_10 a1;
{code}

throw the exception:

{code}
Error: Error while compiling statement: FAILED: ParseException line 2:55 missing ) at '/' near ')'
line 2:80 missing EOF at ')' near ')' (state=42000,code=40000)
{code}

While the following queries succeed:

{code}
SELECT
LEAD(True, 54) OVER (PARTITION BY (a1.smallint_col_18 / a1.decimal0101_col_25)) AS boolean_col
FROM table_10 a1;
{code}

{code}
SELECT
LEAD(True, 54) OVER (PARTITION BY (a1.smallint_col_18 / a1.decimal0101_col_25) ORDER BY (a1.smallint_col_18) / (a1.decimal0101_col_25) DESC) AS boolean_col
FROM table_10 a1;
{code}

Seems to be a Hive bug, seems to be related to the extra parenthesis around the a1.smallint_col_18. Hive probably thinks that whatever is inside the () contains the entire clause for PARTITION BY and it fails to parse anything after that.

My guess is that there is an issue with the Antlr code for the PARTITION BY clause.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)