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

[GitHub] [doris] jacktengg opened a new pull request, #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Fix bug of #16680, data order of VUnionIterator outout block is changed, which will impact compaction.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## 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] jacktengg commented on a diff in pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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


##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -374,6 +374,11 @@ Status VUnionIterator::init(const StorageReadOptions& opts) {
         return Status::OK();
     }
 
+    // we use back() and pop_back() of std::vector to handle each iterator,

Review Comment:
   As I understand, the VUnionIterator's behaviour is to output data from the list of segment iterators, from begin to end.
   
   The user of VUnionIterator is reponsible of the corrrect order of the list of segment iterators, and VUnionIterator should keep the order of output data is the same as the input order of list of segment iterators. 
   
   As in the code comment, we use back() and pop_back() of std::vector to handle each iterator, so reverse the vector here to keep result block of next_batch to be in the same order as the original segments.



-- 
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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run p0


-- 
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] zhannngchen commented on a diff in pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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


##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -374,6 +374,11 @@ Status VUnionIterator::init(const StorageReadOptions& opts) {
         return Status::OK();
     }
 
+    // we use back() and pop_back() of std::vector to handle each iterator,

Review Comment:
   My bad, I understand the context wrong at the beginning. I thought why you need to reverse the iterator here because the input is reversed, so I suggested that we should adjust the 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.

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 #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run p0


-- 
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 #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   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] zhannngchen commented on a diff in pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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


##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -374,6 +374,11 @@ Status VUnionIterator::init(const StorageReadOptions& opts) {
         return Status::OK();
     }
 
+    // we use back() and pop_back() of std::vector to handle each iterator,

Review Comment:
   we'd better to make iterator's order right outside of the UnionIterator?
   It's tricky to do this kind of operation inside UnionIterator, if some other developers changed the iterator's order outside of UnionIterator for some reason, the result will not be wrong.
   Consider to do this operation at `beta_rowset_reader.cpp:L218`, just before `  _iterator = vectorized::new_union_iterator(std::move(iterators));`, and we should add a DCHECK on `iter.data_id()` to check that the iterators order right.



-- 
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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run beut


-- 
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 #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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


-- 
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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run beut


-- 
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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run p0


-- 
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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   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 #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   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] jacktengg commented on pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   run feut


-- 
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] zhannngchen commented on a diff in pull request #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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


##########
be/src/vec/olap/vgeneric_iterators.cpp:
##########
@@ -374,6 +374,11 @@ Status VUnionIterator::init(const StorageReadOptions& opts) {
         return Status::OK();
     }
 
+    // we use back() and pop_back() of std::vector to handle each iterator,

Review Comment:
   we'd better to make iterator's order right outside of the UnionIterator?
   It's tricky to do this kind of operation inside UnionIterator, if some other developers changed the iterator's order outside of UnionIterator for some reason, the result will be wrong.
   Consider to do this operation at `beta_rowset_reader.cpp:L218`, just before `  _iterator = vectorized::new_union_iterator(std::move(iterators));`, and we should add a DCHECK on `iter.data_id()` to check that the iterators order right.



-- 
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 #16938: [fix](union iterator) fix bug that result data order of VUnionIterator is different

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

   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