mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Added IFunction::isDeterministicInScopeOfQuery().
This commit is contained in:
parent
4dc87a6fd4
commit
36da1f2871
@ -473,7 +473,7 @@ DataTypePtr FunctionBuilderImpl::getReturnType(const ColumnsWithTypeAndName & ar
|
|||||||
can_run_function_on_dictionary = false;
|
can_run_function_on_dictionary = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_type_with_dictionary && can_run_function_on_dictionary)
|
if (canBeExecutedOnLowCardinalityDictionary() && has_type_with_dictionary && can_run_function_on_dictionary)
|
||||||
return std::make_shared<DataTypeWithDictionary>(getReturnTypeWithoutDictionary(args_without_dictionary));
|
return std::make_shared<DataTypeWithDictionary>(getReturnTypeWithoutDictionary(args_without_dictionary));
|
||||||
else
|
else
|
||||||
return getReturnTypeWithoutDictionary(args_without_dictionary);
|
return getReturnTypeWithoutDictionary(args_without_dictionary);
|
||||||
|
@ -285,6 +285,9 @@ protected:
|
|||||||
*/
|
*/
|
||||||
virtual bool useDefaultImplementationForColumnsWithDictionary() const { return true; }
|
virtual bool useDefaultImplementationForColumnsWithDictionary() const { return true; }
|
||||||
|
|
||||||
|
/// If it isn't, will convert all ColumnWithDictionary arguments to full columns.
|
||||||
|
virtual bool canBeExecutedOnLowCardinalityDictionary() const { return true; }
|
||||||
|
|
||||||
virtual FunctionBasePtr buildImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & return_type) const = 0;
|
virtual FunctionBasePtr buildImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & return_type) const = 0;
|
||||||
|
|
||||||
virtual void getLambdaArgumentTypesImpl(DataTypes & /*arguments*/) const
|
virtual void getLambdaArgumentTypesImpl(DataTypes & /*arguments*/) const
|
||||||
@ -309,9 +312,10 @@ public:
|
|||||||
/// Override this functions to change default implementation behavior. See details in IMyFunction.
|
/// Override this functions to change default implementation behavior. See details in IMyFunction.
|
||||||
bool useDefaultImplementationForNulls() const override { return true; }
|
bool useDefaultImplementationForNulls() const override { return true; }
|
||||||
bool useDefaultImplementationForConstants() const override { return false; }
|
bool useDefaultImplementationForConstants() const override { return false; }
|
||||||
bool useDefaultImplementationForColumnsWithDictionary() const override { return isDeterministicInScopeOfQuery(); }
|
bool useDefaultImplementationForColumnsWithDictionary() const override { return true; }
|
||||||
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {}; }
|
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {}; }
|
||||||
bool canBeExecutedOnDefaultArguments() const override { return true; }
|
bool canBeExecutedOnDefaultArguments() const override { return true; }
|
||||||
|
bool canBeExecutedOnLowCardinalityDictionary() const override { return isDeterministicInScopeOfQuery(); }
|
||||||
|
|
||||||
using PreparedFunctionImpl::execute;
|
using PreparedFunctionImpl::execute;
|
||||||
using FunctionBuilderImpl::getReturnTypeImpl;
|
using FunctionBuilderImpl::getReturnTypeImpl;
|
||||||
@ -459,6 +463,7 @@ protected:
|
|||||||
|
|
||||||
bool useDefaultImplementationForNulls() const override { return function->useDefaultImplementationForNulls(); }
|
bool useDefaultImplementationForNulls() const override { return function->useDefaultImplementationForNulls(); }
|
||||||
bool useDefaultImplementationForColumnsWithDictionary() const override { return function->useDefaultImplementationForColumnsWithDictionary(); }
|
bool useDefaultImplementationForColumnsWithDictionary() const override { return function->useDefaultImplementationForColumnsWithDictionary(); }
|
||||||
|
bool canBeExecutedOnLowCardinalityDictionary() const override { return function->canBeExecutedOnLowCardinalityDictionary(); }
|
||||||
|
|
||||||
FunctionBasePtr buildImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & return_type) const override
|
FunctionBasePtr buildImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr & return_type) const override
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user