You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/01/10 16:50:41 UTC

[GitHub] [incubator-doris] imay opened a new pull request #2731: Add bitamp_to_string function

imay opened a new pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731
 
 
   This CL changes:
   
   1. add function bitmap_to_string, which will convert a bitmap to string
   which contains all bit in bitmap
   2. add function murmur_hash3_32, which will compute murmur hash for
   input strings
   3. make the function cast float to string the same with user result
   logic

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365632484
 
 

 ##########
 File path: docs/documentation/cn/sql-reference/sql-functions/bitmap-functions/bitmap_from_string.md
 ##########
 @@ -0,0 +1,54 @@
+<!-- 
+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.
+-->
+
+# bitmap_from_string
+
+## description
+### Syntax
+
+`BITMAP BITMAP_FROM_STRING(VARCHAR input)`
+
+将一个字符串转化为一个BITAMP,如果输入的字符串不合法,返回NULL.
 
 Review comment:
   Would better describe what's is valid or invalid string input.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] imay commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
imay commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365635444
 
 

 ##########
 File path: be/src/exprs/bitmap_function.h
 ##########
 @@ -55,6 +55,8 @@ class BitmapFunctions {
     static StringVal bitmap_hash(FunctionContext* ctx, const StringVal& src);
     static StringVal bitmap_or(FunctionContext* ctx, const StringVal& src,const StringVal& dst);
     static StringVal bitmap_and(FunctionContext* ctx, const StringVal& src,const StringVal& dst);
+    static StringVal bitmap_to_string(FunctionContext* ctx, const StringVal& input);
+    static StringVal bitmap_from_string(FunctionContext* ctx, const StringVal& input);
 
 Review comment:
   done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] imay commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
imay commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365635474
 
 

 ##########
 File path: docs/documentation/cn/sql-reference/sql-functions/bitmap-functions/bitmap_from_string.md
 ##########
 @@ -0,0 +1,54 @@
+<!-- 
+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.
+-->
+
+# bitmap_from_string
+
+## description
+### Syntax
+
+`BITMAP BITMAP_FROM_STRING(VARCHAR input)`
+
+将一个字符串转化为一个BITAMP,如果输入的字符串不合法,返回NULL.
 
 Review comment:
   done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] imay commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
imay commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365635494
 
 

 ##########
 File path: be/test/util/bitmap_test.cpp
 ##########
 @@ -267,6 +267,30 @@ TEST_F(BitMapTest, roaring_bitmap_serde) {
     ASSERT_EQ(3, bitmap_serde.cardinality());
 }
 
+TEST_F(BitMapTest, bitmap_to_string) {
+    RoaringBitmap empty;
+    ASSERT_STREQ("", empty.to_string().c_str());
+    empty.update(1);
+    ASSERT_STREQ("1", empty.to_string().c_str());
+    empty.update(2);
+    ASSERT_STREQ("1,2", empty.to_string().c_str());
+}
+
+TEST_F(BitMapTest, bitmap_from_vector) {
 
 Review comment:
   done

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] imay merged pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
imay merged pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365632172
 
 

 ##########
 File path: be/src/exprs/bitmap_function.h
 ##########
 @@ -55,6 +55,8 @@ class BitmapFunctions {
     static StringVal bitmap_hash(FunctionContext* ctx, const StringVal& src);
     static StringVal bitmap_or(FunctionContext* ctx, const StringVal& src,const StringVal& dst);
     static StringVal bitmap_and(FunctionContext* ctx, const StringVal& src,const StringVal& dst);
+    static StringVal bitmap_to_string(FunctionContext* ctx, const StringVal& input);
+    static StringVal bitmap_from_string(FunctionContext* ctx, const StringVal& input);
 
 Review comment:
   Would better give a valid string format description.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on a change in pull request #2731: Add bitamp_to_string function
URL: https://github.com/apache/incubator-doris/pull/2731#discussion_r365632305
 
 

 ##########
 File path: be/test/util/bitmap_test.cpp
 ##########
 @@ -267,6 +267,30 @@ TEST_F(BitMapTest, roaring_bitmap_serde) {
     ASSERT_EQ(3, bitmap_serde.cardinality());
 }
 
+TEST_F(BitMapTest, bitmap_to_string) {
+    RoaringBitmap empty;
+    ASSERT_STREQ("", empty.to_string().c_str());
+    empty.update(1);
+    ASSERT_STREQ("1", empty.to_string().c_str());
+    empty.update(2);
+    ASSERT_STREQ("1,2", empty.to_string().c_str());
+}
+
+TEST_F(BitMapTest, bitmap_from_vector) {
 
 Review comment:
   Would better add a invalid string format test case

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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