Skip to content

Commit

Permalink
docs(bigquery): add numeric and bignumeric to RowIterator docs (#6560)
Browse files Browse the repository at this point in the history
Document field type conversions for `NUMERIC` and `BIGNUMERIC` types when using the `RowIterator` for reading data from BigQuery. 

Solves issue #6492
  • Loading branch information
alvarowolfx authored Aug 25, 2022
1 parent e8955d9 commit bea4028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bigquery/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ func TestIntegration_InsertAndReadNullable(t *testing.T) {
ctm := civil.Time{Hour: 15, Minute: 4, Second: 5, Nanosecond: 6000}
cdt := civil.DateTime{Date: testDate, Time: ctm}
rat := big.NewRat(33, 100)
rat2 := big.NewRat(66, 100)
rat2 := big.NewRat(66, 10e10)
geo := "POINT(-122.198939 47.669865)"

// Nil fields in the struct.
Expand Down
6 changes: 6 additions & 0 deletions bigquery/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ type pageFetcher func(ctx context.Context, _ *rowSource, _ Schema, startIndex ui
// DATE civil.Date
// TIME civil.Time
// DATETIME civil.DateTime
// NUMERIC *big.Rat
// BIGNUMERIC *big.Rat
//
// The big.Rat type supports numbers of arbitrary size and precision.
// See https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#numeric-type
// for more on NUMERIC.
//
// A repeated field corresponds to a slice or array of the element type. A STRUCT
// type (RECORD or nested schema) corresponds to a nested struct or struct pointer.
Expand Down

0 comments on commit bea4028

Please sign in to comment.