MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / convertIsCompilableImpl

Function convertIsCompilableImpl

src/Functions/FunctionsConversion.cpp:2782–2809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2780}
2781
2782bool convertIsCompilableImpl(const DataTypes & types, const DataTypePtr & result_type)
2783{
2784 if (types.empty())
2785 return false;
2786
2787 if (!canBeNativeType(types[0]) || !canBeNativeType(result_type))
2788 return false;
2789
2790 return castBothTypes(
2791 types[0].get(),
2792 result_type.get(),
2793 [](const auto & left, const auto & right)
2794 {
2795 using LeftDataType = std::decay_t<decltype(left)>;
2796 using RightDataType = std::decay_t<decltype(right)>;
2797
2798 if constexpr (IsDataTypeDecimalOrNumber<LeftDataType> && IsDataTypeDecimalOrNumber<RightDataType>)
2799 {
2800 if constexpr (IsDataTypeNumber<LeftDataType> && IsDataTypeNumber<RightDataType>)
2801 return true;
2802 else if constexpr (IsDataTypeNumber<LeftDataType> && IsDataTypeDecimal<RightDataType>)
2803 return true;
2804 else if constexpr (IsDataTypeDecimal<LeftDataType> && IsDataTypeNumber<RightDataType>)
2805 return true;
2806 }
2807 return false;
2808 });
2809}
2810
2811llvm::Value * convertCompileImpl(llvm::IRBuilderBase & builder, const ValuesWithType & arguments, const DataTypePtr & result_type)
2812{

Callers

nothing calls this directly

Calls 4

castBothTypesFunction · 0.85
canBeNativeTypeFunction · 0.50
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected