Skip to content

Commit

Permalink
Updated example and docs for GetArrowBatches (databricks#171)
Browse files Browse the repository at this point in the history
Updated the example and documentation for GetArrowBatches to include
releasing the arrow batch.
Signed-off-by: Raymond Cypher <[email protected]>
  • Loading branch information
rcypher-databricks authored Oct 2, 2023
2 parents e95dd4a + f1676f2 commit 951c01b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ Example usage:
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
iBatch += 1
nRows += int(b.NumRows())
b.Release()
}
log.Printf("NRows: %v\n", nRows)
}
Expand Down
2 changes: 2 additions & 0 deletions examples/arrrowbatches/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func loopWithHasNext(db *sql.DB) {
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
iBatch += 1
nRows += int(b.NumRows())
b.Release()
}
log.Printf("NRows: %v\n", nRows)
}
Expand Down Expand Up @@ -128,6 +129,7 @@ func loopWithNext(db *sql.DB) {
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
iBatch += 1
nRows += int(b.NumRows())
b.Release()
}

log.Printf("NRows: %v\n", nRows)
Expand Down

0 comments on commit 951c01b

Please sign in to comment.