hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Li (JIRA)" <>
Subject [jira] [Commented] (HIVE-6348) Order by/Sort by in subquery
Date Thu, 08 Jun 2017 08:43:18 GMT


Rui Li commented on HIVE-6348:

Hi [~ashutoshc], I didn't put it in calcite because it won't work if CBO is disabled.
My plan is to do it after we've done {{genResolvedParseTree}} on the AST, at which point parse
info of each QB is generated. To remove the order by, we can simply remove the corresponding
AST node. I feel it more complicated to do it in operator tree, e.g. we have to detect sorting
RS in sub queries, and after the RS is removed (actually that's probably not the only OP that
needs be removed), we may also have to do some modifications to upstream/downstream operators.
Upload patch v3 for test and demonstrate my idea.

> Order by/Sort by in subquery
> ----------------------------
>                 Key: HIVE-6348
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Gunther Hagleitner
>            Assignee: Rui Li
>            Priority: Minor
>              Labels: sub-query
>         Attachments: HIVE-6348.1.patch, HIVE-6348.2.patch, HIVE-6348.3.patch
> select * from (select * from foo order by c asc) bar order by c desc;
> in hive sorts the data set twice. The optimizer should probably remove any order by/sort
by in the sub query unless you use 'limit '. Could even go so far as barring it at the semantic

This message was sent by Atlassian JIRA

View raw message