[
https://issues.apache.org/jira/browse/CALCITE-6292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17867523#comment-17867523
]
Caican Cai edited comment on CALCITE-6292 at 7/20/24 2:57 PM:
--------------------------------------------------------------
I have a question, is there a relevant test for these types that would allow me
to verify that my logic is correct
was (Author: JIRAUSER302115):
I have a question, are there any tests for these types?
> Support more Arrow type
> -----------------------
>
> Key: CALCITE-6292
> URL: https://issues.apache.org/jira/browse/CALCITE-6292
> Project: Calcite
> Issue Type: Sub-task
> Components: arrow-adapter
> Reporter: hongyu guo
> Assignee: Caican Cai
> Priority: Major
>
> All arrow type:
> {code:java}
> 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);
> }
> {code}
> we support now:
> {code:java}
> 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);
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)