@@ -66,9 +66,9 @@ import kotlin.reflect.full.withNullability
66
66
import kotlin.reflect.typeOf
67
67
68
68
public class ArrowFeather : SupportedFormat {
69
- override fun readDataFrame (stream : InputStream , header : List <String >): AnyFrame = DataFrame .readArrowFeather(stream)
69
+ override fun readDataFrame (stream : InputStream , header : List <String >): AnyFrame = DataFrame .readArrowFeather(stream, NullabilityOptions . Widening )
70
70
71
- override fun readDataFrame (file : File , header : List <String >): AnyFrame = DataFrame .readArrowFeather(file)
71
+ override fun readDataFrame (file : File , header : List <String >): AnyFrame = DataFrame .readArrowFeather(file, NullabilityOptions . Widening )
72
72
73
73
override fun acceptsExtension (ext : String ): Boolean = ext == " feather"
74
74
@@ -111,7 +111,7 @@ internal fun <T> Iterable<DataFrame<T>>.concatKeepingSchema(): DataFrame<T> {
111
111
/* *
112
112
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [channel]
113
113
*/
114
- public fun DataFrame.Companion.readArrowIPC (channel : ReadableByteChannel , allocator : RootAllocator = Allocator .ROOT , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame {
114
+ public fun DataFrame.Companion.readArrowIPC (channel : ReadableByteChannel , allocator : RootAllocator = Allocator .ROOT , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame {
115
115
ArrowStreamReader (channel, allocator).use { reader ->
116
116
val dfs = buildList {
117
117
val root = reader.vectorSchemaRoot
@@ -128,7 +128,7 @@ public fun DataFrame.Companion.readArrowIPC(channel: ReadableByteChannel, alloca
128
128
/* *
129
129
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [channel]
130
130
*/
131
- public fun DataFrame.Companion.readArrowFeather (channel : SeekableByteChannel , allocator : RootAllocator = Allocator .ROOT , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame {
131
+ public fun DataFrame.Companion.readArrowFeather (channel : SeekableByteChannel , allocator : RootAllocator = Allocator .ROOT , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame {
132
132
ArrowFileReader (channel, allocator).use { reader ->
133
133
val dfs = buildList {
134
134
reader.recordBlocks.forEach { block ->
@@ -274,25 +274,25 @@ private fun readField(root: VectorSchemaRoot, field: Field, nullability: Nullabi
274
274
/* *
275
275
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [file]
276
276
*/
277
- public fun DataFrame.Companion.readArrowIPC (file : File , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
277
+ public fun DataFrame.Companion.readArrowIPC (file : File , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
278
278
Files .newByteChannel(file.toPath()).use { readArrowIPC(it, nullability = nullability) }
279
279
280
280
/* *
281
281
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [byteArray]
282
282
*/
283
- public fun DataFrame.Companion.readArrowIPC (byteArray : ByteArray , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
283
+ public fun DataFrame.Companion.readArrowIPC (byteArray : ByteArray , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
284
284
SeekableInMemoryByteChannel (byteArray).use { readArrowIPC(it, nullability = nullability) }
285
285
286
286
/* *
287
287
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [stream]
288
288
*/
289
- public fun DataFrame.Companion.readArrowIPC (stream : InputStream , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
289
+ public fun DataFrame.Companion.readArrowIPC (stream : InputStream , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
290
290
Channels .newChannel(stream).use { readArrowIPC(it, nullability = nullability) }
291
291
292
292
/* *
293
293
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [url]
294
294
*/
295
- public fun DataFrame.Companion.readArrowIPC (url : URL , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
295
+ public fun DataFrame.Companion.readArrowIPC (url : URL , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
296
296
when {
297
297
isFile(url) -> readArrowIPC(urlAsFile(url), nullability)
298
298
isProtocolSupported(url) -> url.openStream().use { readArrowIPC(it, nullability) }
@@ -301,7 +301,7 @@ public fun DataFrame.Companion.readArrowIPC(url: URL, nullability: NullabilityOp
301
301
}
302
302
}
303
303
304
- public fun DataFrame.Companion.readArrowIPC (path : String , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame = if (isURL(path)) {
304
+ public fun DataFrame.Companion.readArrowIPC (path : String , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame = if (isURL(path)) {
305
305
readArrowIPC(URL (path), nullability)
306
306
} else {
307
307
readArrowIPC(File (path), nullability)
@@ -312,25 +312,25 @@ public fun DataFrame.Companion.readArrowIPC(path: String, nullability: Nullabili
312
312
/* *
313
313
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [file]
314
314
*/
315
- public fun DataFrame.Companion.readArrowFeather (file : File , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
315
+ public fun DataFrame.Companion.readArrowFeather (file : File , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
316
316
Files .newByteChannel(file.toPath()).use { readArrowFeather(it, nullability = nullability) }
317
317
318
318
/* *
319
319
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [byteArray]
320
320
*/
321
- public fun DataFrame.Companion.readArrowFeather (byteArray : ByteArray , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
321
+ public fun DataFrame.Companion.readArrowFeather (byteArray : ByteArray , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
322
322
SeekableInMemoryByteChannel (byteArray).use { readArrowFeather(it, nullability = nullability) }
323
323
324
324
/* *
325
325
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [stream]
326
326
*/
327
- public fun DataFrame.Companion.readArrowFeather (stream : InputStream , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
327
+ public fun DataFrame.Companion.readArrowFeather (stream : InputStream , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
328
328
readArrowFeather(stream.readBytes(), nullability)
329
329
330
330
/* *
331
331
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [url]
332
332
*/
333
- public fun DataFrame.Companion.readArrowFeather (url : URL , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame =
333
+ public fun DataFrame.Companion.readArrowFeather (url : URL , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame =
334
334
when {
335
335
isFile(url) -> readArrowFeather(urlAsFile(url), nullability)
336
336
isProtocolSupported(url) -> readArrowFeather(url.readBytes(), nullability)
@@ -342,7 +342,7 @@ public fun DataFrame.Companion.readArrowFeather(url: URL, nullability: Nullabili
342
342
/* *
343
343
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [path]
344
344
*/
345
- public fun DataFrame.Companion.readArrowFeather (path : String , nullability : NullabilityOptions = NullabilityOptions .Keeping ): AnyFrame = if (isURL(path)) {
345
+ public fun DataFrame.Companion.readArrowFeather (path : String , nullability : NullabilityOptions = NullabilityOptions .Infer ): AnyFrame = if (isURL(path)) {
346
346
readArrowFeather(URL (path), nullability)
347
347
} else {
348
348
readArrowFeather(File (path), nullability)
0 commit comments