Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/20395#discussion_r164086245
--- Diff:
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/WritableColumnVector.java
---
@@ -602,7 +603,17 @@ public final int appendStruct(boolean isNull) {
// `WritableColumnVector` puts the data of array in the first child
column vector, and puts the
// array offsets and lengths in the current column vector.
@Override
- public WritableColumnVector arrayData() { return childColumns[0]; }
+ public final ColumnarArray getArray(int rowId) {
+ return new ColumnarArray(arrayData(), getArrayOffset(rowId),
getArrayLength(rowId));
+ }
+
+ public WritableColumnVector arrayData() {
+ return childColumns[0];
+ }
+
+ public abstract int getArrayLength(int rowId);
+
+ public abstract int getArrayOffset(int rowId);
--- End diff --
`WritableColumnVector` is an internal class, so I want to keep the
visibility wider for the ease of use.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]