SELECT toYYYYMMDD(fromUnixTimestamp64Micro(1599672041963889))


Received exception from server (version 20.9.1):
Code: 43. DB::Exception: Received from localhost:9000. 
DB::Exception: Illegal type of argument #0 'value' of function fromUnixTimestamp64Micro, expected Int64, got UInt64.
size_t getNumberOfArguments() const override { return 0; }
    bool isVariadic() const override { return true; }
    bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & ) const override { return false; }
    bool useDefaultImplementationForConstants() const override { return true; }
    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
    {
        if (arguments.size() < 1 || arguments.size() > 2)
            throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Function {} takes one or two arguments", name);
        if (!typeid_cast<const DataTypeInt64 *>(arguments[0].type.get()))
            throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "The first argument for function {} must be Int64", name);
        std::string timezone;
        if (arguments.size() == 2)
            timezone = extractTimeZoneNameFromFunctionArguments(arguments, 1, 0);
        return std::make_shared<DataTypeDateTime64>(target_scale, timezone);
    }
    ColumnPtr executeImpl(const ColumnsWithTypeAndName & arguments, const DataTypePtr &, size_t input_rows_count) const override
    {
        const auto & src = arguments[0];
        const auto & col = *src.column;
        auto res_column = ColumnDecimal<DateTime64>::create(input_rows_count, target_scale);
        auto & result_data = res_column->getData();
        const auto & source_data = typeid_cast<const ColumnInt64 &>(col).getData();
        for (size_t i = 0; i < input_rows_count; ++i)
            result_data[i] = source_data[i];
        return res_column;
    }
};
}