You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/08 08:35:03 UTC

[GitHub] [doris] yuxuan-luo opened a new issue, #14935: [Bug] 使用 'lateral view explode_split' 查询结果为 null

yuxuan-luo opened a new issue, #14935:
URL: https://github.com/apache/doris/issues/14935

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   1.1-lts
   
   ### What's Wrong?
   
   在使用 lateral view explode_split 与 row_number()over 时,如果用了 where 条件判断 row_number()over 列,会使查询结果直接使用字符串函数/json函数处理时为 null 值:
   select * from (
                     select
                         `name` as na,
                         get_json_string(query_param,'$.live_room_id') as live_id,
                         get_json_string(query_param,'$.pull_time') as str,
                         char_length(query_param) as cn
                     from (select * from(
                                            select *,row_number()over(partition by `name` ,get_json_string(query_param,'$.live_room_id') order by pull_time desc) as rn
                                            from test_1
                                        )t where t.rn = 1)re3
                 )tmp lateral view explode_split(tmp.str,':') tmp1 as e1 \G;
   
   查询结果 live_id, str, cn 为 null ,na 值正常
   
   使用 lateral view explode_split 与 row_number()over 时,不使用 where 条件判断 row_number()over 列,查询结果正常:
   When sql is modified to :
   select * from (
                     select
                         `name` as na,
                         get_json_string(query_param,'$.live_room_id') as live_id,
                         get_json_string(query_param,'$.pull_time') as str,
                         char_length(query_param) as cn
                     from (select * from(
                                            select *,row_number()over(partition by `name` ,get_json_string(query_param,'$.live_room_id') order by pull_time desc) as rn
                                            from test_1
                                        )t )re3
                 )tmp lateral view explode_split(tmp.str,':') tmp1 as e1 \G;
   
   使用 lateral view explode_split 与 row_number()over 时,并使用 where 条件判断 row_number()over 列,但是查询结果添加函数处理参数,查询结果正常:
   select * from (
                     select
                         `name` as na,
                         get_json_string(query_param,'$.live_room_id') as live_id,
                         get_json_string(query_param,'$.pull_time') as str,
                         char_length(query_param) as cn,
                         query_param
                     from (select * from(
                                            select *,row_number()over(partition by `name` ,get_json_string(query_param,'$.live_room_id') order by pull_time desc) as rn
                                            from test_1
                                        )t where t.rn = 1)re3
                 )tmp lateral view explode_split(tmp.str,':') tmp1 as e1 \G;
   
   查询结果 live_id, str, cn ,na 值都正常
   
   ### What You Expected?
   
   在使用 lateral view explode_split 与 row_number()over 并且用 where 条件判断 row_number()over 列,查询结果能正常显示
   
   ### How to Reproduce?
   
   使用 lateral view explode_split 与 row_number()over 
   &用 where 条件判断 row_number()over 列
   &查询结果直接使用字符串函数/json函数处理
   select * from (
                     select
                         `name` as na,
                         get_json_string(query_param,'$.live_room_id') as live_id,
                         get_json_string(query_param,'$.pull_time') as str,
                         char_length(query_param) as cn
                     from (select * from(
                                            select *,row_number()over(partition by `name` ,get_json_string(query_param,'$.live_room_id') order by pull_time desc) as rn
                                            from test_1
                                        )t where t.rn = 1)re3
                 )tmp lateral view explode_split(tmp.str,':') tmp1 as e1 \G;
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org