Skip to content

bigquery: panic with NULL RANGE values #11047

@datbth

Description

@datbth

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})

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions