Update FunctionIfBase.h

This commit is contained in:
Kruglov Pavel 2021-06-23 19:42:20 +03:00 committed by Pavel Kruglov
parent 09dad40461
commit db3f66f422

View File

@ -16,27 +16,27 @@ class FunctionIfBase : public IFunction
public:
bool isCompilableImpl(const DataTypes & ) const override
{
// /// It's difficult to compare Date and DateTime - cannot use JIT compilation.
// bool has_date = false;
// bool has_datetime = false;
//
// for (const auto & type : types)
// {
// auto type_removed_nullable = removeNullable(type);
// WhichDataType which(type_removed_nullable);
//
// if (which.isDate())
// has_date = true;
// if (which.isDateTime())
// has_datetime = true;
//
// if (has_date && has_datetime)
// return false;
//
// if (!isCompilableType(type_removed_nullable))
// return false;
// }
return false;
/// It's difficult to compare Date and DateTime - cannot use JIT compilation.
bool has_date = false;
bool has_datetime = false;
for (const auto & type : types)
{
auto type_removed_nullable = removeNullable(type);
WhichDataType which(type_removed_nullable);
if (which.isDate())
has_date = true;
if (which.isDateTime())
has_datetime = true;
if (has_date && has_datetime)
return false;
if (!isCompilableType(type_removed_nullable))
return false;
}
return true;
}
llvm::Value * compileImpl(llvm::IRBuilderBase & builder, const DataTypes & types, Values values) const override