package main import ( "context" "database/sql" "fmt" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" ) func main() { db, err := sql.Open("tidb", "username:password@tcp(ip_address)/database_name") if err != nil { panic(err) } defer db.Close() rows, err := db.QueryContext(context.Background(), "SELECT * FROM table_name") if err != nil { panic(err) } defer rows.Close() recordSet := chunk.NewRecordBatch(rs.Fields()) for rows.Next() { err := rs.Next(ctx, recordSet) if err != nil { panic(err) } for i := 0; i < recordSet.NumRows(); i++ { fmt.Printf("row: %v\n", recordSet.GetRow(i).GetString(0)) } } }This example demonstrates how to use the Recordset module to retrieve rows from a SQL query and process them in small chunks. It starts by connecting to a TiDB database using the `database/sql` package. Then it executes a SQL query using the `db.QueryContext()` method, which returns a `*sql.Rows` struct. The `rows` struct is then passed to the `chunk.NewRecordBatch(rs.Fields())` function to create a new `*rsets.Recordset` struct. This struct can be used to retrieve the rows in small chunks. The `rs.Next(ctx, recordSet)` method is used to retrieve the next chunk of rows. The `recordSet` struct is then used to iterate over the rows using the `recordSet.NumRows()` and `recordSet.GetRow(i)` methods. This allows us to print out the first column of each row.