mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge pull request #39113 from CurtizJ/tuple-lowcardinality
Keep `LowCardinality` type in `tuple()` function
This commit is contained in:
commit
df190b14b2
@ -23,6 +23,7 @@ public:
|
||||
/// array(..., Nothing, ...) -> Array(..., Nothing, ...)
|
||||
bool useDefaultImplementationForNothing() const override { return false; }
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
|
||||
|
||||
bool isVariadic() const override { return true; }
|
||||
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
/// map(..., Nothing) -> Map(..., Nothing)
|
||||
bool useDefaultImplementationForNothing() const override { return false; }
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
|
||||
|
||||
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ public:
|
||||
|
||||
bool useDefaultImplementationForNothing() const override { return false; }
|
||||
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
|
||||
|
||||
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return false; }
|
||||
|
||||
size_t getNumberOfArguments() const override
|
||||
|
@ -55,6 +55,7 @@ public:
|
||||
/// tuple(..., Nothing, ...) -> Tuple(..., Nothing, ...)
|
||||
bool useDefaultImplementationForNothing() const override { return false; }
|
||||
bool useDefaultImplementationForConstants() const override { return true; }
|
||||
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
|
||||
|
||||
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override
|
||||
{
|
||||
|
@ -1 +1 @@
|
||||
Const(UInt8)
|
||||
Const(ColumnLowCardinality)
|
||||
|
@ -0,0 +1,12 @@
|
||||
Array(LowCardinality(String))
|
||||
Array(LowCardinality(String))
|
||||
Array(LowCardinality(String))
|
||||
Array(LowCardinality(String))
|
||||
Array(String)
|
||||
Array(String)
|
||||
Array(String)
|
||||
Array(String)
|
||||
Map(LowCardinality(String), LowCardinality(String))
|
||||
Map(LowCardinality(String), LowCardinality(String))
|
||||
Map(LowCardinality(String), LowCardinality(String))
|
||||
Map(LowCardinality(String), LowCardinality(String))
|
14
tests/queries/0_stateless/02354_array_lowcardinality.sql
Normal file
14
tests/queries/0_stateless/02354_array_lowcardinality.sql
Normal file
@ -0,0 +1,14 @@
|
||||
SELECT toTypeName([toLowCardinality('1'), toLowCardinality('2')]);
|
||||
SELECT toTypeName([materialize(toLowCardinality('1')), toLowCardinality('2')]);
|
||||
SELECT toTypeName([toLowCardinality('1'), materialize(toLowCardinality('2'))]);
|
||||
SELECT toTypeName([materialize(toLowCardinality('1')), materialize(toLowCardinality('2'))]);
|
||||
|
||||
SELECT toTypeName([toLowCardinality('1'), '2']);
|
||||
SELECT toTypeName([materialize(toLowCardinality('1')), '2']);
|
||||
SELECT toTypeName([toLowCardinality('1'), materialize('2')]);
|
||||
SELECT toTypeName([materialize(toLowCardinality('1')), materialize('2')]);
|
||||
|
||||
SELECT toTypeName(map(toLowCardinality('1'), toLowCardinality('2')));
|
||||
SELECT toTypeName(map(materialize(toLowCardinality('1')), toLowCardinality('2')));
|
||||
SELECT toTypeName(map(toLowCardinality('1'), materialize(toLowCardinality('2'))));
|
||||
SELECT toTypeName(map(materialize(toLowCardinality('1')), materialize(toLowCardinality('2'))));
|
@ -0,0 +1,4 @@
|
||||
Tuple(LowCardinality(String), LowCardinality(UInt8))
|
||||
Tuple(LowCardinality(String), LowCardinality(UInt8))
|
||||
Tuple(LowCardinality(String), LowCardinality(UInt8))
|
||||
Tuple(LowCardinality(String), LowCardinality(UInt8))
|
6
tests/queries/0_stateless/02354_tuple_lowcardinality.sql
Normal file
6
tests/queries/0_stateless/02354_tuple_lowcardinality.sql
Normal file
@ -0,0 +1,6 @@
|
||||
SET allow_suspicious_low_cardinality_types = 1;
|
||||
|
||||
SELECT toTypeName(tuple(toLowCardinality('1'), toLowCardinality(1)));
|
||||
SELECT toTypeName(tuple(materialize(toLowCardinality('1')), toLowCardinality(1)));
|
||||
SELECT toTypeName(tuple(toLowCardinality('1'), materialize(toLowCardinality(1))));
|
||||
SELECT toTypeName(tuple(materialize(toLowCardinality('1')), materialize(toLowCardinality(1))));
|
@ -0,0 +1 @@
|
||||
ColumnLowCardinality
|
1
tests/queries/0_stateless/02355_column_type_name_lc.sql
Normal file
1
tests/queries/0_stateless/02355_column_type_name_lc.sql
Normal file
@ -0,0 +1 @@
|
||||
SELECT toColumnTypeName(toLowCardinality(materialize('foo')));
|
Loading…
Reference in New Issue
Block a user