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

bigquery: nil is returned when retrieving empty nested repeated value #5066

Closed
yitzhaki opened this issue Nov 2, 2021 · 2 comments
Closed
Assignees
Labels
api: bigquery Issues related to the BigQuery API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@yitzhaki
Copy link

yitzhaki commented Nov 2, 2021

Client
local project

Environment
local environment

Go Environment
$ go version go1.16.4 windows/amd64

Package
cloud.google.com/go/bigquery v1.19.0

Code

type A struct {
	*B
}

type B struct {
	C []*C
}

type C struct {
	ValueList []string
}

q := c.bqClient.Query(query)
q.Parameters = params
job, err := q.Run(c.ctx)
if err != nil {
	return err
}
status, err := job.Wait(c.ctx)
if err != nil {
	return err
}
if err := status.Err(); err != nil && !strings.Contains(err.Error(), "Already Exists") {
	return err
}
it, err = job.Read(c.ctx)
if err != nil {
	return err
}
if err != nil {
	return err
}
a := A{B: &B{}}
err = it.Next(&a)

Expected behavior
return [] as value of ValueList

Actual behavior
nil is returned, even that the insert value of ValueList was []

@yitzhaki yitzhaki added the triage me I really want to be triaged. label Nov 2, 2021
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Nov 2, 2021
@shollyman
Copy link
Contributor

This seems to be similar to #4950

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Nov 8, 2021
@shollyman
Copy link
Contributor

Closing this one in favor of #4950; it's effectively the same issue around how we represent empty vs nil array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants