Skip to content

Commit e8ef657

Browse files
Merge pull request ClickHouse#80304 from ClickHouse/stripe-log-use-new-serialization-formats
Allow compatible types in `StripeLog` tables
2 parents 1b7dc9c + 0161cae commit e8ef657

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

src/Formats/NativeReader.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,8 @@ Block NativeReader::read()
233233
{
234234
/// Index allows to do more checks.
235235
if (index_column_it->name != column.name)
236-
throw Exception(ErrorCodes::INCORRECT_INDEX, "Index points to column with wrong name: corrupted index or data");
237-
if (index_column_it->type != type_name)
238-
throw Exception(ErrorCodes::INCORRECT_INDEX, "Index points to column with wrong type: corrupted index or data");
236+
throw Exception(ErrorCodes::INCORRECT_INDEX, "Index points to a column with a wrong name ({} instead of {}): corrupted index or data", index_column_it->name, column.name);
237+
/// Note: we can't compare data types as strings, compatible data types may differ in parameters.
239238
}
240239

241240
/// If no rows, nothing to read.

src/Storages/StorageStripeLog.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <sys/stat.h>
21
#include <sys/types.h>
32

43
#include <optional>
@@ -24,10 +23,9 @@
2423

2524
#include <Interpreters/Context.h>
2625

27-
#include <Parsers/ASTLiteral.h>
2826
#include <Storages/StorageFactory.h>
2927
#include <Storages/StorageStripeLog.h>
30-
#include "StorageLogSettings.h"
28+
#include <Storages/StorageLogSettings.h>
3129
#include <Processors/ISource.h>
3230
#include <Processors/Sources/NullSource.h>
3331
#include <Processors/Sinks/SinkToStorage.h>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-09-21 03:03:24
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
DROP TABLE IF EXISTS test_tz;
2+
3+
CREATE TABLE test_tz
4+
(
5+
`dt` DateTime('UTC')
6+
)
7+
ENGINE = StripeLog;
8+
9+
INSERT INTO test_tz VALUES ('2022-09-21 03:03:24');
10+
11+
SELECT *
12+
FROM test_tz;
13+
14+
DROP TABLE test_tz;

0 commit comments

Comments
 (0)