```sql
create table dat (blockNum Decimal(10,0), eventTimestamp DateTime64(9) ) 
Engine=MergeTree() primary key eventTimestamp;
insert into dat values (1, '2022-01-24 02:30:00.008122000');

CREATE DICTIONARY datDictionary
(
    `blockNum` Decimal(10, 0),
    `eventTimestamp` DateTime64(9)
)
PRIMARY KEY blockNum
SOURCE(CLICKHOUSE(TABLE 'dat'))
LIFETIME(MIN 0 MAX 1000)
LAYOUT(FLAT());

select * from datDictionary;
┌─blockNum─┬────────────────eventTimestamp─┐
│        1 │ 2022-01-24 02:30:00.008122000 │
└──────────┴───────────────────────────────┘

select count(*) from dat where eventTimestamp >= (select eventTimestamp from datDictionary);

Exception on client:
Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000. (ATTEMPT_TO_READ_AFTER_EOF)

Connecting to localhost:9000 as user default.
Code: 210. DB::NetException: Connection refused (localhost:9000). (NETWORK_ERROR)
```

```sql
drop dictionary datDictionary;

CREATE DICTIONARY datDictionary
(
    `blockNum` Decimal(10, 0),
    `eventTimestamp` DateTime64(9)
)
PRIMARY KEY blockNum
SOURCE(CLICKHOUSE(TABLE 'dat'))
LIFETIME(MIN 0 MAX 1000)
LAYOUT(complex_key_hashed());

select count(*) from dat where eventTimestamp >= (select eventTimestamp from datDictionary);

Error on processing query: Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000. (ATTEMPT_TO_READ_AFTER_EOF) (version 22.7.1.1054)

Connecting to localhost:9000 as user default.
Code: 210. DB::NetException: Connection refused (localhost:9000). (NETWORK_ERROR)
```

```sql
select * from datDictionary;
┌─blockNum─┬────────────────eventTimestamp─┐
│        1 │ 2022-01-24 02:30:00.008122000 │
└──────────┴───────────────────────────────┘

select dictGet('datDictionary', 'eventTimestamp', tuple(cast('1','Decimal(10,0)')));
Code: 407. DB::Exception: Received from localhost:9000. DB::Exception: Bad scale of decimal field. (DECIMAL_OVERFLOW)
```

{
            bool all_strings = type_ids.size() == (have_string + have_fixed_string);
            if (!all_strings)
                return throwOrReturn<on_error>(types, "because some of them are String/FixedString and some of them are not", ErrorCodes::NO_COMMON_TYPE);
            return std::make_shared<DataTypeString>();
        }
    }
    
    {
        UInt32 have_date = type_ids.count(TypeIndex::Date);
        UInt32 have_date32 = type_ids.count(TypeIndex::Date32);
        UInt32 have_datetime = type_ids.count(TypeIndex::DateTime);
        UInt32 have_datetime64 = type_ids.count(TypeIndex::DateTime64);
        if (have_date || have_date32 || have_datetime || have_datetime64)
        {
            bool all_date_or_datetime = type_ids.size() == (have_date + have_date32 + have_datetime + have_datetime64);
            if (!all_date_or_datetime)
                return throwOrReturn<on_error>(types,
                    "because some of them are Date/Date32/DateTime/DateTime64 and some of them are not",
                    ErrorCodes::NO_COMMON_TYPE);
            if (have_datetime64 == 0 && have_date32 == 0)
            {
                for (const auto & type : types)
                {
                    if (isDateTime(type))
                        return type;
                }
                return std::make_shared<DataTypeDateTime>();
            }