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

[GitHub] [doris] eldenmoon opened a new pull request, #22897: [Feature-Variant](Variant Type) support variant type

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

   Variant:
   It is a type that, type is dynamic and supports writing and querying semi-structured data of any type and any level of nesting.
   
   ## Proposed changes
   
   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 a diff in pull request #22897: [Feature-Variant](Variant Type) support variant type

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


##########
be/src/olap/field.h:
##########
@@ -57,6 +58,7 @@ class Field {
     size_t index_size() const { return _index_size; }
     int32_t unique_id() const { return _unique_id; }
     const std::string& name() const { return _name; }
+    const vectorized::PathInData& path() const { return _path; }

Review Comment:
   warning: function 'path' should be marked [[nodiscard]] [modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] const vectorized::PathInData& path() const { return _path; }
   ```
   



-- 
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] eldenmoon commented on pull request #22897: [Feature-Variant](Variant Type) support variant type

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

   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] eldenmoon closed pull request #22897: [Feature-Variant](Variant Type) support variant type

Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon closed pull request #22897: [Feature-Variant](Variant Type) support variant type
URL: https://github.com/apache/doris/pull/22897


-- 
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] eldenmoon commented on pull request #22897: [Feature-Variant](Variant Type) support variant type

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

   TODO : Add documents and design details


-- 
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 #22897: [Feature-Variant](Variant Type) support variant type

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


##########
be/src/vec/columns/column_string.h:
##########
@@ -140,15 +145,22 @@ class ColumnString final : public COWHelper<IColumn, ColumnString> {
     }
 
     void insert(const Field& x) override {
-        const String& s = vectorized::get<const String&>(x);
+        StringRef s;

Review Comment:
   这里是不是直接写一个新的ColumnJSONB



##########
be/src/vec/columns/column_string.h:
##########
@@ -140,15 +145,22 @@ class ColumnString final : public COWHelper<IColumn, ColumnString> {
     }
 
     void insert(const Field& x) override {
-        const String& s = vectorized::get<const String&>(x);
+        StringRef s;

Review Comment:
   这里是不是直接写一个新的ColumnJSONB



-- 
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 #22897: [Feature-Variant](Variant Type) support variant type

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


##########
be/src/vec/data_types/data_type_array.cpp:
##########
@@ -148,9 +148,9 @@ void DataTypeArray::to_string(const IColumn& column, size_t row_num, BufferWrita
         }
         WhichDataType which(remove_nullable(nested));
         if (which.is_string_or_fixed_string()) {
-            ostr.write("'", 1);

Review Comment:
   @amorynan  看看啊



##########
be/src/vec/data_types/data_type_array.cpp:
##########
@@ -148,9 +148,9 @@ void DataTypeArray::to_string(const IColumn& column, size_t row_num, BufferWrita
         }
         WhichDataType which(remove_nullable(nested));
         if (which.is_string_or_fixed_string()) {
-            ostr.write("'", 1);

Review Comment:
   @amorynan  看看啊



-- 
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] eldenmoon commented on pull request #22897: [Feature-Variant](Variant Type) support variant type

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

   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] yiguolei commented on a diff in pull request #22897: [Feature-Variant](Variant Type) support variant type

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


##########
be/src/vec/columns/column_object.h:
##########
@@ -188,23 +215,68 @@ class ColumnObject final : public COWHelper<IColumn, ColumnObject> {
     const bool is_nullable;
     Subcolumns subcolumns;
     size_t num_rows;
+    // sparse columns will be merge and encoded into root column
+    Subcolumns sparse_columns;
+    // The rapidjson document format of Subcolumns tree structure
+    // the leaves is null.In order to display whole document, copy
+    // this structure and fill with Subcolumns sub items
+    mutable std::shared_ptr<rapidjson::Document> doc_structure;
 
 public:
     static constexpr auto COLUMN_NAME_DUMMY = "_dummy";
 
-    explicit ColumnObject(bool is_nullable_);
+    explicit ColumnObject(bool is_nullable_, bool create_root = true);
 
     ColumnObject(Subcolumns&& subcolumns_, bool is_nullable_);
 
     ~ColumnObject() override = default;
 
-    bool can_be_inside_nullable() const override { return true; }
+    bool can_be_inside_nullable() const override { return false; }

Review Comment:
   这个函数可能不对,我们现在column const 和 nullable的关系是确定的,而且比较trick,很多地方的设定,很难通过一个函数来保证。



##########
be/src/vec/columns/column_object.h:
##########
@@ -188,23 +215,68 @@ class ColumnObject final : public COWHelper<IColumn, ColumnObject> {
     const bool is_nullable;
     Subcolumns subcolumns;
     size_t num_rows;
+    // sparse columns will be merge and encoded into root column
+    Subcolumns sparse_columns;
+    // The rapidjson document format of Subcolumns tree structure
+    // the leaves is null.In order to display whole document, copy
+    // this structure and fill with Subcolumns sub items
+    mutable std::shared_ptr<rapidjson::Document> doc_structure;
 
 public:
     static constexpr auto COLUMN_NAME_DUMMY = "_dummy";
 
-    explicit ColumnObject(bool is_nullable_);
+    explicit ColumnObject(bool is_nullable_, bool create_root = true);
 
     ColumnObject(Subcolumns&& subcolumns_, bool is_nullable_);
 
     ~ColumnObject() override = default;
 
-    bool can_be_inside_nullable() const override { return true; }
+    bool can_be_inside_nullable() const override { return false; }

Review Comment:
   这个函数可能不对,我们现在column const 和 nullable的关系是确定的,而且比较trick,很多地方的设定,很难通过一个函数来保证。



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