Greg Rahn created IMPALA-9018:
---------------------------------

             Summary: ORDER BY using an expression + column alias fails with 
"Could not resolve column/field"
                 Key: IMPALA-9018
                 URL: https://issues.apache.org/jira/browse/IMPALA-9018
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
            Reporter: Greg Rahn
            Assignee: Shant Hovsepian


Test case:

{noformat}
select version();

+-----------------------------------------------------------------------------------------+
| version()                                                                     
          |
+-----------------------------------------------------------------------------------------+
| impalad version 3.4.0-SNAPSHOT RELEASE (build 
f047e967d099119717d1d3bbb7a235554707513f) |
| Built on Mon Oct  7 10:07:27 UTC 2019                                         
          |
+-----------------------------------------------------------------------------------------+

-- works
with t as (select a from (values(1 as a),(2),(3)) t)
select
  a, 
  a + 10 as alias_of_a
from t
order by abs(a);

+---+------------+
| a | alias_of_a |
+---+------------+
| 1 | 11         |
| 2 | 12         |
| 3 | 13         |
+---+------------+

-- fails with 
-- AnalysisException: Could not resolve column/field reference: 'alias_of_a'
with t as (select a from (values(1 as a),(2),(3)) t)
select
  a, 
  a + 10 as alias_of_a
from t
order by abs(alias_of_a);

{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to