Mellorsssss opened a new pull request, #17696:
URL: https://github.com/apache/doris/pull/17696

   # Proposed changes
   
   Issue Number: close #17487
   
   ## Problem summary
   
   Implement array_zip.
   
   <pre>
   mysql> select array_zip(array('a', 'b'), array('c', 'd'));
   +---------------------------------------------+
   | array_zip(array('a', 'b'), array('c', 'd')) |
   +---------------------------------------------+
   | [{'a', 'c'}, {'b', 'd'}]                    |
   +---------------------------------------------+
   1 row in set (0.00 sec)
   </pre>
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [x] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [x] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   As the support for structs in Doris is not complete, some functions have 
been added to compensate. Furthermore, the output scale of DateTimeV2 within 
the struct is incorrect and requires correction.
   
   For example:
   <pre>
   mysql> select array_zip(array(cast ('2023-03-05 12:23:24.999' as 
datetimev2(1)),cast ('2023-03-05 15:23:23.997' as datetimev2(3))));
   
+----------------------------------------------------------------------------------------------------------------------+
   | array_zip(array(CAST('2023-03-05 12:23:24.999' AS DATETIMEV2(1)), 
CAST('2023-03-05 15:23:23.997' AS DATETIMEV2(3)))) |
   
+----------------------------------------------------------------------------------------------------------------------+
   | [{2023-03-05 12:23:24.999000}, {2023-03-05 15:23:23.997000}]               
                                          |
   
+----------------------------------------------------------------------------------------------------------------------+
   1 row in set (0.01 sec)
   
   mysql> select array_zip(array(cast ('2023-03-05 12:23:24.999' as 
datetimev2(1)),cast ('2023-03-05 15:23:23.997' as datetimev2(2))));
   
+----------------------------------------------------------------------------------------------------------------------+
   | array_zip(array(CAST('2023-03-05 12:23:24.999' AS DATETIMEV2(1)), 
CAST('2023-03-05 15:23:23.997' AS DATETIMEV2(2)))) |
   
+----------------------------------------------------------------------------------------------------------------------+
   | [{2023-03-05 12:23:24.990000}, {2023-03-05 15:23:23.990000}]               
                                          |
   
+----------------------------------------------------------------------------------------------------------------------+
   1 row in set (0.00 sec)
   </pre>
   
   


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

Reply via email to