You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@quickstep.apache.org by jianqiao <gi...@git.apache.org> on 2017/05/03 19:36:08 UTC

[GitHub] incubator-quickstep pull request #244: Fix a problem in CopyGroupList + mino...

GitHub user jianqiao opened a pull request:

    https://github.com/apache/incubator-quickstep/pull/244

    Fix a problem in CopyGroupList + minor style fixes

    This PR adjusts the implementation of `CopyGroupList::merge_contiguous()` to handle some cases correctly.
    
    E.g. let `R`be a split-row-store relation with integer attributes `x`,`y`,`z`. It is expected that for query
    ```
    SELECT x, y, z
    FROM R;
    ```
    `merge_contiguous()` merges all attributes into one `ContiguousAttrs` copy group, with `bytes_to_copy` set to 12 (size of three integers).
    
    It is also expected that for query
    ```
    SELECT x, y, y
    FROM R;
    ```
    `merge_contiguous()` merges all attributes into two `ContiguousAttrs` copy groups, one for `x, y` and one for the last `y`.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-quickstep fix-copy-group

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-quickstep/pull/244.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #244
    
----
commit 72c7703102f6c367fe346b6bdcde03f1f0036d7b
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Date:   2017-05-03T04:55:52Z

    Fix a problem in CopyGroupList + minor style fixes.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep issue #244: Fix a problem in CopyGroupList + minor style...

Posted by zuyu <gi...@git.apache.org>.
Github user zuyu commented on the issue:

    https://github.com/apache/incubator-quickstep/pull/244
  
    @jianqiao Still have gcc build errors.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep pull request #244: Fix a problem in CopyGroupList + mino...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-quickstep/pull/244


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep issue #244: Fix a problem in CopyGroupList + minor style...

Posted by zuyu <gi...@git.apache.org>.
Github user zuyu commented on the issue:

    https://github.com/apache/incubator-quickstep/pull/244
  
    Is `ane run of` in Line 49 of `SplitRowStoreTupleStorageSubBlock.hpp` a typo of `one run of`?
    
    Also, we need to remove the last `_` in `bytes_to_advance_` in Line 72 and `bytes_to_copy_` in Line 101 of the same file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep issue #244: Fix a problem in CopyGroupList + minor style...

Posted by jianqiao <gi...@git.apache.org>.
Github user jianqiao commented on the issue:

    https://github.com/apache/incubator-quickstep/pull/244
  
    All updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-quickstep pull request #244: Fix a problem in CopyGroupList + mino...

Posted by zuyu <gi...@git.apache.org>.
Github user zuyu commented on a diff in the pull request:

    https://github.com/apache/incubator-quickstep/pull/244#discussion_r114640556
  
    --- Diff: storage/tests/SplitRowStoreTupleStorageSubBlock_unittest.cpp ---
    @@ -761,61 +761,89 @@ TEST_P(SplitRowStoreTupleStorageSubBlockTest, GetCopyGroupsForAttributeMapTest)
       CopyGroupList copy_groups;
       dst_store->getCopyGroupsForAttributeMap(attr_map, &copy_groups);
     
    -  std::vector<ContiguousAttrs>& contiguous_attrs = copy_groups.contiguous_attrs_;
    -  std::vector<VarLenAttr>& varlen_attrs = copy_groups.varlen_attrs_;
    +  const std::vector<ContiguousAttrs> &contiguous_attrs = copy_groups.contiguous_attrs;
    +  const std::vector<VarLenAttr> &varlen_attrs = copy_groups.varlen_attrs;
     
       const std::size_t size_of_string = dst_store->getRelation().getAttributeById(3)->getType().maximumByteLength();
     
       // Fixed length attributes.
    -  EXPECT_EQ(0, contiguous_attrs[0].src_attr_id_);
    -  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_advance_);
    -  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_copy_);
    +  EXPECT_EQ(0, contiguous_attrs[0].src_attr_id);
    +  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_advance);
    +  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_copy);
     
    -  EXPECT_EQ(1, contiguous_attrs[1].src_attr_id_);
    -  EXPECT_EQ(4, contiguous_attrs[1].bytes_to_advance_);
    -  EXPECT_EQ(4, contiguous_attrs[1].bytes_to_copy_);
    +  EXPECT_EQ(1, contiguous_attrs[1].src_attr_id);
    +  EXPECT_EQ(4, contiguous_attrs[1].bytes_to_advance);
    +  EXPECT_EQ(4, contiguous_attrs[1].bytes_to_copy);
     
       if (testVariableLength()) {
         ASSERT_EQ(2, contiguous_attrs.size());
         ASSERT_EQ(2, varlen_attrs.size());
     
    -    EXPECT_EQ(2, varlen_attrs[0].src_attr_id_);
    -    EXPECT_EQ(sizeof(int) + SplitRowStoreTupleStorageSubBlock::kVarLenSlotSize, varlen_attrs[0].bytes_to_advance_);
    +    EXPECT_EQ(2, varlen_attrs[0].src_attr_id);
    +    EXPECT_EQ(sizeof(int) + SplitRowStoreTupleStorageSubBlock::kVarLenSlotSize,
    +              varlen_attrs[0].bytes_to_advance);
     
    -    EXPECT_EQ(1, varlen_attrs[1].src_attr_id_);
    -    EXPECT_EQ(SplitRowStoreTupleStorageSubBlock::kVarLenSlotSize, varlen_attrs[1].bytes_to_advance_);
    +    EXPECT_EQ(1, varlen_attrs[1].src_attr_id);
    +    EXPECT_EQ(SplitRowStoreTupleStorageSubBlock::kVarLenSlotSize, varlen_attrs[1].bytes_to_advance);
     
       } else {
    -    ASSERT_EQ(4, copy_groups.contiguous_attrs_.size());
    -    ASSERT_EQ(0, copy_groups.varlen_attrs_.size());
    +    ASSERT_EQ(4, copy_groups.contiguous_attrs.size());
    +    ASSERT_EQ(0, copy_groups.varlen_attrs.size());
     
    -    EXPECT_EQ(2, contiguous_attrs[2].src_attr_id_);
    -    EXPECT_EQ(4 + size_of_string, contiguous_attrs[2].bytes_to_advance_);
    -    EXPECT_EQ(size_of_string, contiguous_attrs[2].bytes_to_copy_);
    +    EXPECT_EQ(2, contiguous_attrs[2].src_attr_id);
    +    EXPECT_EQ(4 + size_of_string, contiguous_attrs[2].bytes_to_advance);
    +    EXPECT_EQ(size_of_string, contiguous_attrs[2].bytes_to_copy);
       }
     
    -  int null_count =  copy_groups.nullable_attrs_.size();
    +  int null_count =  copy_groups.nullable_attrs.size();
       if (testNullable()) {
         // The relation contains 6 nullable attributes, but only 3 are inserted.
         EXPECT_EQ(4, null_count);
       } else {
         EXPECT_EQ(0, null_count);
       }
     
    -  // test that merging works.
    -  copy_groups.merge_contiguous();
    -  EXPECT_EQ(0, contiguous_attrs[0].src_attr_id_);
    -  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_advance_);
    +  // Test that merging works.
    +  copy_groups.mergeContiguous();
    +  EXPECT_EQ(0, contiguous_attrs[0].src_attr_id);
    +  EXPECT_EQ(4, contiguous_attrs[0].bytes_to_advance);
     
       if (testVariableLength()) {
         EXPECT_EQ(1, contiguous_attrs.size());
         EXPECT_EQ(sizeof(int) * 2 + SplitRowStoreTupleStorageSubBlock::kVarLenSlotSize,
    -              varlen_attrs[0].bytes_to_advance_);
    +              varlen_attrs[0].bytes_to_advance);
       } else {
         EXPECT_EQ(3, contiguous_attrs.size());
    -    EXPECT_EQ(8, contiguous_attrs[0].bytes_to_copy_);
    -    EXPECT_EQ(8 + size_of_string, contiguous_attrs[1].bytes_to_advance_);
    +    EXPECT_EQ(8, contiguous_attrs[0].bytes_to_copy);
    +    EXPECT_EQ(8 + size_of_string, contiguous_attrs[1].bytes_to_advance);
       }
    +
    +  // Extra test 1 for merging.
    --- End diff --
    
    Could we add the following comment here?
    
    ```
      // Extra test 1 for merging to simulate the following query:
      //   SELECT x, y, z FROM R;
    ```
    
    Ditto for `// // Extra test 2 for merging.` below.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---