lubaolei161 opened a new issue #398: Analytic function issue
URL: https://github.com/apache/incubator-doris/issues/398
 
 
   **Describe the bug**
   
palo在使用分析函数时必须有partition分组字段,但如果只是针对某一列排序,不想分组但话,就会被限制,所以我在表中加了一个常量作为分组partition使用,但是报错
   
   测试sql如下:
   ```sql
   select row_number() over(partition by dim order by id) rn,id from 
   (
   select id,'test' dim from 
   (
   select 1 id 
   union all 
   select 2 id  
   union all 
   select 3 id 
   ) t 
   )t
   ```
   返回 ERROR 1064 (HY000): Internal Error, maybe this is a bug, please contact 
with Palo RD.
   
   但如果我将常量写在 union里面  ,可以通过执行,改写如下:
   ```sql
   select row_number() over(partition by dim order by id) rn,id from 
   (
   
   
   select 1 id ,'test' dim
   union all 
   select 2 id  ,'test' dim
   union all 
   select 3 id ,'test' dim
   
   )t
   
   ```
   可以得到正常返回
   
   分析函数应该是不能支持常量分组。。 
   
   希望改进~
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to