Analyzer change setting into allow_experimental_analyzer

This commit is contained in:
Maksim Kita 2022-10-25 12:35:25 +02:00
parent 06fe6f3c8b
commit e6bfff3de2
40 changed files with 43 additions and 43 deletions

View File

@ -302,7 +302,7 @@ static constexpr UInt64 operator""_GiB(unsigned long long value)
M(Float, opentelemetry_start_trace_probability, 0., "Probability to start an OpenTelemetry trace for an incoming query.", 0) \ M(Float, opentelemetry_start_trace_probability, 0., "Probability to start an OpenTelemetry trace for an incoming query.", 0) \
M(Bool, opentelemetry_trace_processors, false, "Collect OpenTelemetry spans for processors.", 0) \ M(Bool, opentelemetry_trace_processors, false, "Collect OpenTelemetry spans for processors.", 0) \
M(Bool, prefer_column_name_to_alias, false, "Prefer using column names instead of aliases if possible.", 0) \ M(Bool, prefer_column_name_to_alias, false, "Prefer using column names instead of aliases if possible.", 0) \
M(Bool, use_analyzer, false, "Use analyzer", 0) \ M(Bool, allow_experimental_analyzer, false, "Allow experimental analyzer", 0) \
M(Bool, prefer_global_in_and_join, false, "If enabled, all IN/JOIN operators will be rewritten as GLOBAL IN/JOIN. It's useful when the to-be-joined tables are only available on the initiator and we need to always scatter their data on-the-fly during distributed processing with the GLOBAL keyword. It's also useful to reduce the need to access the external sources joining external tables.", 0) \ M(Bool, prefer_global_in_and_join, false, "If enabled, all IN/JOIN operators will be rewritten as GLOBAL IN/JOIN. It's useful when the to-be-joined tables are only available on the initiator and we need to always scatter their data on-the-fly during distributed processing with the GLOBAL keyword. It's also useful to reduce the need to access the external sources joining external tables.", 0) \
\ \
\ \

View File

@ -75,7 +75,7 @@ BlockIO InterpreterDescribeQuery::execute()
auto select_query = table_expression.subquery->children.at(0); auto select_query = table_expression.subquery->children.at(0);
auto current_context = getContext(); auto current_context = getContext();
if (settings.use_analyzer) if (settings.allow_experimental_analyzer)
{ {
SelectQueryOptions select_query_options; SelectQueryOptions select_query_options;
names_and_types = InterpreterSelectQueryAnalyzer(select_query, select_query_options, current_context).getSampleBlock().getNamesAndTypesList(); names_and_types = InterpreterSelectQueryAnalyzer(select_query, select_query_options, current_context).getSampleBlock().getNamesAndTypesList();

View File

@ -419,7 +419,7 @@ QueryPipeline InterpreterExplainQuery::executeImpl()
auto settings = checkAndGetSettings<QueryPlanSettings>(ast.getSettings()); auto settings = checkAndGetSettings<QueryPlanSettings>(ast.getSettings());
QueryPlan plan; QueryPlan plan;
if (getContext()->getSettingsRef().use_analyzer) if (getContext()->getSettingsRef().allow_experimental_analyzer)
{ {
InterpreterSelectQueryAnalyzer interpreter(ast.getExplainedQuery(), options, getContext()); InterpreterSelectQueryAnalyzer interpreter(ast.getExplainedQuery(), options, getContext());
plan = std::move(interpreter).extractQueryPlan(); plan = std::move(interpreter).extractQueryPlan();
@ -462,7 +462,7 @@ QueryPipeline InterpreterExplainQuery::executeImpl()
auto settings = checkAndGetSettings<QueryPipelineSettings>(ast.getSettings()); auto settings = checkAndGetSettings<QueryPipelineSettings>(ast.getSettings());
QueryPlan plan; QueryPlan plan;
if (getContext()->getSettingsRef().use_analyzer) if (getContext()->getSettingsRef().allow_experimental_analyzer)
{ {
InterpreterSelectQueryAnalyzer interpreter(ast.getExplainedQuery(), options, getContext()); InterpreterSelectQueryAnalyzer interpreter(ast.getExplainedQuery(), options, getContext());
plan = std::move(interpreter).extractQueryPlan(); plan = std::move(interpreter).extractQueryPlan();

View File

@ -119,7 +119,7 @@ std::unique_ptr<IInterpreter> InterpreterFactory::get(ASTPtr & query, ContextMut
if (query->as<ASTSelectQuery>()) if (query->as<ASTSelectQuery>())
{ {
if (context->getSettingsRef().use_analyzer) if (context->getSettingsRef().allow_experimental_analyzer)
return std::make_unique<InterpreterSelectQueryAnalyzer>(query, options, context); return std::make_unique<InterpreterSelectQueryAnalyzer>(query, options, context);
/// This is internal part of ASTSelectWithUnionQuery. /// This is internal part of ASTSelectWithUnionQuery.
@ -130,7 +130,7 @@ std::unique_ptr<IInterpreter> InterpreterFactory::get(ASTPtr & query, ContextMut
{ {
ProfileEvents::increment(ProfileEvents::SelectQuery); ProfileEvents::increment(ProfileEvents::SelectQuery);
if (context->getSettingsRef().use_analyzer) if (context->getSettingsRef().allow_experimental_analyzer)
return std::make_unique<InterpreterSelectQueryAnalyzer>(query, options, context); return std::make_unique<InterpreterSelectQueryAnalyzer>(query, options, context);
return std::make_unique<InterpreterSelectWithUnionQuery>(query, context, options); return std::make_unique<InterpreterSelectWithUnionQuery>(query, context, options);

View File

@ -62,7 +62,7 @@ size_t tryReuseStorageOrderingForWindowFunctions(QueryPlan::Node * parent_node,
} }
auto context = read_from_merge_tree->getContext(); auto context = read_from_merge_tree->getContext();
if (!context->getSettings().optimize_read_in_window_order || context->getSettingsRef().use_analyzer) if (!context->getSettings().optimize_read_in_window_order || context->getSettingsRef().allow_experimental_analyzer)
{ {
return 0; return 0;
} }

View File

@ -1,6 +1,6 @@
-- Tags: no-parallel -- Tags: no-parallel
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
-- Empty from section -- Empty from section

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DESCRIBE (SELECT 1); DESCRIBE (SELECT 1);
SELECT 1; SELECT 1;

View File

@ -1,6 +1,6 @@
-- Tags: no-parallel -- Tags: no-parallel
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT 'Matchers without FROM section'; SELECT 'Matchers without FROM section';

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DESCRIBE (SELECT 1 + 1); DESCRIBE (SELECT 1 + 1);
SELECT 1 + 1; SELECT 1 + 1;

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT 'Aliases to constants'; SELECT 'Aliases to constants';

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT 'Constant tuple'; SELECT 'Constant tuple';

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table
@ -32,7 +32,7 @@ WITH 1 AS global_a SELECT b.a FROM (SELECT global_a AS a) AS b;
SELECT * FROM (SELECT * FROM (SELECT * FROM test_table)); SELECT * FROM (SELECT * FROM (SELECT * FROM test_table));
SELECT * FROM (SELECT id, value FROM (SELECT * FROM test_table)); SELECT * FROM (SELECT id, value FROM (SELECT * FROM test_table));
WITH 1 AS a SELECT (SELECT * FROM (SELECT * FROM (SELECT a + 1))) SETTINGS use_analyzer=1; WITH 1 AS a SELECT (SELECT * FROM (SELECT * FROM (SELECT a + 1)));
SELECT 'Subqueries CTE'; SELECT 'Subqueries CTE';

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
EXPLAIN QUERY TREE SELECT 1; EXPLAIN QUERY TREE SELECT 1;

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT c1, c2, c3, c4 FROM format('CSV', '1,2,"[1,2,3]","[[\'abc\'], [], [\'d\', \'e\']]"'); SELECT c1, c2, c3, c4 FROM format('CSV', '1,2,"[1,2,3]","[[\'abc\'], [], [\'d\', \'e\']]"');
SELECT f.c1, f.c2, f.c3, f.c4 FROM format('CSV', '1,2,"[1,2,3]","[[\'abc\'], [], [\'d\', \'e\']]"') AS f; SELECT f.c1, f.c2, f.c3, f.c4 FROM format('CSV', '1,2,"[1,2,3]","[[\'abc\'], [], [\'d\', \'e\']]"') AS f;

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT arrayJoin([1, 2, 3]); SELECT arrayJoin([1, 2, 3]);

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT 1 IN 1; SELECT 1 IN 1;
SELECT 1 IN (1); SELECT 1 IN (1);

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,6 +1,6 @@
-- Tags: long -- Tags: long
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SET join_use_nulls = 1; SET join_use_nulls = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 0; SET allow_experimental_analyzer = 0;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT (SELECT a FROM (SELECT 1 AS a)) SETTINGS max_subquery_depth = 1; -- { serverError 162 } SELECT (SELECT a FROM (SELECT 1 AS a)) SETTINGS max_subquery_depth = 1; -- { serverError 162 }
SELECT (SELECT a FROM (SELECT 1 AS a)) SETTINGS max_subquery_depth = 2; SELECT (SELECT a FROM (SELECT 1 AS a)) SETTINGS max_subquery_depth = 2;

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table_join_1; DROP TABLE IF EXISTS test_table_join_1;
CREATE TABLE test_table_join_1 CREATE TABLE test_table_join_1

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT cast(tuple(1, 'Value'), 'Tuple(first UInt64, second String)') AS value, value.first, value.second; SELECT cast(tuple(1, 'Value'), 'Tuple(first UInt64, second String)') AS value, value.first, value.second;

View File

@ -1,3 +1,3 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
SELECT (NULL IN (SELECT 9223372036854775806 IN (SELECT 65536), inf, NULL IN (NULL))) IN (SELECT NULL IN (NULL)); SELECT (NULL IN (SELECT 9223372036854775806 IN (SELECT 65536), inf, NULL IN (NULL))) IN (SELECT NULL IN (NULL));

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
DROP TABLE IF EXISTS test_table; DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table CREATE TABLE test_table

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
WITH x -> plus(lambda(1), x) AS lambda SELECT lambda(1048576); -- { serverError 1 }; WITH x -> plus(lambda(1), x) AS lambda SELECT lambda(1048576); -- { serverError 1 };

View File

@ -1,4 +1,4 @@
SET use_analyzer = 1; SET allow_experimental_analyzer = 1;
-- { echoOn } -- { echoOn }