doris icon indicating copy to clipboard operation
doris copied to clipboard

[Bug] array_zip function returns unexpected output

Open wangyjx opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

2.0.4

What's Wrong?

According to official document, array_zip output should be like this: mysql> select array_zip(['a', 'b', 'c'], [1, 2, 3]); +-------------------------------------------------+ | array_zip(ARRAY('a', 'b', 'c'), ARRAY(1, 2, 3)) | +-------------------------------------------------+ | [{'a', 1}, {'b', 2}, {'c', 3}] | +-------------------------------------------------+

In my environment, the output format is different, select array_zip(['a', 'b', 'c'], [1, 2, 3]) outputs [{"1": "a", "2": 1}, {"1": "b", "2": 2}, {"1": "c", "2": 3}]

What You Expected?

[{'a', 1}, {'b', 2}, {'c', 3}]

How to Reproduce?

select array_zip(['a', 'b', 'c'], [1, 2, 3]);

Anything Else?

No response

Are you willing to submit PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

wangyjx avatar Oct 14 '24 11:10 wangyjx