a setting

This commit is contained in:
Alexander Kuzmenkov 2020-12-18 04:25:21 +03:00
parent 5e19eaf2f0
commit 4bfcb2fc16
3 changed files with 12 additions and 0 deletions

View File

@ -405,6 +405,7 @@ class IColumn;
M(Bool, optimize_skip_merged_partitions, false, "Skip partitions with one part with level > 0 in optimize final", 0) \
M(Bool, optimize_on_insert, true, "Do the same transformation for inserted block of data as if merge was done on this block.", 0) \
M(Bool, allow_experimental_map_type, false, "Allow data type Map", 0) \
M(Bool, allow_experimental_window_functions, false, "Allow experimental window functions", 0) \
\
M(Bool, use_antlr_parser, false, "Parse incoming queries using ANTLR-generated parser", 0) \
\

View File

@ -472,6 +472,15 @@ bool ExpressionAnalyzer::makeAggregateDescriptions(ActionsDAGPtr & actions)
bool ExpressionAnalyzer::makeWindowDescriptions(ActionsDAGPtr & actions)
{
// Convenient to check here because at least we have the Context.
if (windowFunctions().size() > 0 &&
!context.getSettingsRef().allow_experimental_window_functions)
{
throw Exception(ErrorCodes::NOT_IMPLEMENTED,
"Window functions are not implemented (while processing '{}')",
windowFunctions()[0]->formatForErrorMessage());
}
for (const ASTFunction * function_node : windowFunctions())
{
assert(function_node->is_window_function);

View File

@ -1,5 +1,7 @@
-- { echo }
set allow_experimental_window_functions = 1;
-- just something basic
select number, count() over (partition by intDiv(number, 3) order by number) from numbers(10);