Updated tests

This commit is contained in:
Maksim Kita 2021-05-25 11:50:40 +03:00
parent b128221cf0
commit ba43fe784c
4 changed files with 14 additions and 18 deletions

View File

@ -374,6 +374,7 @@ function run_tests
01801_s3_cluster
# Depends on LLVM JIT
01072_nullable_jit
01852_jit_if
01865_jit_comparison_constant_result
01871_merge_tree_compile_expressions

View File

@ -403,21 +403,15 @@ static CompileDAG getCompilableDAG(
if (!all_children_visited)
continue;
/// Here we process only functions that are not compiled constants
CompileDAG::Node compile_node;
compile_node.function = node->function_base;
compile_node.result_type = node->result_type;
// if (node->type == ActionsDAG::ActionType::FUNCTION)
// {
compile_node.type = CompileDAG::CompileType::FUNCTION;
for (const auto * child : node->children)
compile_node.arguments.push_back(visited_node_to_compile_dag_position[child]);
// }
// else
// {
// compile_node.type = CompileDAG::CompileType::INPUT;
// children.emplace_back(node);
// }
visited_node_to_compile_dag_position[node] = dag.getNodesCount();
@ -457,8 +451,7 @@ void ActionsDAG::compileFunctions(size_t min_count_to_compile_expression)
std::stack<Frame> stack;
std::unordered_set<const Node *> visited_nodes;
/** Algorithm is to iterate over each node in ActionsDAG, and update node compilable status.
* Node is compilable if all its children are compilable and node is also compilable.
/** Algorithm is to iterate over each node in ActionsDAG, and update node compilable_children_size.
* After this procedure data for each node is initialized.
*/

View File

@ -1,3 +1,5 @@
SET compile_expressions = 1;
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (
@ -12,7 +14,7 @@ CREATE TABLE foo (
INSERT INTO foo VALUES (1, 0.5, 0.2, 0.3, 0.8);
SELECT divide(sum(a) + sum(b), nullIf(sum(c) + sum(d), 0)) FROM foo SETTINGS compile_expressions = 1;
SELECT divide(sum(a) + sum(b), nullIf(sum(c) + sum(d), 0)) FROM foo SETTINGS compile_expressions = 1;
SELECT divide(sum(a) + sum(b), nullIf(sum(c) + sum(d), 0)) FROM foo;
SELECT divide(sum(a) + sum(b), nullIf(sum(c) + sum(d), 0)) FROM foo;
DROP TABLE foo;

View File

@ -6,9 +6,9 @@ SET compile_expressions=true;
-- CREATE TABLE will use global profile with default min_count_to_compile_expression=3
-- so retry 3 times
CREATE TABLE data_01875_1 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number,8) AS SELECT * FROM numbers(16384);
CREATE TABLE data_01875_2 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number,8) AS SELECT * FROM numbers(16384);
CREATE TABLE data_01875_3 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number,8) AS SELECT * FROM numbers(16384);
CREATE TABLE data_01875_1 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number, 8) + 1 AS SELECT * FROM numbers(16384);
CREATE TABLE data_01875_2 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number, 8) + 1 AS SELECT * FROM numbers(16384);
CREATE TABLE data_01875_3 Engine=MergeTree ORDER BY number PARTITION BY bitShiftRight(number, 8) + 1 AS SELECT * FROM numbers(16384);
SELECT number FROM data_01875_3 WHERE number = 999;