SImplified code, updated tests.

This commit is contained in:
Vasily Nemkov 2019-10-16 22:01:21 +03:00
parent de1dfd7418
commit 1f196a52c4
2 changed files with 4 additions and 9 deletions

View File

@ -243,12 +243,6 @@ DataTypePtr getLeastSupertype(const DataTypes & types)
max_datetime64_precision = std::max(least_decimal_precision, 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);
}
}

View File

@ -129,9 +129,10 @@ INSTANTIATE_TEST_CASE_P(data_type,
{"Date DateTime", "DateTime"},
{"Date DateTime64(3)", "DateTime64(3)"},
{"DateTime DateTime64(3)", "DateTime64(3)"},
// {"DateTime64(9) DateTime64(3)", "DateTime64(9)"},
// {"DateTime DateTime64(12)", nullptr},
// {"Date DateTime64(15)", nullptr},
{"DateTime DateTime64(0)", "DateTime64(0)"},
{"DateTime64(9) DateTime64(3)", "DateTime64(3)"},
{"DateTime DateTime64(12)", "DateTime64(8)"},
{"Date DateTime64(15)", "DateTime64(13)"},
{"String FixedString(32) FixedString(8)", "String"},