ClickHouse/tests/queries/0_stateless/02498_analyzer_settings_push_down.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.2 KiB
MySQL
Raw Normal View History

2022-12-08 12:31:46 +00:00
SET allow_experimental_analyzer = 1;
SET optimize_functions_to_subcolumns = 0;
2022-12-08 12:31:46 +00:00
DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table (id UInt64, value Tuple(a UInt64)) ENGINE=MergeTree ORDER BY id;
INSERT INTO test_table VALUES (0, tuple(0));
-- { echoOn }
SELECT value FROM (SELECT tupleElement(value, 'a') AS value FROM test_table);
EXPLAIN QUERY TREE SELECT value FROM (
SELECT tupleElement(value, 'a') AS value FROM test_table
);
SELECT '--';
EXPLAIN QUERY TREE SELECT value FROM (
SELECT tupleElement(value, 'a') AS value FROM test_table
) SETTINGS optimize_functions_to_subcolumns = 1;
SELECT '--';
EXPLAIN QUERY TREE SELECT value FROM (
SELECT tupleElement(value, 'a') AS value FROM test_table SETTINGS optimize_functions_to_subcolumns = 0
) SETTINGS optimize_functions_to_subcolumns = 1;
SELECT '--';
EXPLAIN QUERY TREE SELECT value FROM (
SELECT tupleElement(value, 'a') AS value FROM test_table
) SETTINGS optimize_functions_to_subcolumns = 0;
SELECT '--';
EXPLAIN QUERY TREE SELECT value FROM (
SELECT tupleElement(value, 'a') AS value FROM test_table SETTINGS optimize_functions_to_subcolumns = 1
) SETTINGS optimize_functions_to_subcolumns = 0;
-- { echoOff }
DROP TABLE test_table;