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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to