Github user zuyu commented on a diff in the pull request:
https://github.com/apache/incubator-quickstep/pull/27#discussion_r66725825
--- Diff: storage/BasicColumnStoreTupleStorageSubBlock.cpp ---
@@ -183,26 +189,27 @@ bool
BasicColumnStoreTupleStorageSubBlock::DescriptionIsValid(
if (description.sub_block_type() !=
TupleStorageSubBlockDescription::BASIC_COLUMN_STORE) {
return false;
}
- // Make sure a sort_attribute_id is specified.
- if
(!description.HasExtension(BasicColumnStoreTupleStorageSubBlockDescription::sort_attribute_id))
{
- return false;
- }
// Make sure relation is not variable-length.
if (relation.isVariableLength()) {
return false;
}
- // Check that the specified sort attribute exists and can be ordered by
LessComparison.
- attribute_id sort_attribute_id = description.GetExtension(
- BasicColumnStoreTupleStorageSubBlockDescription::sort_attribute_id);
- if (!relation.hasAttributeWithId(sort_attribute_id)) {
- return false;
- }
- const Type &sort_attribute_type =
relation.getAttributeById(sort_attribute_id)->getType();
- if
(!ComparisonFactory::GetComparison(ComparisonID::kLess).canCompareTypes(sort_attribute_type,
-
sort_attribute_type)) {
- return false;
+ // If a sort attribute is specified, check that it exists and can be
ordered
+ // by LessComparison.
+ if (description.HasExtension(
+
BasicColumnStoreTupleStorageSubBlockDescription::sort_attribute_id)) {
+ attribute_id sort_attribute_id = description.GetExtension(
--- End diff --
Could we mark it `const`? Thanks!
---
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 [email protected] or file a JIRA ticket
with INFRA.
---