You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Gabriel39 (via GitHub)" <gi...@apache.org> on 2023/02/03 07:26:04 UTC

[GitHub] [doris] Gabriel39 opened a new pull request, #16394: [Bug](datev2) Fix bug when cast datev2 to date

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

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) 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: 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


[GitHub] [doris] github-actions[bot] commented on pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16394:
URL: https://github.com/apache/doris/pull/16394#issuecomment-1415307766

   PR approved by at least one committer and no changes requested.


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


[GitHub] [doris] github-actions[bot] commented on pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16394:
URL: https://github.com/apache/doris/pull/16394#issuecomment-1415307929

   PR approved by anyone and no changes requested.


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


[GitHub] [doris] github-actions[bot] commented on pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16394:
URL: https://github.com/apache/doris/pull/16394#issuecomment-1415221501

   clang-tidy review says "All clean, LGTM! :+1:"


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


[GitHub] [doris] yiguolei merged pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #16394:
URL: https://github.com/apache/doris/pull/16394


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


[GitHub] [doris] hello-stephen commented on pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #16394:
URL: https://github.com/apache/doris/pull/16394#issuecomment-1415638445

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 33.69 seconds
    load time: 515 seconds
    storage size: 17170835939 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230203102626_clickbench_pr_90076.html


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


[GitHub] [doris] carlvinhust2012 commented on a diff in pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "carlvinhust2012 (via GitHub)" <gi...@apache.org>.
carlvinhust2012 commented on code in PR #16394:
URL: https://github.com/apache/doris/pull/16394#discussion_r1095434163


##########
be/src/vec/functions/function_cast.h:
##########
@@ -194,17 +194,16 @@ struct ConvertImpl {
                     } else if constexpr (IsTimeType<ToDataType>) {
                         if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                             DataTypeDateV2::cast_to_date_time(vec_from[i], vec_to[i]);
-                        } else if constexpr (IsDateTimeV2Type<ToDataType> &&
-                                             IsDateV2Type<FromDataType>) {
+                        } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {

Review Comment:
   so here is check the cast from 'DateV2Type' to 'DateType'?



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


[GitHub] [doris] Gabriel39 commented on a diff in pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "Gabriel39 (via GitHub)" <gi...@apache.org>.
Gabriel39 commented on code in PR #16394:
URL: https://github.com/apache/doris/pull/16394#discussion_r1095434990


##########
be/src/vec/functions/function_cast.h:
##########
@@ -194,17 +194,16 @@ struct ConvertImpl {
                     } else if constexpr (IsTimeType<ToDataType>) {
                         if constexpr (IsDateTimeType<ToDataType> && IsDateV2Type<FromDataType>) {
                             DataTypeDateV2::cast_to_date_time(vec_from[i], vec_to[i]);
-                        } else if constexpr (IsDateTimeV2Type<ToDataType> &&
-                                             IsDateV2Type<FromDataType>) {
+                        } else if constexpr (IsDateType<ToDataType> && IsDateV2Type<FromDataType>) {

Review Comment:
   yep



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


[GitHub] [doris] morningman commented on a diff in pull request #16394: [Bug](datev2) Fix bug when cast datev2 to date

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #16394:
URL: https://github.com/apache/doris/pull/16394#discussion_r1096621178


##########
regression-test/suites/datatype_p0/date/test_date_exprs.groovy:
##########
@@ -0,0 +1,40 @@
+
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_date_exprs") {
+    def tbName = "test_date_exprs"
+    sql "DROP TABLE IF EXISTS ${tbName}"
+    sql """
+            create table ${tbName}(k1 datetimev2, k2 int) distributed by hash(k1) buckets 1 properties("replication_num" = "1");
+        """
+    sql """ insert into ${tbName} values("2016-11-04 00:00:01", 1); """
+
+    qt_sql1 """ select dt
+             from
+             (
+             select cast(k1 as datev2) as dt
+             from ${tbName}
+             ) r; """
+    qt_sql2 """ select dt
+             from
+             (
+             select cast(k1 as datev2) as dt

Review Comment:
   select cast(k1 as date) as dt



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