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 IColumn & col_from = *arguments[0].column;
        size_t size = col_from.size();
        const IDataType & data_type_to = *result_type;
        if (const ColumnString * col_from_string = checkAndGetColumn<ColumnString>(&col_from))
        {
            auto res = data_type_to.createColumn();
            IColumn & column_to = *res;
            column_to.reserve(size);
            const ColumnString::Chars & chars = col_from_string->getChars();
            const IColumn::Offsets & offsets = col_from_string->getOffsets();
            size_t current_offset = 0;
            FormatSettings format_settings;
            for (size_t i = 0; i < size; ++i)
            {
                ReadBufferFromMemory read_buffer(&chars[current_offset], offsets[i] - current_offset - 1);
                data_type_to.deserializeAsWholeText(column_to, read_buffer, format_settings);
                if (!read_buffer.eof())
                    throwExceptionForIncompletelyParsedValue(read_buffer, result_type);
                current_offset = offsets[i];
            }
            return res;
        }
        else
            throw Exception("Illegal column " + arguments[0].column->getName()
                    + " of first argument of conversion function from string",
                ErrorCodes::ILLEGAL_COLUMN);