Skip to content

Commit 4176830

Browse files
committed
feat: Allow UInt64ArrayFromValue
This allows us to use it in RecordTransformers
1 parent bc9b670 commit 4176830

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

schema/arrow.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ func StringArrayFromValue(value string, nRows int) arrow.Array {
8787
return arrayBuilder.NewArray()
8888
}
8989

90+
func UInt64ArrayFromValue(value uint64, nRows int) arrow.Array {
91+
arrayBuilder := array.NewUint64Builder(memory.DefaultAllocator)
92+
arrayBuilder.Reserve(nRows)
93+
for i := 0; i < nRows; i++ {
94+
arrayBuilder.Append(value)
95+
}
96+
return arrayBuilder.NewArray()
97+
}
98+
9099
func TimestampArrayFromTime(t time.Time, unit arrow.TimeUnit, timeZone string, nRows int) (arrow.Array, error) {
91100
ts, err := arrow.TimestampFromTime(t, unit)
92101
if err != nil {

0 commit comments

Comments
 (0)