Skip to content

bigquery: total rows has incorrect value #11873

Description

@zecke

Client

bigquery

Environment

Go 1.22

Code and Dependencies

package main

func main() {
    // ...
    var values []bigquery.Value
    err := it.Next(&values)
    if err == iterator.Done {
        return
    }
    if err != nil {
        // TODO: Handle error.
    }
    fmt.Println(it.TotalRows)
}

Expected behavior

it.TotalRows() should have the correct value after the first call to RowIterator.Next(context.Context)

Actual behavior

When the first call of it.Next(ctx) hits the paged cache the length of the cache is returned and not the total number of rows.

totalRows: uint64(len(converted)),

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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