Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse Column type: SimpleAggregateFunction(max, DateTime64(3, 'UTC')) #412

Closed
utkarsh-sib opened this issue Sep 3, 2021 · 1 comment

Comments

@utkarsh-sib
Copy link

utkarsh-sib commented Sep 3, 2021

When reading from a table with column type SimpleAggregateFunction(max, DateTime64(3, 'UTC')) the following code tries to split max, DateTime64(3, 'UTC') by ,. Which results in an array of length 3. With parts max, DateTime64(3, UTC').

func getNestedType(chType string, wrapType string) (string, error) {
prefixLen := len(wrapType) + 1
suffixLen := 1
if len(chType) > prefixLen+suffixLen {
nested := strings.Split(chType[prefixLen:len(chType)-suffixLen], ",")
if len(nested) == 2 {
return strings.TrimSpace(nested[1]), nil
}
}
return "", fmt.Errorf("column: invalid %s type (%s)", wrapType, chType)
}

This function returns an error if the length of the splitted array is not equal to 2.
Please check.
Thanks.

@utkarsh-sib utkarsh-sib changed the title Library fails to parse Column type: SimpleAggregateFunction(max, DateTime64(3, 'UTC')) Failed to parse Column type: SimpleAggregateFunction(max, DateTime64(3, 'UTC')) Sep 3, 2021
kshvakov added a commit that referenced this issue Jan 19, 2022
@kshvakov
Copy link
Collaborator

Fixed in V2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants