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: Logging field name on error in null value setting to struct field #2612

Closed
ysktir opened this issue Jul 18, 2020 · 1 comment · Fixed by #6566
Closed

bigquery: Logging field name on error in null value setting to struct field #2612

ysktir opened this issue Jul 18, 2020 · 1 comment · Fixed by #6566
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@ysktir
Copy link

ysktir commented Jul 18, 2020

Is your feature request related to a problem? Please describe.
An error occurs when the null value of bigquery set to the primitive type field of struct of go, and the following log appears.

var errNoNulls = errors.New("bigquery: NULL values cannot be read into structs")

this error log is abstract and it is difficult to debug.Especially when the number of fields in the struct is large, it takes time to find the offending field.

Describe the solution you'd like
Specifically output to the log which field name(or tag name) the error occurred in mapping.

For example, the following log.
NULL Value cannot assignable to struct field any_field_name of type int.

Describe alternatives you've considered
Add logs to the following parts of the module

err = op.setFunc(field, values[op.valueIndex])

log.Printf("set value to %s", vstruct.Type().FieldByIndex(op.fieldIndex).Name)
err = op.setFunc(field, values[op.valueIndex])
@ysktir ysktir added the triage me I really want to be triaged. label Jul 18, 2020
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Jul 18, 2020
@shollyman shollyman added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jul 20, 2020
@viktorbenei
Copy link

+1, would help a lot in debugging more complex query results.

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. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants