enable DateTime64 to be version column

This commit is contained in:
万康 2021-05-10 20:30:52 +08:00
parent d02d14fa00
commit 308b964ca4
3 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,8 @@ public:
bool canBePromoted() const override { return false; }
bool canBeUsedAsVersion() const override { return true; }
protected:
SerializationPtr doGetDefaultSerialization() const override;
};

View File

@ -177,7 +177,7 @@ public:
*/
virtual bool canBeComparedWithCollation() const { return false; }
/** If the type is totally comparable (Ints, Date, DateTime, not nullable, not floats)
/** If the type is totally comparable (Ints, Date, DateTime, DateTime64, not nullable, not floats)
* and "simple" enough (not String, FixedString) to be used as version number
* (to select rows with maximum version).
*/

View File

@ -630,7 +630,7 @@ void MergeTreeData::MergingParams::check(const StorageInMemoryMetadata & metadat
throw Exception("The column " + version_column +
" cannot be used as a version column for storage " + storage +
" because it is of type " + column.type->getName() +
" (must be of an integer type or of type Date or DateTime)", ErrorCodes::BAD_TYPE_OF_FIELD);
" (must be of an integer type or of type Date/DateTime/DateTime64)", ErrorCodes::BAD_TYPE_OF_FIELD);
miss_column = false;
break;
}