Skip to content

Commit c47e24b

Browse files
authored
Merge pull request ClickHouse#416 from ewanwalk/fix(SimpleAggregateFunctions)
Fix not supporting SimpleAggregateFunction types not working on types with more than one arguement
2 parents 1ae00d3 + aa7a49b commit c47e24b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/column/column.go

+5
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ func getNestedType(chType string, wrapType string) (string, error) {
195195
if len(nested) == 2 {
196196
return strings.TrimSpace(nested[1]), nil
197197
}
198+
199+
if len(nested) == 3 {
200+
return strings.TrimSpace(strings.Join(nested[1:], ",")), nil
201+
}
198202
}
203+
199204
return "", fmt.Errorf("column: invalid %s type (%s)", wrapType, chType)
200205
}

lib/column/column_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ func Test_Column_SimpleAggregateFunc(t *testing.T) {
632632
"SimpleAggregateFunction(anyLast, UInt8)": "UInt8",
633633
"SimpleAggregateFunction(anyLast, Nullable(IPv4))": "Nullable(IPv4)",
634634
"SimpleAggregateFunction(max, Nullable(DateTime))": "Nullable(DateTime)",
635+
"SimpleAggregateFunction(sum, Decimal(38, 8))": "Decimal(38, 8)",
635636
}
636637

637638
for key, val := range data {

0 commit comments

Comments
 (0)