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

[GitHub] [doris] zhangstar333 opened a new pull request, #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   ## Proposed changes
   date_trunc function only handle lower string, so need convert this param to lower case.
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## 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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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] yiguolei commented on a diff in pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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


##########
be/src/vec/functions/function_timestamp.cpp:
##########
@@ -423,10 +423,12 @@ struct DateTrunc {
                                          const StringRef& rdata, PaddedPODArray<ArgType>& res,
                                          NullMap& null_map, size_t input_rows_count) {
         res.resize(input_rows_count);
+        std::string lower_str(rdata.data, rdata.size);

Review Comment:
    add regression test please



-- 
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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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] zhangstar333 commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   run buildall


-- 
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] BiteTheDDDDt merged pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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


-- 
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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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] hello-stephen commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 47.31 seconds
    stream load tsv:          514 seconds loaded 74807831229 Bytes, about 138 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          30 seconds loaded 861443392 Bytes, about 27 MB/s
    insert into select:          30.1 seconds inserted 10000000 Rows, about 332K ops/s
    storage size: 17162270464 Bytes


-- 
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] zhangstar333 commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   run buildall


-- 
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] BiteTheDDDDt commented on a diff in pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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


##########
regression-test/suites/query_p0/sql_functions/datetime_functions/test_date_trunc.groovy:
##########
@@ -0,0 +1,74 @@
+// 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_trunc") {
+    
+    def dbName = "test_date_trunc"
+    sql "DROP DATABASE IF EXISTS ${dbName}"
+    sql "CREATE DATABASE ${dbName}"
+    sql "USE $dbName"
+
+    sql """
+        CREATE TABLE IF NOT EXISTS `baseall` (
+            `k0` boolean null comment "",
+            `k1` tinyint(4) null comment "",
+            `k2` smallint(6) null comment "",
+            `k3` int(11) null comment "",
+            `k4` bigint(20) null comment "",
+            `k5` decimal(9, 3) null comment "",
+            `k6` char(5) null comment "",
+            `k10` date null comment "",
+            `k11` datetime null comment "",
+            `k7` varchar(20) null comment "",
+            `k8` double max null comment "",
+            `k9` float sum null comment "",
+            `k12` string replace null comment "",
+            `k13` largeint(40) replace null comment ""
+        ) engine=olap
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 5 properties("replication_num" = "1")
+        """
+
+    streamLoad {
+        table "baseall"
+        db dbName
+        set 'column_separator', ','
+        file "../../baseall.txt"
+    }
+
+    sql "sync"
+
+    qt_select_date_trunc_second """ SELECT k11, date_trunc(k11,'SECoND') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_minute """ SELECT k11, date_trunc(k11,'MINutE') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_hour """ SELECT k11, date_trunc(k11,'Hour') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_day """ SELECT k11, date_trunc(k11,'DAY') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_week """ SELECT k11, date_trunc(k11,'Week') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_month """ SELECT k11, date_trunc(k11,'MONTH') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_quarter """ SELECT k11, date_trunc(k11,'quarter') FROM baseall order by k1,k2,k3;"""
+    qt_select_date_trunc_year """ SELECT k11, date_trunc(k11,'YeaR') FROM baseall order by k1,k2,k3;"""
+
+    try {
+        sql """ SELECT date_trunc(k11,k7) FROM baseall ; """
+    } catch (Exception e) {

Review Comment:
   If no exception is thrown?



-- 
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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.77 seconds
    stream load tsv:          512 seconds loaded 74807831229 Bytes, about 139 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.1 seconds inserted 10000000 Rows, about 343K ops/s
    storage size: 17162084832 Bytes


-- 
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] BiteTheDDDDt commented on a diff in pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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


##########
regression-test/data/query_p0/sql_functions/datetime_functions/test_date_trunc.out:
##########
@@ -0,0 +1,145 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_date_trunc_second --
+\N	\N
+1989-03-21T13:00	1989-03-21T13:00
+1989-03-21T13:00	1989-03-21T13:00
+2000-01-01T00:00	2000-01-01T00:00
+2015-03-13T10:30	2015-03-13T10:30
+2015-03-13T12:36:38	2015-03-13T12:36:38

Review Comment:
   why the result looks unordered?



##########
regression-test/data/query_p0/sql_functions/datetime_functions/test_date_trunc.out:
##########
@@ -0,0 +1,145 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_date_trunc_second --
+\N	\N
+1989-03-21T13:00	1989-03-21T13:00
+1989-03-21T13:00	1989-03-21T13:00
+2000-01-01T00:00	2000-01-01T00:00
+2015-03-13T10:30	2015-03-13T10:30
+2015-03-13T12:36:38	2015-03-13T12:36:38

Review Comment:
   why the result looks unordered?



-- 
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] zhangstar333 commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   run buildall


-- 
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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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] github-actions[bot] commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   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] zhangstar333 commented on pull request #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   run buildall


-- 
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 #22602: [BUG](date_trunc) fix date_trunc function only handle lower string

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

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 48.37 seconds
    stream load tsv:          514 seconds loaded 74807831229 Bytes, about 138 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          33 seconds loaded 861443392 Bytes, about 24 MB/s
    insert into select:          29.4 seconds inserted 10000000 Rows, about 340K ops/s
    storage size: 17162345718 Bytes


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