func printTable(ctx context.Context, client *bigquery.Client, t *bigquery.Table) { it, err := client.Read(ctx, t) if err != nil { log.Fatalf("Reading: %v", err) } id := t.FullyQualifiedName() fmt.Printf("%s\n%s\n", id, strings.Repeat("-", len(id))) printValues(ctx, it) }
func printQueryResults(ctx context.Context, client *bigquery.Client, queryJobID string) { job, err := client.JobFromID(ctx, queryJobID) if err != nil { log.Fatalf("Loading job: %v", err) } it, err := client.Read(ctx, job) if err != nil { log.Fatalf("Reading: %v", err) } // TODO: print schema. printValues(ctx, it) }