xy720 opened a new pull request, #18935:
URL: https://github.com/apache/doris/pull/18935
# Proposed changes
fix some bugs in map and map element function:
1、error occur when map constructor's parameter is empty:
Before:
```
mysql> select map();
ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: 0
```
After:
```
mysql> SELECT map();
+-------+
| MAP{} |
+-------+
| MAP{} |
+-------+
1 row in set (0.01 sec)
```
2、be core in map constructor when the parameter number is odd:
Before
```
mysql> select map(1,'a',3,'c',5);
ERROR 1105 (HY000): RpcException, msg: io.grpc.StatusRuntimeException:
UNAVAILABLE: Network closed for unknown reason
```
After
```
mysql> select map(1,'a',3,'c',5);
ERROR 1105 (HY000): errCode = 2, detailMessage = map can't be odd
parameters, need even parameters: map(1, 2, 3, 4, 5)
```
3、be core in map element function
Before
```
mysql> select {1:"a", 3:"b", 5:"c"}[1];
ERROR 1105 (HY000): RpcException, msg: org.apache.doris.rpc.RpcException:
io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
```
After
```
mysql> select {1:"a", 3:"b", 5:"c"}[1];
+------------------------------------------------+
| %element_extract%(MAP{1:'a', 3:'b', 5:'c'}, 1) |
+------------------------------------------------+
| a |
+------------------------------------------------+
1 row in set (0.02 sec)
```
## Problem summary
Describe your changes.
## Checklist(Required)
* [ ] Does it affect the original behavior
* [ ] Has unit tests been added
* [ ] Has document been added or modified
* [ ] Does it need to update dependencies
* [ ] Is this PR support rollback (If NO, please explain WHY)
## Further comments
If this is a relatively large or complex change, kick off the discussion at
[[email protected]](mailto:[email protected]) by explaining why you
chose the solution you did and what alternatives you considered, etc...
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]