mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
SImplified code, updated tests.
This commit is contained in:
parent
de1dfd7418
commit
1f196a52c4
@ -243,12 +243,6 @@ DataTypePtr getLeastSupertype(const DataTypes & types)
|
|||||||
max_datetime64_precision = std::max(least_decimal_precision, max_datetime64_precision);
|
max_datetime64_precision = std::max(least_decimal_precision, max_datetime64_precision);
|
||||||
|
|
||||||
const UInt32 scale = DataTypeDateTime64::maxPrecision() - max_datetime64_precision;
|
const UInt32 scale = DataTypeDateTime64::maxPrecision() - max_datetime64_precision;
|
||||||
if (max_datetime64_precision == 0)
|
|
||||||
{
|
|
||||||
throw Exception(getExceptionMessagePrefix(types) + " because some of them have no lossless convertion to DateTime64",
|
|
||||||
ErrorCodes::NO_COMMON_TYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::make_shared<DataTypeDateTime64>(scale);
|
return std::make_shared<DataTypeDateTime64>(scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,9 +129,10 @@ INSTANTIATE_TEST_CASE_P(data_type,
|
|||||||
{"Date DateTime", "DateTime"},
|
{"Date DateTime", "DateTime"},
|
||||||
{"Date DateTime64(3)", "DateTime64(3)"},
|
{"Date DateTime64(3)", "DateTime64(3)"},
|
||||||
{"DateTime DateTime64(3)", "DateTime64(3)"},
|
{"DateTime DateTime64(3)", "DateTime64(3)"},
|
||||||
// {"DateTime64(9) DateTime64(3)", "DateTime64(9)"},
|
{"DateTime DateTime64(0)", "DateTime64(0)"},
|
||||||
// {"DateTime DateTime64(12)", nullptr},
|
{"DateTime64(9) DateTime64(3)", "DateTime64(3)"},
|
||||||
// {"Date DateTime64(15)", nullptr},
|
{"DateTime DateTime64(12)", "DateTime64(8)"},
|
||||||
|
{"Date DateTime64(15)", "DateTime64(13)"},
|
||||||
|
|
||||||
{"String FixedString(32) FixedString(8)", "String"},
|
{"String FixedString(32) FixedString(8)", "String"},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user