Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 6164145

Browse files
committed
Assign unique id to Node copy.
Signed-off-by: ienkovich <[email protected]>
1 parent 619af58 commit 6164145

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

omniscidb/IR/Node.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ Node::Node(NodeInputs inputs)
7575
, context_data_(nullptr)
7676
, is_nop_(false) {}
7777

78+
Node::Node(const Node& other)
79+
: inputs_(other.inputs_)
80+
, id_(crt_id_.fetch_add(1))
81+
, context_data_(nullptr)
82+
, is_nop_(other.is_nop_) {}
83+
7884
void Node::replaceInput(
7985
NodePtr old_input,
8086
NodePtr input,

omniscidb/IR/Node.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ using NodeInputs = std::vector<NodePtr>;
7272
class Node {
7373
public:
7474
Node(NodeInputs inputs = {});
75+
Node(const Node& other);
7576

7677
virtual ~Node() {}
7778

omniscidb/Tests/PartitionedGroupByTest.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,29 @@ TEST_F(PartitionedGroupByTest, ReorderedKeys) {
150150
compare_res_data(res2, id4_vals, id2_vals, id1_vals, id3_vals, v1_sums, v2_sums);
151151
}
152152

153+
TEST_F(PartitionedGroupByTest, AggregationWithSort) {
154+
auto old_exec = config().exec;
155+
ScopeGuard g([&old_exec]() { config().exec = old_exec; });
156+
157+
config().exec.group_by.default_max_groups_buffer_entry_guess = 1;
158+
config().exec.group_by.big_group_threshold = 1;
159+
config().exec.group_by.enable_cpu_partitioned_groupby = true;
160+
config().exec.group_by.partitioning_buffer_size_threshold = 10;
161+
config().exec.group_by.partitioning_group_size_threshold = 1.5;
162+
config().exec.group_by.min_partitions = 2;
163+
config().exec.group_by.max_partitions = 8;
164+
config().exec.group_by.partitioning_buffer_target_size = 612;
165+
config().exec.enable_multifrag_execution_result = true;
166+
167+
QueryBuilder builder(ctx(), getSchemaProvider(), configPtr());
168+
auto scan = builder.scan("test1");
169+
auto dag1 = scan.agg({"id1"s, "id2"s, "id3"s, "id4"s}, {"sum(v1)"s, "sum(v2)"s})
170+
.sort({0, 1, 2, 3})
171+
.finalize();
172+
auto res = runQuery(std::move(dag1));
173+
compare_res_data(res, id1_vals, id2_vals, id3_vals, id4_vals, v1_sums, v2_sums);
174+
}
175+
153176
int main(int argc, char* argv[]) {
154177
TestHelpers::init_logger_stderr_only(argc, argv);
155178
testing::InitGoogleTest(&argc, argv);

0 commit comments

Comments
 (0)