21.2:

```
milovidov-desktop :) SELECT CAST(1111111111.222 AS DateTime64(3))

SELECT cast(1111111111.222, 'DateTime64(3)')

Query id: d10c8623-5c74-4a38-b535-a99f6af4d28d

┌─cast(1111111111.222, 'DateTime64(3)')─┐
│               2005-03-18 04:58:31.222 │
└───────────────────────────────────────┘
```

master:

```
milovidov-desktop :) SELECT CAST(1111111111.222 AS DateTime64(3))

SELECT cast(1111111111.222, 'DateTime64(3)')

Query id: cb4af967-a4ae-4df5-89ba-234d68675f93

┌─cast(1111111111.222, 'DateTime64(3)')─┐
│               2005-03-18 04:58:31.000 │
└───────────────────────────────────────┘
```
{
        const auto & column = arguments.back().column;
        if (!column)
            throw Exception("Second argument to " + getName() + " must be a constant string describing type."
                " Instead there is non-constant column of type " + arguments.back().type->getName(),
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        const auto * type_col = checkAndGetColumnConst<ColumnString>(column.get());
        if (!type_col)
            throw Exception("Second argument to " + getName() + " must be a constant string describing type."
                " Instead there is a column with the following structure: " + column->dumpStructure(),
                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
        DataTypePtr type = DataTypeFactory::instance().get(type_col->getValue<String>());
        if constexpr (cast_type == CastType::accurateOrNull)
        {
            return makeNullable(type);
        }
        else
        {
            if (keep_nullable && arguments.front().type->isNullable())
                return makeNullable(type);
            return type;
        }
    }
    bool useDefaultImplementationForNulls() const override { return false; }