You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create Arrow VectorSchemaRoot with [dataFrame] content cast to [targetSchema].
142
164
* If [restrictWidening] is true, [dataFrame] columns not described in [targetSchema] would not be saved (otherwise, would be saved as is).
143
165
* If [restrictNarrowing] is true, [targetSchema] fields that are not nullable and do not exist in [dataFrame] will produce exception (otherwise, would not be saved).
144
166
* If [strictType] is true, [dataFrame] columns described in [targetSchema] with non-compatible type will produce exception (otherwise, would be saved as is).
@@ -153,7 +175,6 @@ public class ArrowWriter(public val dataFrame: DataFrame<*>, public val targetSc
153
175
val mainVectors =LinkedHashMap<String, FieldVector>()
154
176
for (field in targetSchema.fields) {
155
177
val column = dataFrame.getColumnOrNull(field.name)
156
-
val vector = field.createVector(allocator)!!
157
178
if (column ==null&&!field.isNullable) {
158
179
if (restrictNarrowing) {
159
180
throwException("${field.name} column is not presented")
@@ -162,13 +183,7 @@ public class ArrowWriter(public val dataFrame: DataFrame<*>, public val targetSc
162
183
}
163
184
}
164
185
165
-
allocateVector(vector, dataFrame.rowsCount())
166
-
if (column ==null) {
167
-
check(field.isNullable)
168
-
infillWithNulls(vector, dataFrame.rowsCount())
169
-
} else {
170
-
infillVector(vector, column)
171
-
}
186
+
val vector = allocateVectorAndInfill(field, column, strictType, strictNullable)
172
187
mainVectors[field.name] = vector
173
188
}
174
189
val vectors =ArrayList<FieldVector>()
@@ -180,7 +195,82 @@ public class ArrowWriter(public val dataFrame: DataFrame<*>, public val targetSc
// * Save data to [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format), write to new or existing [file].
241
+
// * If file exists, it can be recreated or expanded.
242
+
// */
243
+
//public fun AnyFrame.writeArrowIPC(file: File, append: Boolean = true) {
244
+
//
245
+
//}
246
+
//
247
+
///**
248
+
// * Save data to [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format), write to [ByteArray]
249
+
// */
250
+
//public fun AnyFrame.writeArrowIPCToByteArray() {
251
+
//
252
+
//}
253
+
//
254
+
//// Feather saving block
255
+
//
256
+
///**
257
+
// * Save data to [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files), write to new or existing [file].
258
+
// * If file exists, it would be recreated.
259
+
// */
260
+
//public fun AnyFrame.writeArrowFeather(file: File) {
261
+
//
262
+
//}
263
+
//
264
+
///**
265
+
// * Save data to [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files), write to [ByteArray]
266
+
// */
267
+
//public fun DataFrame.Companion.writeArrowFeatherToByteArray(): ByteArray {
268
+
//
269
+
//}
270
+
//
271
+
///**
272
+
// * Write [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) from existing [stream]
273
+
// */
274
+
//public fun DataFrame.Companion.writeArrowFeather(stream: OutputStream) {
Copy file name to clipboardExpand all lines: dataframe-arrow/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/arrow.kt
-41Lines changed: 0 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -400,44 +400,3 @@ public fun DataFrame.Companion.readArrowFeather(
400
400
} else {
401
401
readArrowFeather(File(path), nullability)
402
402
}
403
-
404
-
//// IPC saving block
405
-
//
406
-
///**
407
-
// * Save data to [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format), write to new or existing [file].
408
-
// * If file exists, it can be recreated or expanded.
409
-
// */
410
-
//public fun AnyFrame.writeArrowIPC(file: File, append: Boolean = true) {
411
-
//
412
-
//}
413
-
//
414
-
///**
415
-
// * Save data to [Arrow interprocess streaming format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-streaming-format), write to [ByteArray]
416
-
// */
417
-
//public fun AnyFrame.writeArrowIPCToByteArray() {
418
-
//
419
-
//}
420
-
//
421
-
//// Feather saving block
422
-
//
423
-
///**
424
-
// * Save data to [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files), write to new or existing [file].
425
-
// * If file exists, it would be recreated.
426
-
// */
427
-
//public fun AnyFrame.writeArrowFeather(file: File) {
428
-
//
429
-
//}
430
-
//
431
-
///**
432
-
// * Save data to [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files), write to [ByteArray]
433
-
// */
434
-
//public fun DataFrame.Companion.writeArrowFeatherToByteArray(): ByteArray {
435
-
//
436
-
//}
437
-
//
438
-
///**
439
-
// * Write [Arrow random access format](https://arrow.apache.org/docs/java/ipc.html#writing-and-reading-random-access-files) from existing [stream]
440
-
// */
441
-
//public fun DataFrame.Companion.writeArrowFeather(stream: OutputStream) {
0 commit comments