| 19 | namespace DB::Statistics |
| 20 | { |
| 21 | auto StatsTableIdentifier::getUniqueKey() const -> UUID |
| 22 | { |
| 23 | auto uuid = getUUID(); |
| 24 | |
| 25 | if (uuid == UUID{}) |
| 26 | { |
| 27 | // some table may return empty uuid, use hash for temporary fix |
| 28 | auto hash_db = std::hash<String>()(getDatabaseName()); |
| 29 | auto hash_tb = std::hash<String>()(getTableName()); |
| 30 | hash_db = (hash_db & 0xffffffffffff0fffull) | 0x0000000000004000ull; |
| 31 | hash_tb = (hash_tb & 0x3fffffffffffffffull) | 0x8000000000000000ull; |
| 32 | |
| 33 | uuid.toUnderType().items[0] = hash_db; |
| 34 | uuid.toUnderType().items[1] = hash_tb; |
| 35 | } |
| 36 | return uuid; |
| 37 | } |
| 38 | } |
no test coverage detected