Skip to content

Hive dialect does not support distribute by or sort by in window specs #2339

Description

@wugeer

In Hive 3.1.x, we found that the following query executes successfully:

select row_number() over(distribute by id sort by update_time desc) as row_num 
from (select 1 as id, current_timestamp as update_time) t
Image Image

However, when generating the AST using the latest code from the main branch, the following error occurs:

Image

Reference documentation:

https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g#L293-L297
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g#L135-L139
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g#L271-L27

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions