impala-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adriano (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IMPALA-5191) Allow Impala to accept "column alias" and "Column name" indistintly in the group by clause (also if Column is made by a function).
Date Mon, 10 Apr 2017 08:58:41 GMT
Adriano created IMPALA-5191:
-------------------------------

             Summary: Allow Impala to accept "column alias" and "Column name" indistintly
in the group by clause (also if Column is made by a function).
                 Key: IMPALA-5191
                 URL: https://issues.apache.org/jira/browse/IMPALA-5191
             Project: IMPALA
          Issue Type: New Feature
          Components: Frontend
            Reporter: Adriano
            Priority: Minor


Allow Impala to accept "column alias" and "Column name" indistintly in the group by clause
(also if Column is made by a function).
We are confident that this can contribuite to the growing of this Engine. 

This is a sample of a statement that we would like to execute with success:
with 
w_test as ( 
SELECT 
'1' as one, 
2 as two, 
'3' as three 
) 
select 
one as one, 
substring( cast( two as string ), 1, 1 ) as two, 
three as three, 
count(1) as cnt 
from 
w_test 
group by 
one, 
substring( cast( two as string ), 1, 1 ), 
three 

ERROR: AnalysisException: select list expression not produced by aggregation output (missing
from GROUP BY clause?): substring(CAST(two AS STRING), 1, 1)



It work writing the statements as:

*workaround.1:*
with 
w_test as ( 
SELECT 
'1' as one, 
2 as two, 
'3' as three 
) 
select 
one, 
substring( cast( two as string ), 1, 1 ), 
three, 
count(1) 
from 
w_test 
group by 
one, 
substring( cast( two as string ), 1, 1 ), 
three 

*workaround.2:*
with 
w_test as ( 
SELECT 
'1' as one, 
2 as two, 
'3' as three 
) 
select 
one as one, 
substring( cast( two as string ), 1, 1 ) as two, 
three as three, 
count(1) as cnt 
from 
w_test 
group by 
1, 
2, 
3 

*workaround 3:*
with 
w_test as ( 
SELECT 
'1' as one, 
2 as two, 
'3' as three 
) 
select 
one as t_one, 
substring( cast( two as string ), 1, 1 ) as t_two, 
three as t_three, 
count(1) as cnt 
from 
w_test 
group by 
t_one, 
t_two, 
t_three




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message