You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: input_bigquery_select.go
    path of file: ./repos/benthos/internal/impl/gcp
    
    the code of the file until where you have to start completion: package gcp

import (
	"context"
	"encoding/json"
	"errors"
	"fmt"

	"cloud.google.com/go/bigquery"
	"google.golang.org/api/iterator"

	"github.com/benthosdev/benthos/v4/internal/shutdown"
	"github.com/benthosdev/benthos/v4/
    
func (inp *bigQuerySelectInput) Read(ctx context.Context) (*service.Message, service.AckFunc, error) {
	if inp.iterator == nil {
		return nil, nil, fmt.Errorf("query result iterator is not set: %w", service.ErrNotConnected)
	}

	var row map[string]bigquery.Value
	err := inp.iterator.Next(&row)
	if errors.Is(err, iterator.Done) {
		return nil, nil, service.ErrEndOfInput
	}
	if err != nil {
		return nil, nil, err
	}

	bs, err := json.Marshal(row)
	if err != nil {
		return nil, nil, fmt.Errorf("failed to marshal row to json: %w", err)
	}

	msg := service.NewMessage(bs)

	return msg, func(ctx context.Context, err error) error {
		// Nacks are handled by AutoRetryNacks because we don't have an explicit
		// ack mechanism right now.
		return nil
	}, nil
}