in gandiva/src/main/java/org/apache/arrow/gandiva/evaluator/ExpressionRegistry.java [128:184]
private static ArrowType getArrowType(ExtGandivaType type) {
switch (type.getType().getNumber()) {
case GandivaType.BOOL_VALUE:
return ArrowType.Bool.INSTANCE;
case GandivaType.UINT8_VALUE:
return new ArrowType.Int(BIT_WIDTH8, IS_SIGNED_FALSE);
case GandivaType.INT8_VALUE:
return new ArrowType.Int(BIT_WIDTH8, IS_SIGNED_TRUE);
case GandivaType.UINT16_VALUE:
return new ArrowType.Int(BIT_WIDTH_16, IS_SIGNED_FALSE);
case GandivaType.INT16_VALUE:
return new ArrowType.Int(BIT_WIDTH_16, IS_SIGNED_TRUE);
case GandivaType.UINT32_VALUE:
return new ArrowType.Int(BIT_WIDTH_32, IS_SIGNED_FALSE);
case GandivaType.INT32_VALUE:
return new ArrowType.Int(BIT_WIDTH_32, IS_SIGNED_TRUE);
case GandivaType.UINT64_VALUE:
return new ArrowType.Int(BIT_WIDTH_64, IS_SIGNED_FALSE);
case GandivaType.INT64_VALUE:
return new ArrowType.Int(BIT_WIDTH_64, IS_SIGNED_TRUE);
case GandivaType.HALF_FLOAT_VALUE:
return new ArrowType.FloatingPoint(FloatingPointPrecision.HALF);
case GandivaType.FLOAT_VALUE:
return new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE);
case GandivaType.DOUBLE_VALUE:
return new ArrowType.FloatingPoint(FloatingPointPrecision.DOUBLE);
case GandivaType.UTF8_VALUE:
return new ArrowType.Utf8();
case GandivaType.BINARY_VALUE:
return new ArrowType.Binary();
case GandivaType.DATE32_VALUE:
return new ArrowType.Date(DateUnit.DAY);
case GandivaType.DATE64_VALUE:
return new ArrowType.Date(DateUnit.MILLISECOND);
case GandivaType.TIMESTAMP_VALUE:
return new ArrowType.Timestamp(mapArrowTimeUnit(type.getTimeUnit()), null);
case GandivaType.TIME32_VALUE:
return new ArrowType.Time(mapArrowTimeUnit(type.getTimeUnit()), BIT_WIDTH_32);
case GandivaType.TIME64_VALUE:
return new ArrowType.Time(mapArrowTimeUnit(type.getTimeUnit()), BIT_WIDTH_64);
case GandivaType.NONE_VALUE:
return new ArrowType.Null();
case GandivaType.DECIMAL_VALUE:
return new ArrowType.Decimal(0, 0, 128);
case GandivaType.INTERVAL_VALUE:
return new ArrowType.Interval(mapArrowIntervalUnit(type.getIntervalType()));
case GandivaType.FIXED_SIZE_BINARY_VALUE:
case GandivaType.MAP_VALUE:
case GandivaType.DICTIONARY_VALUE:
case GandivaType.LIST_VALUE:
case GandivaType.STRUCT_VALUE:
case GandivaType.UNION_VALUE:
default:
assert false;
}
return null;
}