Skip to content

Commit

Permalink
Merge pull request #416 from ewanwalk/fix(SimpleAggregateFunctions)
Browse files Browse the repository at this point in the history
Fix not supporting SimpleAggregateFunction types not working on types with more than one arguement
  • Loading branch information
kshvakov authored Sep 17, 2021
2 parents 1ae00d3 + aa7a49b commit c47e24b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/column/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ func getNestedType(chType string, wrapType string) (string, error) {
if len(nested) == 2 {
return strings.TrimSpace(nested[1]), nil
}

if len(nested) == 3 {
return strings.TrimSpace(strings.Join(nested[1:], ",")), nil
}
}

return "", fmt.Errorf("column: invalid %s type (%s)", wrapType, chType)
}
1 change: 1 addition & 0 deletions lib/column/column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ func Test_Column_SimpleAggregateFunc(t *testing.T) {
"SimpleAggregateFunction(anyLast, UInt8)": "UInt8",
"SimpleAggregateFunction(anyLast, Nullable(IPv4))": "Nullable(IPv4)",
"SimpleAggregateFunction(max, Nullable(DateTime))": "Nullable(DateTime)",
"SimpleAggregateFunction(sum, Decimal(38, 8))": "Decimal(38, 8)",
}

for key, val := range data {
Expand Down

0 comments on commit c47e24b

Please sign in to comment.