in Sources/SparkConnect/ArrowEncoder.swift [152:164]
func doEncode<T>(_ value: T, keyIndex: Int) throws {
try throwIfInvalid()
let index = self.getIndex(keyIndex)
if index >= builders.count {
if index == builders.count {
try ensureColumnExists(value, key: "col\(index)")
} else {
throw ArrowError.outOfBounds(index: Int64(index))
}
}
builders[byIndex[index]]!.appendAny(value)
}