Skip to content

Commit 3de0699

Browse files
committed
groot/rarrow: improve documentation for RecordReader
1 parent b52cc17 commit 3de0699

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: groot/rarrow/option.go

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Package rarrow handles conversion between ROOT and ARROW data models.
65
package rarrow // import "go-hep.org/x/hep/groot/rarrow"
76

87
import (

Diff for: groot/rarrow/reader.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ func (rec *Record) NewSlice(i, j int64) array.Record {
141141
return NewRecord(rec.tree, WithStart(rec.offset+i), WithEnd(rec.offset+j))
142142
}
143143

144+
// RecordReader is an ARROW RecordReader for ROOT Trees.
145+
//
146+
// RecordReader does not materialize more than one record at a time.
147+
// The number of rows (or entries, in ROOT speak) that record loads can be configured
148+
// at creation time with the WithChunk function.
149+
// The default is one entry per record.
150+
// One can pass -1 to WithChunk to create a record with all entries of the Tree or Chain.
144151
type RecordReader struct {
145152
refs int64
146153

@@ -156,8 +163,7 @@ type RecordReader struct {
156163
rec *Record
157164
}
158165

159-
type RecordReaderOption func(r *RecordReader)
160-
166+
// NewRecordReader creates a new ARROW RecordReader from the provided ROOT Tree.
161167
func NewRecordReader(tree rtree.Tree, opts ...Option) *RecordReader {
162168
cfg := newConfig(opts)
163169

Diff for: groot/rarrow/table.go

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Package rarrow handles conversion between ROOT and ARROW data models.
65
package rarrow // import "go-hep.org/x/hep/groot/rarrow"
76

87
import (

0 commit comments

Comments
 (0)