You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "paything (via GitHub)" <gi...@apache.org> on 2024/01/12 16:33:47 UTC

[I] [Bug] array_map里面lamda执行不符合预期 [doris]

paything opened a new issue, #29931:
URL: https://github.com/apache/doris/issues/29931

   ### 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
   
   2.0.4
   
   ### What's Wrong?
   
   select 
   json1,
   array_map(x->x,array1) as test1,
   array_map(x->concat('$.',x),array1) as test2,
   get_json_string(json1,concat('$.',1)) as test4,
   array_map(x->get_json_string(json1,concat('$.',x)),array1) as test3,
   array_map(x->x/1=1,array1) as test5
   from (
   
   select 
   ids,
   split_by_string(ids, ',') as array1
   ,json1
   from (select '1,3,6' as ids union all
   select '1,9,11' as ids union all
   select '1' as ids union all
   select '1,12,13' as ids 
   ) temp
   cross join (select json_parse(concat("{",group_concat(concat('"',id,'":"',name,'"')),"}")) as json1 from (
   select 1 as id,'张三' as name union all
   select 6 as id,'张四' as name union all
   select 9 as id,'王武' as name
   ) tags) t2 ) t1
   
   
   ### What You Expected?
   
   test3输出不为null
   
   ### How to Reproduce?
   
   select 
   json1,
   array_map(x->x,array1) as test1,
   array_map(x->concat('$.',x),array1) as test2,
   get_json_string(json1,concat('$.',1)) as test4,
   array_map(x->get_json_string(json1,concat('$.',x)),array1) as test3,
   array_map(x->x/1=1,array1) as test5
   from (
   
   select 
   ids,
   split_by_string(ids, ',') as array1
   ,json1
   from (select '1,3,6' as ids union all
   select '1,9,11' as ids union all
   select '1' as ids union all
   select '1,12,13' as ids 
   ) temp
   cross join (select json_parse(concat("{",group_concat(concat('"',id,'":"',name,'"')),"}")) as json1 from (
   select 1 as id,'张三' as name union all
   select 6 as id,'张四' as name union all
   select 9 as id,'王武' as name
   ) tags) t2 ) t1
   
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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


Re: [I] [Bug] array_map里面lamda执行不符合预期 [doris]

Posted by "paything (via GitHub)" <gi...@apache.org>.
paything commented on issue #29931:
URL: https://github.com/apache/doris/issues/29931#issuecomment-1897851549

   you can excute the sql 
   the sample data is a sub query
   
   select
   json1,
   array_map(x->x,array1) as test1,
   array_map(x->concat('$.',x),array1) as test2,
   get_json_string(json1,concat('$.',1)) as test4,
   array_map(x->get_json_string(json1,concat('$.',x)),array1) as test3,
   array_map(x->x/1=1,array1) as test5
   from (
   
   select
   ids,
   split_by_string(ids, ',') as array1
   ,json1
   from (select '1,3,6' as ids union all
   select '1,9,11' as ids union all
   select '1' as ids union all
   select '1,12,13' as ids
   ) temp
   cross join (select json_parse(concat("{",group_concat(concat('"',id,'":"',name,'"')),"}")) as json1 from (
   select 1 as id,'张三' as name union all
   select 6 as id,'张四' as name union all
   select 9 as id,'王武' as name
   ) tags) t2 ) t1


-- 
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

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


Re: [I] [Bug] array_map里面lamda执行不符合预期 [doris]

Posted by "amorynan (via GitHub)" <gi...@apache.org>.
amorynan commented on issue #29931:
URL: https://github.com/apache/doris/issues/29931#issuecomment-1914197134

   in this sql , json1 is from ```select json_parse(concat("{",group_concat(concat('"',id,'":"',name,'"')),"}")``` which is agg func ,and not support in array_map func


-- 
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

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


Re: [I] [Bug] array_map里面lamda执行不符合预期 [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman closed issue #29931: [Bug] array_map里面lamda执行不符合预期
URL: https://github.com/apache/doris/issues/29931


-- 
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

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


Re: [I] [Bug] array_map里面lamda执行不符合预期 [doris]

Posted by "ccoffline (via GitHub)" <gi...@apache.org>.
ccoffline commented on issue #29931:
URL: https://github.com/apache/doris/issues/29931#issuecomment-1891666312

   Please provide ddl and sample data.


-- 
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

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


Re: [I] [Bug] array_map里面lamda执行不符合预期 [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #29931:
URL: https://github.com/apache/doris/issues/29931#issuecomment-3287227419

   We're closing this issue because it hasn't been updated in a while.
   If you'd like to revive this issue, please reopen it and feel free a maintainer to remove the Stale tag!


-- 
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

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