incubator-quickstep git commit: Fix the bug with min/max aggregation
Repository: incubator-quickstep Updated Branches: refs/heads/fix-compare-aggregate [created] 5616a646b Fix the bug with min/max aggregation Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/5616a646 Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/5616a646 Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/5616a646 Branch: refs/heads/fix-compare-aggregate Commit: 5616a646bba0aa189bb7179f260d21431a8d1aa6 Parents: 302f2cb Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: Jianqiao Zhu Committed: Wed Aug 2 15:47:30 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 72 1 file changed, 57 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/5616a646/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..b7271ad 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,30 +559,68 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); +} + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); + if (!is_null) { +return TypedValue(current_literal); } else { return TypedValue(current.getTypeID()); }
incubator-quickstep git commit: Fix the bug with min/max aggregation.
Repository: incubator-quickstep Updated Branches: refs/heads/master b1aab0096 -> 679257094 Fix the bug with min/max aggregation. Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/67925709 Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/67925709 Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/67925709 Branch: refs/heads/master Commit: 67925709450be3ceef8a789c8054a446dc693a0a Parents: b1aab00 Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: Jianqiao Zhu Committed: Fri Aug 4 16:12:15 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 76 +++- 1 file changed, 60 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/67925709/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..ad54d4e 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,32 +559,72 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); - } else { + if (is_null) { return TypedValue(current.getTypeID()); + } else { +return TypedValue(current_literal); } }
[2/2] incubator-quickstep git commit: Fix the bug with min/max aggregation
Fix the bug with min/max aggregation Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/88a1598c Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/88a1598c Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/88a1598c Branch: refs/heads/fix-compare-aggregate Commit: 88a1598c787cfce215e10ba532bc8faf72d70441 Parents: e80e5c8 Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: jianqiao Committed: Wed Aug 2 19:54:54 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 72 1 file changed, 57 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/88a1598c/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..b7271ad 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,30 +559,68 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); +} + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); + if (!is_null) { +return TypedValue(current_literal); } else { return TypedValue(current.getTypeID()); }
[3/3] incubator-quickstep git commit: Fix the bug with min/max aggregation.
Fix the bug with min/max aggregation. Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/f3b792bf Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/f3b792bf Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/f3b792bf Branch: refs/heads/fix-compare-aggregate Commit: f3b792bf532aad41724b91cf88c97fcfbbdc1ea9 Parents: b1aab00 Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: Jianqiao Zhu Committed: Fri Aug 4 14:27:12 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 72 1 file changed, 57 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/f3b792bf/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..b7271ad 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,30 +559,68 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); +} + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); + if (!is_null) { +return TypedValue(current_literal); } else { return TypedValue(current.getTypeID()); }
incubator-quickstep git commit: Fix the bug with min/max aggregation. [Forced Update!]
Repository: incubator-quickstep Updated Branches: refs/heads/fix-compare-aggregate f3b792bf5 -> d65f7dfba (forced update) Fix the bug with min/max aggregation. Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/d65f7dfb Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/d65f7dfb Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/d65f7dfb Branch: refs/heads/fix-compare-aggregate Commit: d65f7dfba7ec2802340b5fd519ab9c46e64ffe6d Parents: b1aab00 Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: Jianqiao Zhu Committed: Fri Aug 4 16:06:51 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 74 1 file changed, 59 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d65f7dfb/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..1bb5d88 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,30 +559,70 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); +} + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); + if (!is_null) { +return TypedValue(current_literal); } else { return TypedValue(current.getTypeID()); }
incubator-quickstep git commit: Fix the bug with min/max aggregation. [Forced Update!]
Repository: incubator-quickstep Updated Branches: refs/heads/fix-compare-aggregate d65f7dfba -> 679257094 (forced update) Fix the bug with min/max aggregation. Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/67925709 Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/67925709 Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/67925709 Branch: refs/heads/fix-compare-aggregate Commit: 67925709450be3ceef8a789c8054a446dc693a0a Parents: b1aab00 Author: Jianqiao Zhu Authored: Wed Aug 2 15:47:30 2017 -0500 Committer: Jianqiao Zhu Committed: Fri Aug 4 16:12:15 2017 -0500 -- .../comparisons/LiteralComparators-inl.hpp | 76 +++- 1 file changed, 60 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/67925709/types/operations/comparisons/LiteralComparators-inl.hpp -- diff --git a/types/operations/comparisons/LiteralComparators-inl.hpp b/types/operations/comparisons/LiteralComparators-inl.hpp index fd59e2e..ad54d4e 100644 --- a/types/operations/comparisons/LiteralComparators-inl.hpp +++ b/types/operations/comparisons/LiteralComparators-inl.hpp @@ -543,7 +543,11 @@ TypedValue LiteralUncheckedComparator(); + } InvokeOnValueAccessorMaybeTupleIdSequenceAdapter( accessor, @@ -555,32 +559,72 @@ TypedValue LiteralUncheckedComparator> column_accessor(accessor->template getColumnAccessor(value_accessor_id)); DCHECK(column_accessor != nullptr); - while (accessor->next()) { -const void *va_value = column_accessor->getUntypedValue(); -if (left_nullable && !va_value) { - continue; + + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = column_accessor->getUntypedValue(); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = column_accessor->getUntypedValue(); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } else { - while (accessor->next()) { -const void *va_value = accessor->template getUntypedValue(value_accessor_id); -if (left_nullable && !va_value) { - continue; + // Locate the first non-null value. + if (is_null) { +const void *va_value = nullptr; +while (accessor->next()) { + va_value = accessor->template getUntypedValue(value_accessor_id); + if (!left_nullable || va_value) { +break; + } +} +if (va_value != nullptr) { + is_null = false; + current_literal = *static_cast(va_value); } -if (!current_literal || this->compareDataPtrsHelper(va_value, current_literal)) { - current_literal = va_value; + } + + // Aggregate on the remaining values. + if (!accessor->iterationFinished()) { +DCHECK(!is_null); +while (accessor->next()) { + const void *va_value = + accessor->template getUntypedValue(value_accessor_id); + if (left_nullable && !va_value) { +continue; + } + if (this->compareDataPtrsHelper(va_value, ¤t_literal)) { +current_literal = *static_cast(va_value); + } } } } }); - if (current_literal) { -return TypedValue(*static_cast(current_literal)); - } else { + if (is_null) { return TypedValue(current.getTypeID()); + } else { +return TypedValue(current_literal); } }