ClickHouse/tests/queries/0_stateless/02036_jit_short_circuit.sql
2021-09-30 21:20:15 +03:00

15 lines
483 B
SQL
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

SET compile_expressions = 1;
SET min_count_to_compile_expression = 0;
SET short_circuit_function_evaluation='enable';
DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table (message String) ENGINE=TinyLog;
INSERT INTO test_table VALUES ('Test');
SELECT if(action = 'bonus', sport_amount, 0) * 100 FROM
(SELECT JSONExtract(message, 'action', 'String') AS action,
JSONExtract(message, 'sport_amount', 'Float64') AS sport_amount FROM test_table);
DROP TABLE test_table;