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

Avoid panic when decoding an array of tuple with nullable properties … #817

Merged
merged 2 commits into from
Nov 19, 2022

Conversation

stephane-moreau
Copy link
Contributor

Following a debugging session of issue #816

It seems that the proposed change do fix the issue

@CLAassistant
Copy link

CLAassistant commented Nov 15, 2022

CLA assistant check
All committers have signed the CLA.

…e is nullable

ex: for nullable(int32) we should not provide a int32(0) but an empty value in the map (preserving null or undefined values)
@gingerwizard
Copy link
Collaborator

@stephane-moreau can you sign the CLA?

@stephane-moreau
Copy link
Contributor Author

@stephane-moreau can you sign the CLA?

Validation is in progress with my company, should be ok soon

@stephane-moreau
Copy link
Contributor Author

@stephane-moreau can you sign the CLA?

done

@gingerwizard
Copy link
Collaborator

I think this is very close @stephane-moreau but I think we need to insert nils if nullable i.e.

if _, isNullable := c.(*Nullable); !isNullable {
					targetMap.SetMapIndex(reflect.ValueOf(colName), reflect.Zero(c.ScanType().Elem()))
				} else {
					targetMap.SetMapIndex(reflect.ValueOf(colName), reflect.Zero(c.ScanType()))
				}

I'm going to merge and follow up with a small PR and test. Thanks again.

@gingerwizard gingerwizard merged commit 3a28eee into ClickHouse:main Nov 19, 2022
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

Successfully merging this pull request may close these issues.

3 participants