Details
-
Sub-task
-
Status: In Progress
-
Major
-
Resolution: Unresolved
-
1.37.0
-
None
-
None
Description
All arrow type:
public static enum ArrowTypeID { Null(Type.Null), Struct(Type.Struct_), List(Type.List), LargeList(Type.LargeList), FixedSizeList(Type.FixedSizeList), Union(Type.Union), Map(Type.Map), Int(Type.Int), FloatingPoint(Type.FloatingPoint), Utf8(Type.Utf8), LargeUtf8(Type.LargeUtf8), Binary(Type.Binary), LargeBinary(Type.LargeBinary), FixedSizeBinary(Type.FixedSizeBinary), Bool(Type.Bool), Decimal(Type.Decimal), Date(Type.Date), Time(Type.Time), Timestamp(Type.Timestamp), Interval(Type.Interval), Duration(Type.Duration), NONE(Type.NONE); }
we support now:
public static ArrowFieldType of(ArrowType arrowType) { switch (arrowType.getTypeID()) { case Int: int bitWidth = ((ArrowType.Int) arrowType).getBitWidth(); switch (bitWidth) { case 64: return LONG; case 32: return INT; case 16: return SHORT; case 8: return BYTE; default: throw new IllegalArgumentException("Unsupported Int bit width: " + bitWidth); } case Bool: return BOOLEAN; case Utf8: return STRING; case FloatingPoint: FloatingPointPrecision precision = ((ArrowType.FloatingPoint) arrowType).getPrecision(); switch (precision) { case SINGLE: return FLOAT; case DOUBLE: return DOUBLE; default: throw new IllegalArgumentException("Unsupported Floating point precision: " + precision); } case Date: return DATE; case Decimal: return DECIMAL; default: throw new IllegalArgumentException("Unsupported type: " + arrowType); } }