Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
optimize unique action
Browse files Browse the repository at this point in the history
Signed-off-by: Yuan Zhou <[email protected]>
  • Loading branch information
zhouyuan committed Feb 21, 2022
1 parent 144a354 commit df95aca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class UniqueAction : public ActionBase {
if (cache_validity_.size() <= max_group_id) {
cache_validity_.resize(max_group_id + 1, false);
null_flag_.resize(max_group_id + 1, false);
cache_.resize(max_group_id + 1);
length_ = cache_validity_.size();
}

Expand All @@ -156,12 +157,13 @@ class UniqueAction : public ActionBase {
if (cache_validity_[dest_group_id] == false) {
if (!is_null) {
cache_validity_[dest_group_id] = true;
cache_.emplace(cache_.begin() + dest_group_id, in_->GetView(row_id_));
cache_[dest_group_id] = (CType)in_->GetView(row_id_);
//cache_.emplace(cache_.begin() + dest_group_id, in_->GetView(row_id_));
} else {
cache_validity_[dest_group_id] = true;
null_flag_[dest_group_id] = true;
CType num;
cache_.emplace(cache_.begin() + dest_group_id, num);
// CType num;
// cache_.emplace(cache_.begin() + dest_group_id, num);
}
}
row_id_++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,9 @@ class HashAggregateKernel::Impl {
}
} else {
for (int i = 0; i < length; i++) {
auto aggr_key = typed_key_in->GetView(i);

aggr_hash_table_->GetOrInsert(
aggr_key, [](int) {}, [](int) {}, &(indices[i]));
typed_key_in->GetView(i), [](int) {}, [](int) {}, &(indices[i]));
}
}

Expand Down
1 change: 1 addition & 0 deletions native-sql-engine/cpp/src/jni/jni_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once

#include <arrow/builder.h>
#include <arrow/pretty_print.h>
Expand Down

0 comments on commit df95aca

Please sign in to comment.