Java Code Examples for org.apache.arrow.vector.types.pojo.ArrowType#Time
The following examples show how to use
org.apache.arrow.vector.types.pojo.ArrowType#Time .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 5 votes |
@Override protected void doTypedSerialize(ArrowType arrowType, JsonGenerator jgen, SerializerProvider provider) throws IOException { ArrowType.Time time = (ArrowType.Time) arrowType; jgen.writeStringField(UNIT_FIELD, time.getUnit().toString()); jgen.writeNumberField(BIT_WIDTH_FIELD, time.getBitWidth()); }
Example 2
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 5 votes |
@Override protected ArrowType doTypedDeserialize(JsonParser jparser, DeserializationContext ctxt) throws IOException { TimeUnit unit = TimeUnit.valueOf(getNextStringField(jparser, UNIT_FIELD)); int bitWidth = getNextIntField(jparser, BIT_WIDTH_FIELD); return new ArrowType.Time(unit, bitWidth); }
Example 3
Source File: ArrowUtils.java From flink with Apache License 2.0 | 5 votes |
@Override public ArrowType visit(TimeType timeType) { if (timeType.getPrecision() == 0) { return new ArrowType.Time(TimeUnit.SECOND, 32); } else if (timeType.getPrecision() >= 1 && timeType.getPrecision() <= 3) { return new ArrowType.Time(TimeUnit.MILLISECOND, 32); } else if (timeType.getPrecision() >= 4 && timeType.getPrecision() <= 6) { return new ArrowType.Time(TimeUnit.MICROSECOND, 64); } else { return new ArrowType.Time(TimeUnit.NANOSECOND, 64); } }
Example 4
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 4 votes |
private Serializer() { super(ArrowType.class, ArrowType.Time.class); }
Example 5
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 4 votes |
private Deserializer() { super(ArrowType.class, ArrowType.Time.class); }
Example 6
Source File: APIFieldDescriber.java From dremio-oss with Apache License 2.0 | 4 votes |
@Override public Void visit(ArrowType.Time time) { return writeString(sqlTypeNameVisitor.visit(time)); }