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: panic with NULL RANGE values #11047

Closed
datbth opened this issue Oct 29, 2024 · 0 comments · Fixed by #11058
Closed

bigquery: panic with NULL RANGE values #11047

datbth opened this issue Oct 29, 2024 · 0 comments · Fixed by #11058
Assignees
Labels
api: bigquery Issues related to the BigQuery API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@datbth
Copy link

datbth commented Oct 29, 2024

Client

BigQuery

Environment

  • go version go1.23.1 linux/amd64
  • Ubuntu 24.04.1 LTS

Code and Dependencies

package main

func main() {
  sql := "select RANGE<DATE> '[2023-01-01, 2024-01-01)' union all select null"
  client, err := bigquery.NewClient(ctx, options...)
  query := client.Query(sql)
  iter, err := query.Read(ctx)
  
  var row []bigquery.Value
  iter.Next(&row)
  iter.Next(&row)
}
go.mod
module modname

go 1.23.1

require (
   cloud.google.com/go/bigquery v1.63.1
)

Expected behavior

Handle value as nil properly without panic: row is [nil]

Actual behavior

Panic

  • type: *runtime.TypeAssertionError
  • message: interface conversion: interface {} is nil, not string
/home/datbth/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:785 +0x132
cloud.google.com/go/bigquery.convertRangeTableCell(0x0?, 0xc000e089c0?)
/home/datbth/go/pkg/mod/cloud.google.com/go/[email protected]/value.go:1077 +0x93
cloud.google.com/go/bigquery.convertRow(0x0?, {0xc00003a0c0, 0x2359870?, 0xc000d7e750?})
/home/datbth/go/pkg/mod/cloud.google.com/go/[email protected]/value.go:903 +0xfd
cloud.google.com/go/bigquery.convertRows({0xc001498900, 0x2, 0x206602c?}, {0xc00003a0c0, 0x1, 0x1})
/home/datbth/go/pkg/mod/cloud.google.com/go/[email protected]/value.go:880 +0xb6
cloud.google.com/go/bigquery.fetchJobResultPage({0x2359870, 0xc000d7e750}, 0xc000d1a6e0, {0xc00003a0c0, 0x1, 0x1}, 0x0, 0x0, {0x0, 0x0})
@datbth datbth added the triage me I really want to be triaged. label Oct 29, 2024
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Oct 29, 2024
@alvarowolfx alvarowolfx added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed triage me I really want to be triaged. labels Oct 29, 2024
gcf-merge-on-green bot pushed a commit that referenced this issue Oct 29, 2024
gcf-merge-on-green bot pushed a commit that referenced this issue Oct 30, 2024
🤖 I have created a release *beep* *boop*
---


## [1.64.0](https://togithub.com/googleapis/google-cloud-go/compare/bigquery/v1.63.1...bigquery/v1.64.0) (2024-10-30)


### Features

* **bigquery/datatransfer:** Add scheduleOptionsV2 and Error fields for TransferConfig ([78d8513](https://togithub.com/googleapis/google-cloud-go/commit/78d8513f7e31c6ef118bdfc784049b8c7f1e3249))
* **bigquery/storage:** Add experimental ArrowData type and arrow_data field within AppendRowsRequest ([f0b05e2](https://togithub.com/googleapis/google-cloud-go/commit/f0b05e260435d5e8889b9a0ca0ab215fcde169ab))


### Bug Fixes

* **bigquery:** Handle null RANGE ([#11058](https://togithub.com/googleapis/google-cloud-go/issues/11058)) ([9979e72](https://togithub.com/googleapis/google-cloud-go/commit/9979e72b57947ec1e11d3e0c4a7e1ec335a490cf)), refs [#11047](https://togithub.com/googleapis/google-cloud-go/issues/11047)
* **bigquery:** Parse negative NUMERIC from arrow ([#11052](https://togithub.com/googleapis/google-cloud-go/issues/11052)) ([83352c4](https://togithub.com/googleapis/google-cloud-go/commit/83352c475681f596e0f1e811f8c2056aef6179b2))
* **bigquery:** Update google.golang.org/api to v0.203.0 ([8bb87d5](https://togithub.com/googleapis/google-cloud-go/commit/8bb87d56af1cba736e0fe243979723e747e5e11e))
* **bigquery:** WARNING: On approximately Dec 1, 2024, an update to Protobuf will change service registration function signatures to use an interface instead of a concrete type in generated .pb.go files. This change is expected to affect very few if any users of this client library. For more information, see https://togithub.com/googleapis/google-cloud-go/issues/11020. ([8bb87d5](https://togithub.com/googleapis/google-cloud-go/commit/8bb87d56af1cba736e0fe243979723e747e5e11e))


### Documentation

* **bigquery:** Link types on package docs ([#11036](https://togithub.com/googleapis/google-cloud-go/issues/11036)) ([c4af6fe](https://togithub.com/googleapis/google-cloud-go/commit/c4af6fe0962e0e96223744a09fd7b5a638cd92fd))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants