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

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Description
   
   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:
   ```
   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)
   ```
   
   The expected output should be:
   ```
   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.999}, {2023-03-05 15:23:23.997}]                     
                                    |
   
+----------------------------------------------------------------------------------------------------------------------+
   1 row in set (0.01 sec)
   ```
   
   
   ### Solution
   
   Currently, Doris uses the scale of an array's child element to represent the 
scale of a nested type. However, for structs, we may need to use the scale of 
the individual field to represent the scale of the entire struct.
   
   ### 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-unsubscr...@doris.apache.org.apache.org

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


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

Reply via email to