mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
Merge 3f945619b4
into e0f8b8d351
This commit is contained in:
commit
f58759b1a7
@ -2187,7 +2187,7 @@ public:
|
||||
if constexpr (std::is_same_v<ToDataType, DataTypeString>)
|
||||
return {};
|
||||
else if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
|
||||
return {2};
|
||||
return {1, 2};
|
||||
return {1};
|
||||
}
|
||||
bool canBeExecutedOnDefaultArguments() const override { return false; }
|
||||
|
@ -1,4 +1,5 @@
|
||||
SET allow_experimental_dynamic_type=1;
|
||||
SET session_timezone = 'UTC';
|
||||
SET allow_suspicious_types_in_order_by=1;
|
||||
|
||||
DROP TABLE IF EXISTS null_table;
|
||||
@ -21,11 +22,11 @@ CREATE TABLE to_table
|
||||
)
|
||||
ENGINE = MergeTree ORDER BY n1;
|
||||
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
select '';
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
select '';
|
||||
@ -34,7 +35,7 @@ SELECT *, dynamicType(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
select '';
|
||||
ALTER TABLE to_table MODIFY COLUMN n2 Dynamic(max_types=10);
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO null_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
DROP TABLE null_table;
|
||||
|
@ -1,6 +1,7 @@
|
||||
SET allow_experimental_dynamic_type = 1;
|
||||
SET allow_suspicious_types_in_order_by = 1;
|
||||
SET optimize_read_in_order = 1;
|
||||
SET session_timezone = 'UTC';
|
||||
|
||||
drop table if exists to_table;
|
||||
|
||||
@ -11,17 +12,17 @@ CREATE TABLE to_table
|
||||
)
|
||||
ENGINE = MergeTree ORDER BY n1;
|
||||
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2), isDynamicElementInSharedData(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
select '';
|
||||
ALTER TABLE to_table MODIFY COLUMN n2 Dynamic(max_types=5);
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2), isDynamicElementInSharedData(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
select '';
|
||||
ALTER TABLE to_table MODIFY COLUMN n2 Dynamic(max_types=0);
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3, 'Asia/Istanbul')), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
INSERT INTO to_table ( n1, n2 ) VALUES (1, '2024-01-01'), (2, toDateTime64('2024-01-01', 3)), (3, toFloat32(1)), (4, toFloat64(2));
|
||||
SELECT *, dynamicType(n2), isDynamicElementInSharedData(n2) FROM to_table ORDER BY ALL;
|
||||
|
||||
ALTER TABLE to_table MODIFY COLUMN n2 Dynamic(max_types=500); -- { serverError UNEXPECTED_AST_STRUCTURE }
|
||||
|
Loading…
Reference in New Issue
Block a user