-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Integer type inference seems confusing #51236
Copy link
Copy link
Closed
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
Integer type inference seems incorect incorect
select [-4741124612489978151, -3236599669630092879, 5607475129431807682]thow this exception
Received exception from server (version 23.3.2):
Code: 386. DB::Exception: Received from localhost:9101. DB::Exception: There is no supertype for types UInt64, Int64 because some of them are signed integers and some are unsigned integers, but there is no signed integer type, that can exactly represent all required unsigned integer values: While processing transform(commit, [-4741124612489978151, -3236599669630092879, 5607475129431807682], range(toInt64(3))). (NO_COMMON_TYPE)
while in fact all value could fit in Int64.
exemple
SELECT [-4741124612489978151, -3236599669630092879, toInt64(5607475129431807682)]
┌─array(-4741124612489978151, -3236599669630092879, toInt64(5607475129431807682))─┐
│ [-4741124612489978151,-3236599669630092879,5607475129431807682] │
└─────────────────────────────────────────────────────────────────────────────────┘
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.