Merge pull request #3097 from zhang2014/fix/ISSUES-3059

ISSUES-3059 fix nullable type argument for aggregate function
This commit is contained in:
alexey-milovidov 2018-09-12 07:41:10 +03:00 committed by GitHub
commit 481d8f11f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -126,7 +126,7 @@ AggregateFunctionPtr AggregateFunctionFactory::getImpl(
String nested_name = name.substr(0, name.size() - combinator->getName().size()); String nested_name = name.substr(0, name.size() - combinator->getName().size());
DataTypes nested_types = combinator->transformArguments(argument_types); DataTypes nested_types = combinator->transformArguments(argument_types);
AggregateFunctionPtr nested_function = getImpl(nested_name, nested_types, parameters, recursion_level + 1); AggregateFunctionPtr nested_function = get(nested_name, nested_types, parameters, recursion_level + 1);
return combinator->transformAggregateFunction(nested_function, argument_types, parameters); return combinator->transformAggregateFunction(nested_function, argument_types, parameters);
} }

View File

@ -403,7 +403,6 @@ size_t StorageDistributed::getShardCount() const
return getCluster()->getShardCount(); return getCluster()->getShardCount();
} }
ClusterPtr StorageDistributed::getCluster() const ClusterPtr StorageDistributed::getCluster() const
{ {
return owned_cluster ? owned_cluster : context.getCluster(cluster_name); return owned_cluster ? owned_cluster : context.getCluster(cluster_name);

View File

@ -1 +1,2 @@
2017-09-10 ['a','b'] 2017-09-10 [1,2,3,4,5,6,7,NULL]
4

View File

@ -1,6 +1,6 @@
USE test; DROP TABLE IF EXISTS test.test;
DROP TABLE IF EXISTS test; CREATE TABLE test.test(date Date, keys Array(Nullable(UInt8))) ENGINE = MergeTree(date, date, 1);
CREATE TABLE test (date Date, keys Array(Nullable(String))) ENGINE = MergeTree(date, date, 1); INSERT INTO test.test VALUES ('2017-09-10', [1, 2, 3, 4, 5, 6, 7, NULL]);
INSERT INTO test VALUES ('2017-09-10', ['a', 'b']); SELECT * FROM test.test LIMIT 1;
SELECT * FROM test LIMIT 1; SELECT avgArray(keys) FROM test.test;
DROP TABLE test; DROP TABLE test.test;