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.
{
            const Int64 scale_multiplier = DecimalUtils::scaleMultiplier<Int64>(-scale_diff);
            for (size_t i = 0; i < input_rows_count; ++i)
            {
                Int64 result_value = source_data[i];
                if (common::mulOverflow(result_value, scale_multiplier, result_value))
                    throw Exception("Decimal overflow in " + getName(), ErrorCodes::DECIMAL_OVERFLOW);
                result_data[i] = result_value;
            }
        }
        else
        {
            const Int64 scale_multiplier = DecimalUtils::scaleMultiplier<Int64>(scale_diff);
            for (size_t i = 0; i < input_rows_count; ++i)
                result_data[i] = Int64(source_data[i]) / scale_multiplier;
        }
        return res_column;
    }
};
class FunctionFromUnixTimestamp64 : public IFunction
{
private:
    size_t target_scale;
    const char * name;
public:
    FunctionFromUnixTimestamp64(size_t target_scale_, const char * name_)
        : target_scale(target_scale_), name(name_)
    {
    }
    String getName() const override { return name; }