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.
: target_scale(target_scale_), name(name_)
    {
    }
    String getName() const override { return name; }
    size_t getNumberOfArguments() const override { return 1; }
    bool isVariadic() const override { return false; }
    bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & ) const override { return false; }
    bool useDefaultImplementationForConstants() const override { return true; }
    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
    {
        if (!isDateTime64(arguments[0].type))
            throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "The only argument for function {} must be DateTime64", name);
        return std::make_shared<DataTypeInt64>();
    }
    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 = ColumnInt64::create(input_rows_count);
        auto & result_data = res_column->getData();
        const auto & source_data = typeid_cast<const ColumnDecimal<DateTime64> &>(col).getData();
        const Int32 scale_diff = typeid_cast<const DataTypeDateTime64 &>(*src.type).getScale() - target_scale;
        if (scale_diff == 0)
        {
            for (size_t i = 0; i < input_rows_count; ++i)
                result_data[i] = source_data[i];
        }
        else if (scale_diff < 0)