From aa7a49b1cc5ca75911e75b25b28d1416830666c5 Mon Sep 17 00:00:00 2001 From: Ewan Date: Thu, 16 Sep 2021 15:40:47 -0400 Subject: [PATCH] Fix not supporting SimpleAggregateFunction types which require a second input value (delimited by a comma) --- lib/column/column.go | 5 +++++ lib/column/column_test.go | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/column/column.go b/lib/column/column.go index 10a3dc6a3e..60b1f9692f 100644 --- a/lib/column/column.go +++ b/lib/column/column.go @@ -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) } diff --git a/lib/column/column_test.go b/lib/column/column_test.go index 6e1a1d1bca..4ca38cb327 100644 --- a/lib/column/column_test.go +++ b/lib/column/column_test.go @@ -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 {