From 2f997b534295ebb5fd9a1d6a3ddd0b3a868880a6 Mon Sep 17 00:00:00 2001 From: philo Date: Wed, 7 Sep 2022 20:28:55 +0800 Subject: [PATCH] Reduce initial size, experimental --- .../codegen/arrow_compute/ext/actions_impl.cc | 180 +++++++++--------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/actions_impl.cc b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/actions_impl.cc index 623cab3da..31187cc08 100644 --- a/native-sql-engine/cpp/src/codegen/arrow_compute/ext/actions_impl.cc +++ b/native-sql-engine/cpp/src/codegen/arrow_compute/ext/actions_impl.cc @@ -198,10 +198,10 @@ class UniqueAction : public ActionBase { arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); null_flag_.resize(max_group_size, false); @@ -361,10 +361,10 @@ class CountAction : public ActionBase { arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_.resize(max_group_size, 0); return arrow::Status::OK(); @@ -498,10 +498,10 @@ class CountDistinctAction : public ActionBase { arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_.resize(max_group_size, 0); return arrow::Status::OK(); @@ -652,10 +652,10 @@ class CountLiteralAction : public ActionBase { arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_.resize(max_group_size, 0); return arrow::Status::OK(); @@ -772,10 +772,10 @@ class MinAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, 0); @@ -1079,10 +1079,10 @@ class MinAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, 0); @@ -1238,10 +1238,10 @@ class MinAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, ""); @@ -1388,10 +1388,10 @@ class MaxAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, 0); @@ -1690,10 +1690,10 @@ class MaxAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, 0); @@ -1849,10 +1849,10 @@ class MaxAction> arrow::Status GrowByFactor(int target_group_size) { int max_group_size; - if (target_group_size < 128) { - max_group_size = 128; + if (target_group_size < 32) { + max_group_size = target_group_size; } else { - max_group_size = target_group_size * 2; + max_group_size = target_group_size; } cache_validity_.resize(max_group_size, false); cache_.resize(max_group_size, ""); @@ -2029,10 +2029,10 @@ class SumAction