Revert change, fix injectiveness

This commit is contained in:
kssenii 2021-06-29 14:54:32 +00:00
parent e49930fde3
commit 6816e8c5aa
4 changed files with 5 additions and 13 deletions

View File

@ -29,6 +29,11 @@ public:
return name;
}
bool isInjective(const ColumnsWithTypeAndName & /*sample_columns*/) const override
{
return true;
}
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
size_t getNumberOfArguments() const override

View File

@ -219,9 +219,6 @@ const ActionsDAG::Node & ActionsDAG::addFunction(
column = node.function_base->getConstantResultForNonConstArguments(arguments, node.result_type);
}
if (all_const && column && !isColumnConst(*column) && column->size() == 1)
column = ColumnConst::create(std::move(column), 1);
/// If the result is not a constant, just in case, we will consider the result as unknown.
if (column && isColumnConst(*column))
{

View File

@ -1,6 +1,2 @@
1 0
1 0
1 0
1 0
1 1 0
0 0 0

View File

@ -1,8 +1,2 @@
SELECT 1 as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
SELECT materialize(1) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
SELECT materialize(1) as a, count() FROM numbers(10) WHERE 0 ORDER BY a;
SELECT isConstant(1) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
SELECT 1 as b, isConstant(b) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;
SELECT 0 as b, least(isConstant(materialize(1)), b) as a, count() FROM numbers(10) WHERE 0 GROUP BY a;