Skip to content

Commit 5e591da

Browse files
committed
inline ArrowFormat enum kdocs
1 parent 794ecbd commit 5e591da

File tree

1 file changed

+29
-14
lines changed
  • dataframe-arrow/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io

1 file changed

+29
-14
lines changed

dataframe-arrow/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/arrow.kt

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,8 @@ internal object Allocator {
7575
}
7676
}
7777

78-
public enum class ArrowFormat() {
79-
/**
80-
* [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format)
81-
*/
82-
IPC,
83-
84-
/**
85-
* [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files)
86-
*/
87-
FEATHER
88-
}
89-
9078
/**
91-
* Read [ArrowFeather.IPC] data from existing [channel]
79+
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [channel]
9280
*/
9381
public fun readArrowIPC(channel: ReadableByteChannel, allocator: RootAllocator = Allocator.ROOT): AnyFrame {
9482
ArrowStreamReader(channel, allocator).use { reader ->
@@ -105,7 +93,7 @@ public fun readArrowIPC(channel: ReadableByteChannel, allocator: RootAllocator =
10593
}
10694

10795
/**
108-
* Read [ArrowFeather.FEATHER] data from existing [channel]
96+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [channel]
10997
*/
11098
public fun readArrowFeather(channel: SeekableByteChannel, allocator: RootAllocator = Allocator.ROOT): AnyFrame {
11199
ArrowFileReader(channel, allocator).use { reader ->
@@ -216,12 +204,24 @@ private fun readField(root: VectorSchemaRoot, field: Field): AnyBaseColumn {
216204

217205
// IPC reading block
218206

207+
/**
208+
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [file]
209+
*/
219210
public fun DataFrame.Companion.readArrowIPC(file: File): AnyFrame = Files.newByteChannel(file.toPath()).use { readArrowIPC(it) }
220211

212+
/**
213+
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [byteArray]
214+
*/
221215
public fun DataFrame.Companion.readArrowIPC(byteArray: ByteArray): AnyFrame = SeekableInMemoryByteChannel(byteArray).use { readArrowIPC(it) }
222216

217+
/**
218+
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [stream]
219+
*/
223220
public fun DataFrame.Companion.readArrowIPC(stream: InputStream): AnyFrame = Channels.newChannel(stream).use { readArrowIPC(it) }
224221

222+
/**
223+
* Read [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format) data from existing [url]
224+
*/
225225
public fun DataFrame.Companion.readArrowIPC(url: URL): AnyFrame =
226226
when {
227227
isFile(url) -> readArrowIPC(urlAsFile(url))
@@ -239,12 +239,24 @@ public fun DataFrame.Companion.readArrowIPC(path: String): AnyFrame = if (isURL(
239239

240240
// Feather reading block
241241

242+
/**
243+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [file]
244+
*/
242245
public fun DataFrame.Companion.readArrowFeather(file: File): AnyFrame = Files.newByteChannel(file.toPath()).use { readArrowFeather(it) }
243246

247+
/**
248+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [byteArray]
249+
*/
244250
public fun DataFrame.Companion.readArrowFeather(byteArray: ByteArray): AnyFrame = SeekableInMemoryByteChannel(byteArray).use { readArrowFeather(it) }
245251

252+
/**
253+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [stream]
254+
*/
246255
public fun DataFrame.Companion.readArrowFeather(stream: InputStream): AnyFrame = readArrowFeather(stream.readAllBytes())
247256

257+
/**
258+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [url]
259+
*/
248260
public fun DataFrame.Companion.readArrowFeather(url: URL): AnyFrame =
249261
when {
250262
isFile(url) -> readArrowFeather(urlAsFile(url))
@@ -254,6 +266,9 @@ public fun DataFrame.Companion.readArrowFeather(url: URL): AnyFrame =
254266
}
255267
}
256268

269+
/**
270+
* Read [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) data from existing [path]
271+
*/
257272
public fun DataFrame.Companion.readArrowFeather(path: String): AnyFrame = if (isURL(path)) {
258273
readArrowFeather(URL(path))
259274
} else {

0 commit comments

Comments
 (0)