LuciferYang commented on a change in pull request #35781:
URL: https://github.com/apache/spark/pull/35781#discussion_r822285489
##########
File path:
sql/catalyst/src/main/java/org/apache/spark/sql/vectorized/ColumnarBatchRow.java
##########
@@ -145,40 +146,7 @@ public ColumnarMap getMap(int ordinal) {
@Override
public Object get(int ordinal, DataType dataType) {
- if (dataType instanceof BooleanType) {
- return getBoolean(ordinal);
- } else if (dataType instanceof ByteType) {
- return getByte(ordinal);
- } else if (dataType instanceof ShortType) {
- return getShort(ordinal);
- } else if (dataType instanceof IntegerType || dataType instanceof
YearMonthIntervalType) {
- return getInt(ordinal);
- } else if (dataType instanceof LongType || dataType instanceof
DayTimeIntervalType) {
- return getLong(ordinal);
- } else if (dataType instanceof FloatType) {
- return getFloat(ordinal);
- } else if (dataType instanceof DoubleType) {
- return getDouble(ordinal);
- } else if (dataType instanceof StringType) {
- return getUTF8String(ordinal);
- } else if (dataType instanceof BinaryType) {
- return getBinary(ordinal);
- } else if (dataType instanceof DecimalType) {
- DecimalType t = (DecimalType) dataType;
- return getDecimal(ordinal, t.precision(), t.scale());
- } else if (dataType instanceof DateType) {
- return getInt(ordinal);
- } else if (dataType instanceof TimestampType) {
- return getLong(ordinal);
- } else if (dataType instanceof ArrayType) {
- return getArray(ordinal);
- } else if (dataType instanceof StructType) {
- return getStruct(ordinal, ((StructType)dataType).fields().length);
- } else if (dataType instanceof MapType) {
- return getMap(ordinal);
- } else {
- throw new UnsupportedOperationException("Datatype not supported " +
dataType);
- }
+ return SpecializedGettersReader.read(this, ordinal, dataType, false,
false);
Review comment:
https://github.com/apache/spark/blob/b8c03eeb15a22895d3ab55b931b468ad012a28d4/sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/SpecializedGettersReader.java#L25-L97
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]