Skip to content

Commit

Permalink
fix: larger scanner buffer (#3369)
Browse files Browse the repository at this point in the history
Signed-off-by: Song Gao <[email protected]>
  • Loading branch information
Yisaer authored Nov 11, 2024
1 parent d62d2ed commit bfbb96d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/io/file/line_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func (r *LineReader) Close() error {
func CreateLineReader(ctx api.StreamContext, fileStream io.Reader, config *FileSourceConfig) (FormatReader, error) {
scanner := bufio.NewScanner(fileStream)
scanner.Split(bufio.ScanLines)
// 1MB buffer
scanner.Buffer(nil, 1<<20)

reader := &LineReader{}
reader.scanner = scanner
Expand Down

0 comments on commit bfbb96d

Please sign in to comment.