```
SET compile_expressions = 1
SELECT GREATEST(2,0)
```

{
        bool first_is_date_or_datetime = isDateOrDateTime(type0);
        bool second_is_date_or_datetime = isDateOrDateTime(type1);
        
        if (first_is_date_or_datetime == second_is_date_or_datetime)
            return {};
        
        
        static constexpr bool function_is_plus = std::is_same_v<Op<UInt8, UInt8>, PlusImpl<UInt8, UInt8>>;
        static constexpr bool function_is_minus = std::is_same_v<Op<UInt8, UInt8>, MinusImpl<UInt8, UInt8>>;
        if (!function_is_plus && !function_is_minus)
            return {};
        const DataTypePtr & type_time = first_is_date_or_datetime ? type0 : type1;
        const DataTypePtr & type_interval = first_is_date_or_datetime ? type1 : type0;
        bool interval_is_number = isNumber(type_interval);
        const DataTypeInterval * interval_data_type = nullptr;
        if (!interval_is_number)
        {
            interval_data_type = checkAndGetDataType<DataTypeInterval>(type_interval.get());
            if (!interval_data_type)
                return {};
        }
        if (second_is_date_or_datetime && function_is_minus)
            throw Exception("Wrong order of arguments for function " + getName() + ": argument of type Interval cannot be first.",
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        std::string function_name;
        if (interval_data_type)
        {