This is an automated email from the ASF dual-hosted git repository.
zhztheplayer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new d4ff679d82 [GLUTEN-13140][CORE] Remove unused Arrow vector and
collection wrappers (#13740)
d4ff679d82 is described below
commit d4ff679d82822c948c596b74756daf404f3c3feb
Author: Wechar Yu <[email protected]>
AuthorDate: Wed Nov 25 01:43:42 2026 +0800
[GLUTEN-13140][CORE] Remove unused Arrow vector and collection wrappers
(#13740)
---
.../gluten/vectorized/ArrowColumnVector.java | 578 ---------------------
.../spark/sql/vectorized/ArrowColumnarMap.java | 54 --
.../sql/vectorized/AbstractColumnarArray.java | 240 ---------
.../spark/sql/vectorized/ArrowColumnarArray.java | 24 -
.../spark/sql/vectorized/ArrowColumnarArray.java | 24 -
.../spark/sql/vectorized/ArrowColumnarArray.java | 31 --
.../spark/sql/vectorized/ArrowColumnarArray.java | 43 --
.../spark/sql/vectorized/ArrowColumnarArray.java | 37 --
8 files changed, 1031 deletions(-)
diff --git
a/gluten-arrow/src/main/java/org/apache/gluten/vectorized/ArrowColumnVector.java
b/gluten-arrow/src/main/java/org/apache/gluten/vectorized/ArrowColumnVector.java
deleted file mode 100644
index 0ecaabef55..0000000000
---
a/gluten-arrow/src/main/java/org/apache/gluten/vectorized/ArrowColumnVector.java
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.gluten.vectorized;
-
-import org.apache.arrow.vector.*;
-import org.apache.arrow.vector.complex.ListVector;
-import org.apache.arrow.vector.complex.MapVector;
-import org.apache.arrow.vector.complex.StructVector;
-import org.apache.arrow.vector.holders.NullableVarCharHolder;
-import org.apache.spark.annotation.DeveloperApi;
-import org.apache.spark.sql.types.DataType;
-import org.apache.spark.sql.types.Decimal;
-import org.apache.spark.sql.utils.SparkArrowUtil;
-import org.apache.spark.sql.vectorized.ColumnVector;
-import org.apache.spark.sql.vectorized.ColumnarArray;
-import org.apache.spark.sql.vectorized.ColumnarMap;
-import org.apache.spark.unsafe.types.UTF8String;
-
-/** A column vector from Spark-3.3.1 backed by Apache Arrow. */
-@DeveloperApi
-public class ArrowColumnVector extends ColumnVector {
-
- ArrowVectorAccessor accessor;
- ArrowColumnVector[] childColumns;
-
- public ValueVector getValueVector() {
- return accessor.vector;
- }
-
- @Override
- public boolean hasNull() {
- return accessor.getNullCount() > 0;
- }
-
- @Override
- public int numNulls() {
- return accessor.getNullCount();
- }
-
- @Override
- public void close() {
- if (childColumns != null) {
- for (int i = 0; i < childColumns.length; i++) {
- childColumns[i].close();
- childColumns[i] = null;
- }
- childColumns = null;
- }
- accessor.close();
- }
-
- @Override
- public boolean isNullAt(int rowId) {
- return accessor.isNullAt(rowId);
- }
-
- @Override
- public boolean getBoolean(int rowId) {
- return accessor.getBoolean(rowId);
- }
-
- @Override
- public byte getByte(int rowId) {
- return accessor.getByte(rowId);
- }
-
- @Override
- public short getShort(int rowId) {
- return accessor.getShort(rowId);
- }
-
- @Override
- public int getInt(int rowId) {
- return accessor.getInt(rowId);
- }
-
- @Override
- public long getLong(int rowId) {
- return accessor.getLong(rowId);
- }
-
- @Override
- public float getFloat(int rowId) {
- return accessor.getFloat(rowId);
- }
-
- @Override
- public double getDouble(int rowId) {
- return accessor.getDouble(rowId);
- }
-
- @Override
- public Decimal getDecimal(int rowId, int precision, int scale) {
- if (isNullAt(rowId)) return null;
- return accessor.getDecimal(rowId, precision, scale);
- }
-
- @Override
- public UTF8String getUTF8String(int rowId) {
- if (isNullAt(rowId)) return null;
- return accessor.getUTF8String(rowId);
- }
-
- @Override
- public byte[] getBinary(int rowId) {
- if (isNullAt(rowId)) return null;
- return accessor.getBinary(rowId);
- }
-
- @Override
- public ColumnarArray getArray(int rowId) {
- if (isNullAt(rowId)) return null;
- return accessor.getArray(rowId);
- }
-
- @Override
- public ColumnarMap getMap(int rowId) {
- if (isNullAt(rowId)) return null;
- return accessor.getMap(rowId);
- }
-
- @Override
- public ArrowColumnVector getChild(int ordinal) {
- return childColumns[ordinal];
- }
-
- ArrowColumnVector(DataType type) {
- super(type);
- }
-
- public ArrowColumnVector(ValueVector vector) {
- this(SparkArrowUtil.fromArrowField(vector.getField()));
- initAccessor(vector);
- }
-
- void initAccessor(ValueVector vector) {
- if (vector instanceof BitVector) {
- accessor = new BooleanAccessor((BitVector) vector);
- } else if (vector instanceof TinyIntVector) {
- accessor = new ByteAccessor((TinyIntVector) vector);
- } else if (vector instanceof SmallIntVector) {
- accessor = new ShortAccessor((SmallIntVector) vector);
- } else if (vector instanceof IntVector) {
- accessor = new IntAccessor((IntVector) vector);
- } else if (vector instanceof BigIntVector) {
- accessor = new LongAccessor((BigIntVector) vector);
- } else if (vector instanceof Float4Vector) {
- accessor = new FloatAccessor((Float4Vector) vector);
- } else if (vector instanceof Float8Vector) {
- accessor = new DoubleAccessor((Float8Vector) vector);
- } else if (vector instanceof DecimalVector) {
- accessor = new DecimalAccessor((DecimalVector) vector);
- } else if (vector instanceof VarCharVector) {
- accessor = new StringAccessor((VarCharVector) vector);
- } else if (vector instanceof VarBinaryVector) {
- accessor = new BinaryAccessor((VarBinaryVector) vector);
- } else if (vector instanceof DateDayVector) {
- accessor = new DateAccessor((DateDayVector) vector);
- } else if (vector instanceof TimeStampMicroTZVector) {
- accessor = new TimestampAccessor((TimeStampMicroTZVector) vector);
- } else if (vector instanceof TimeStampMicroVector) {
- accessor = new TimestampNTZAccessor((TimeStampMicroVector) vector);
- } else if (vector instanceof MapVector) {
- MapVector mapVector = (MapVector) vector;
- accessor = new MapAccessor(mapVector);
- } else if (vector instanceof ListVector) {
- ListVector listVector = (ListVector) vector;
- accessor = new ArrayAccessor(listVector);
- } else if (vector instanceof StructVector) {
- StructVector structVector = (StructVector) vector;
- accessor = new StructAccessor(structVector);
-
- childColumns = new ArrowColumnVector[structVector.size()];
- for (int i = 0; i < childColumns.length; ++i) {
- childColumns[i] = new ArrowColumnVector(structVector.getVectorById(i));
- }
- } else if (vector instanceof NullVector) {
- accessor = new NullAccessor((NullVector) vector);
- } else if (vector instanceof IntervalYearVector) {
- accessor = new IntervalYearAccessor((IntervalYearVector) vector);
- } else if (vector instanceof DurationVector) {
- accessor = new DurationAccessor((DurationVector) vector);
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- abstract static class ArrowVectorAccessor {
-
- final ValueVector vector;
-
- ArrowVectorAccessor(ValueVector vector) {
- this.vector = vector;
- }
-
- // TODO: should be final after removing ArrayAccessor workaround
- boolean isNullAt(int rowId) {
- return vector.isNull(rowId);
- }
-
- final int getNullCount() {
- return vector.getNullCount();
- }
-
- final void close() {
- vector.close();
- }
-
- boolean getBoolean(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- byte getByte(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- short getShort(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- int getInt(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- long getLong(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- float getFloat(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- double getDouble(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- Decimal getDecimal(int rowId, int precision, int scale) {
- throw new UnsupportedOperationException();
- }
-
- UTF8String getUTF8String(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- byte[] getBinary(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- ColumnarArray getArray(int rowId) {
- throw new UnsupportedOperationException();
- }
-
- ColumnarMap getMap(int rowId) {
- throw new UnsupportedOperationException();
- }
- }
-
- static class BooleanAccessor extends ArrowVectorAccessor {
-
- private final BitVector accessor;
-
- BooleanAccessor(BitVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final boolean getBoolean(int rowId) {
- return accessor.get(rowId) == 1;
- }
- }
-
- static class ByteAccessor extends ArrowVectorAccessor {
-
- private final TinyIntVector accessor;
-
- ByteAccessor(TinyIntVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final byte getByte(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class ShortAccessor extends ArrowVectorAccessor {
-
- private final SmallIntVector accessor;
-
- ShortAccessor(SmallIntVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final short getShort(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class IntAccessor extends ArrowVectorAccessor {
-
- private final IntVector accessor;
-
- IntAccessor(IntVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final int getInt(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class LongAccessor extends ArrowVectorAccessor {
-
- private final BigIntVector accessor;
-
- LongAccessor(BigIntVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final long getLong(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class FloatAccessor extends ArrowVectorAccessor {
-
- private final Float4Vector accessor;
-
- FloatAccessor(Float4Vector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final float getFloat(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class DoubleAccessor extends ArrowVectorAccessor {
-
- private final Float8Vector accessor;
-
- DoubleAccessor(Float8Vector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final double getDouble(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class DecimalAccessor extends ArrowVectorAccessor {
-
- private final DecimalVector accessor;
-
- DecimalAccessor(DecimalVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final Decimal getDecimal(int rowId, int precision, int scale) {
- if (isNullAt(rowId)) return null;
- return Decimal.apply(accessor.getObject(rowId), precision, scale);
- }
- }
-
- static class StringAccessor extends ArrowVectorAccessor {
-
- private final VarCharVector accessor;
- private final NullableVarCharHolder stringResult = new
NullableVarCharHolder();
-
- StringAccessor(VarCharVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final UTF8String getUTF8String(int rowId) {
- accessor.get(rowId, stringResult);
- if (stringResult.isSet == 0) {
- return null;
- } else {
- return UTF8String.fromAddress(
- null,
- stringResult.buffer.memoryAddress() + stringResult.start,
- stringResult.end - stringResult.start);
- }
- }
- }
-
- static class BinaryAccessor extends ArrowVectorAccessor {
-
- private final VarBinaryVector accessor;
-
- BinaryAccessor(VarBinaryVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final byte[] getBinary(int rowId) {
- return accessor.getObject(rowId);
- }
- }
-
- static class DateAccessor extends ArrowVectorAccessor {
-
- private final DateDayVector accessor;
-
- DateAccessor(DateDayVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final int getInt(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class TimestampAccessor extends ArrowVectorAccessor {
-
- private final TimeStampMicroTZVector accessor;
-
- TimestampAccessor(TimeStampMicroTZVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final long getLong(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class TimestampNTZAccessor extends ArrowVectorAccessor {
-
- private final TimeStampMicroVector accessor;
-
- TimestampNTZAccessor(TimeStampMicroVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final long getLong(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class ArrayAccessor extends ArrowVectorAccessor {
-
- private final ListVector accessor;
- private final ArrowColumnVector arrayData;
-
- ArrayAccessor(ListVector vector) {
- super(vector);
- this.accessor = vector;
- this.arrayData = new ArrowColumnVector(vector.getDataVector());
- }
-
- @Override
- final boolean isNullAt(int rowId) {
- // TODO: Workaround if vector has all non-null values, see ARROW-1948
- if (accessor.getValueCount() > 0 &&
accessor.getValidityBuffer().capacity() == 0) {
- return false;
- } else {
- return super.isNullAt(rowId);
- }
- }
-
- @Override
- final ColumnarArray getArray(int rowId) {
- int start = accessor.getElementStartIndex(rowId);
- int end = accessor.getElementEndIndex(rowId);
- return new ColumnarArray(arrayData, start, end - start);
- }
- }
-
- /**
- * Any call to "get" method will throw UnsupportedOperationException.
- *
- * <p>Access struct values in a ArrowColumnVector doesn't use this accessor.
Instead, it uses
- * getStruct() method defined in the parent class. Any call to "get" method
in this class is a bug
- * in the code.
- */
- static class StructAccessor extends ArrowVectorAccessor {
-
- StructAccessor(StructVector vector) {
- super(vector);
- }
- }
-
- static class MapAccessor extends ArrowVectorAccessor {
- private final MapVector accessor;
- private final ArrowColumnVector keys;
- private final ArrowColumnVector values;
-
- MapAccessor(MapVector vector) {
- super(vector);
- this.accessor = vector;
- StructVector entries = (StructVector) vector.getDataVector();
- this.keys = new ArrowColumnVector(entries.getChild(MapVector.KEY_NAME));
- this.values = new
ArrowColumnVector(entries.getChild(MapVector.VALUE_NAME));
- }
-
- @Override
- final ColumnarMap getMap(int rowId) {
- int index = rowId * MapVector.OFFSET_WIDTH;
- int offset = accessor.getOffsetBuffer().getInt(index);
- int length = accessor.getInnerValueCountAt(rowId);
- return new ColumnarMap(keys, values, offset, length);
- }
- }
-
- static class NullAccessor extends ArrowVectorAccessor {
-
- NullAccessor(NullVector vector) {
- super(vector);
- }
- }
-
- static class IntervalYearAccessor extends ArrowVectorAccessor {
-
- private final IntervalYearVector accessor;
-
- IntervalYearAccessor(IntervalYearVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- int getInt(int rowId) {
- return accessor.get(rowId);
- }
- }
-
- static class DurationAccessor extends ArrowVectorAccessor {
-
- private final DurationVector accessor;
-
- DurationAccessor(DurationVector vector) {
- super(vector);
- this.accessor = vector;
- }
-
- @Override
- final long getLong(int rowId) {
- return DurationVector.get(accessor.getDataBuffer(), rowId);
- }
- }
-}
diff --git
a/gluten-arrow/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarMap.java
b/gluten-arrow/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarMap.java
deleted file mode 100644
index 77f98897c3..0000000000
---
a/gluten-arrow/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarMap.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-import org.apache.spark.sql.catalyst.util.ArrayBasedMapData;
-import org.apache.spark.sql.catalyst.util.ArrayData;
-import org.apache.spark.sql.catalyst.util.MapData;
-
-/** See [[ArrowColumnarArray]]. */
-public class ArrowColumnarMap extends MapData {
- private final ArrowColumnarArray keys;
- private final ArrowColumnarArray values;
- private final int length;
-
- public ArrowColumnarMap(ColumnVector keys, ColumnVector values, int offset,
int length) {
- this.length = length;
- this.keys = new ArrowColumnarArray(keys, offset, length);
- this.values = new ArrowColumnarArray(values, offset, length);
- }
-
- @Override
- public int numElements() {
- return length;
- }
-
- @Override
- public ArrayData keyArray() {
- return keys;
- }
-
- @Override
- public ArrayData valueArray() {
- return values;
- }
-
- @Override
- public MapData copy() {
- return new ArrayBasedMapData(keys.copy(), values.copy());
- }
-}
diff --git
a/shims/common/src/main/java/org/apache/spark/sql/vectorized/AbstractColumnarArray.java
b/shims/common/src/main/java/org/apache/spark/sql/vectorized/AbstractColumnarArray.java
deleted file mode 100644
index dd40a902f9..0000000000
---
a/shims/common/src/main/java/org/apache/spark/sql/vectorized/AbstractColumnarArray.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-import org.apache.spark.sql.catalyst.expressions.SpecializedGettersReader;
-import org.apache.spark.sql.catalyst.expressions.UnsafeArrayData;
-import org.apache.spark.sql.catalyst.util.ArrayData;
-import org.apache.spark.sql.catalyst.util.GenericArrayData;
-import org.apache.spark.sql.types.*;
-import org.apache.spark.unsafe.types.CalendarInterval;
-import org.apache.spark.unsafe.types.UTF8String;
-
-/**
- * Because `get` method in `ColumnarArray` don't check whether the data to get
is null and arrow
- * vectors will throw exception when we try to access null value, so we define
the following class
- * as a workaround. Its implementation is copied from Spark-4.0, except that
the `handleNull`
- * parameter is set to true when we call `SpecializedGettersReader.read` in
`get`, which means that
- * when trying to access a value of the array, we will check whether the value
to get is null first.
- *
- * <p>There are some differences between the supported Spark versions, which
are reflected in the
- * implementations of respective child classes in the shim modules.
- */
-abstract class AbstractColumnarArray extends ArrayData {
- // The data for this array. This array contains elements from
- // data[offset] to data[offset + length).
- protected final ColumnVector data;
- protected final int offset;
- protected final int length;
-
- AbstractColumnarArray(ColumnVector data, int offset, int length) {
- this.data = data;
- this.offset = offset;
- this.length = length;
- }
-
- @Override
- public int numElements() {
- return length;
- }
-
- /**
- * Sets all the appropriate null bits in the input UnsafeArrayData.
- *
- * @param arrayData The UnsafeArrayData to set the null bits for
- * @return The UnsafeArrayData with the null bits set
- */
- private UnsafeArrayData setNullBits(UnsafeArrayData arrayData) {
- if (data.hasNull()) {
- for (int i = 0; i < length; i++) {
- if (data.isNullAt(offset + i)) {
- arrayData.setNullAt(i);
- }
- }
- }
- return arrayData;
- }
-
- @Override
- public ArrayData copy() {
- DataType dt = data.dataType();
-
- if (dt instanceof BooleanType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toBooleanArray()));
- } else if (dt instanceof ByteType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toByteArray()));
- } else if (dt instanceof ShortType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toShortArray()));
- } else if (dt instanceof IntegerType
- || dt instanceof DateType
- || dt instanceof YearMonthIntervalType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toIntArray()));
- } else if (dt instanceof LongType
- || dt instanceof TimestampType
- || dt instanceof DayTimeIntervalType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toLongArray()));
- } else if (dt instanceof FloatType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toFloatArray()));
- } else if (dt instanceof DoubleType) {
- return setNullBits(UnsafeArrayData.fromPrimitiveArray(toDoubleArray()));
- } else {
- return new GenericArrayData(toObjectArray(dt)).copy(); // ensure the
elements are copied.
- }
- }
-
- @Override
- public boolean[] toBooleanArray() {
- return data.getBooleans(offset, length);
- }
-
- @Override
- public byte[] toByteArray() {
- return data.getBytes(offset, length);
- }
-
- @Override
- public short[] toShortArray() {
- return data.getShorts(offset, length);
- }
-
- @Override
- public int[] toIntArray() {
- return data.getInts(offset, length);
- }
-
- @Override
- public long[] toLongArray() {
- return data.getLongs(offset, length);
- }
-
- @Override
- public float[] toFloatArray() {
- return data.getFloats(offset, length);
- }
-
- @Override
- public double[] toDoubleArray() {
- return data.getDoubles(offset, length);
- }
-
- // TODO: this is extremely expensive.
- @Override
- public Object[] array() {
- DataType dt = data.dataType();
- Object[] list = new Object[length];
- try {
- for (int i = 0; i < length; i++) {
- if (!data.isNullAt(offset + i)) {
- list[i] = get(i, dt);
- }
- }
- return list;
- } catch (Exception e) {
- throw new RuntimeException("Could not get the array", e);
- }
- }
-
- @Override
- public boolean isNullAt(int ordinal) {
- return data.isNullAt(offset + ordinal);
- }
-
- @Override
- public boolean getBoolean(int ordinal) {
- return data.getBoolean(offset + ordinal);
- }
-
- @Override
- public byte getByte(int ordinal) {
- return data.getByte(offset + ordinal);
- }
-
- @Override
- public short getShort(int ordinal) {
- return data.getShort(offset + ordinal);
- }
-
- @Override
- public int getInt(int ordinal) {
- return data.getInt(offset + ordinal);
- }
-
- @Override
- public long getLong(int ordinal) {
- return data.getLong(offset + ordinal);
- }
-
- @Override
- public float getFloat(int ordinal) {
- return data.getFloat(offset + ordinal);
- }
-
- @Override
- public double getDouble(int ordinal) {
- return data.getDouble(offset + ordinal);
- }
-
- @Override
- public Decimal getDecimal(int ordinal, int precision, int scale) {
- return data.getDecimal(offset + ordinal, precision, scale);
- }
-
- @Override
- public UTF8String getUTF8String(int ordinal) {
- return data.getUTF8String(offset + ordinal);
- }
-
- @Override
- public byte[] getBinary(int ordinal) {
- return data.getBinary(offset + ordinal);
- }
-
- @Override
- public CalendarInterval getInterval(int ordinal) {
- return data.getInterval(offset + ordinal);
- }
-
- @Override
- public ColumnarRow getStruct(int ordinal, int numFields) {
- return data.getStruct(offset + ordinal);
- }
-
- @Override
- public ColumnarArray getArray(int ordinal) {
- return data.getArray(offset + ordinal);
- }
-
- @Override
- public ColumnarMap getMap(int ordinal) {
- return data.getMap(offset + ordinal);
- }
-
- @Override
- public Object get(int ordinal, DataType dataType) {
- return SpecializedGettersReader.read(this, ordinal, dataType, true, false);
- }
-
- @Override
- public void update(int ordinal, Object value) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setNullAt(int ordinal) {
- throw new UnsupportedOperationException();
- }
-}
diff --git
a/shims/spark34/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
b/shims/spark34/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
deleted file mode 100644
index cb0c11e5e4..0000000000
---
a/shims/spark34/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-public final class ArrowColumnarArray extends AbstractColumnarArray {
-
- public ArrowColumnarArray(ColumnVector data, int offset, int length) {
- super(data, offset, length);
- }
-}
diff --git
a/shims/spark35/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
b/shims/spark35/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
deleted file mode 100644
index cb0c11e5e4..0000000000
---
a/shims/spark35/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-public final class ArrowColumnarArray extends AbstractColumnarArray {
-
- public ArrowColumnarArray(ColumnVector data, int offset, int length) {
- super(data, offset, length);
- }
-}
diff --git
a/shims/spark40/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
b/shims/spark40/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
deleted file mode 100644
index 0e000a8b40..0000000000
---
a/shims/spark40/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-import org.apache.spark.unsafe.types.VariantVal;
-
-public final class ArrowColumnarArray extends AbstractColumnarArray {
-
- public ArrowColumnarArray(ColumnVector data, int offset, int length) {
- super(data, offset, length);
- }
-
- @Override
- public VariantVal getVariant(int ordinal) {
- return data.getVariant(offset + ordinal);
- }
-}
diff --git
a/shims/spark41/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
b/shims/spark41/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
deleted file mode 100644
index bfcc561e39..0000000000
---
a/shims/spark41/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-import org.apache.spark.unsafe.types.GeographyVal;
-import org.apache.spark.unsafe.types.GeometryVal;
-import org.apache.spark.unsafe.types.VariantVal;
-
-public final class ArrowColumnarArray extends AbstractColumnarArray {
-
- public ArrowColumnarArray(ColumnVector data, int offset, int length) {
- super(data, offset, length);
- }
-
- @Override
- public VariantVal getVariant(int ordinal) {
- return data.getVariant(offset + ordinal);
- }
-
- @Override
- public GeographyVal getGeography(int ordinal) {
- return data.getGeography(offset + ordinal);
- }
-
- @Override
- public GeometryVal getGeometry(int ordinal) {
- return data.getGeometry(offset + ordinal);
- }
-}
diff --git
a/shims/spark42/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
b/shims/spark42/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
deleted file mode 100644
index 939e0648d9..0000000000
---
a/shims/spark42/src/main/java/org/apache/spark/sql/vectorized/ArrowColumnarArray.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.spark.sql.vectorized;
-
-import org.apache.spark.unsafe.types.BinaryView;
-import org.apache.spark.unsafe.types.VariantVal;
-
-public final class ArrowColumnarArray extends AbstractColumnarArray {
-
- public ArrowColumnarArray(ColumnVector data, int offset, int length) {
- super(data, offset, length);
- }
-
- @Override
- public VariantVal getVariant(int ordinal) {
- return data.getVariant(offset + ordinal);
- }
-
- @Override
- public BinaryView getBinaryView(int ordinal) {
- return data.getBinaryView(offset + ordinal);
- }
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]