Java Code Examples for org.apache.arrow.vector.types.pojo.ArrowType#Bool
The following examples show how to use
org.apache.arrow.vector.types.pojo.ArrowType#Bool .
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: ArrowUtils.java From konduit-serving with Apache License 2.0 | 6 votes |
public static ColumnMetaData metaDataFromField(Field field) { ArrowType arrowType = field.getFieldType().getType(); if (arrowType instanceof ArrowType.Int) { ArrowType.Int intType = (ArrowType.Int) arrowType; return intType.getBitWidth() == 32 ? new IntegerMetaData(field.getName()) : new LongMetaData(field.getName()); } else if (arrowType instanceof ArrowType.Bool) { return new BooleanMetaData(field.getName()); } else if (arrowType instanceof ArrowType.FloatingPoint) { ArrowType.FloatingPoint floatingPointType = (ArrowType.FloatingPoint) arrowType; return floatingPointType.getPrecision() == FloatingPointPrecision.DOUBLE ? new DoubleMetaData(field.getName()) : new FloatMetaData(field.getName()); } else if (arrowType instanceof ArrowType.Binary) { return new BinaryMetaData(field.getName()); } else if (arrowType instanceof ArrowType.Utf8) { return new StringMetaData(field.getName()); } else if (arrowType instanceof ArrowType.Date) { return new TimeMetaData(field.getName()); } else { throw new IllegalStateException("Illegal type " + field.getFieldType().getType()); } }
Example 2
Source File: ArrowConverter.java From DataVec with Apache License 2.0 | 5 votes |
private static ColumnMetaData metaDataFromField(Field field) { ArrowType arrowType = field.getFieldType().getType(); if(arrowType instanceof ArrowType.Int) { val intType = (ArrowType.Int) arrowType; if(intType.getBitWidth() == 32) return new IntegerMetaData(field.getName()); else { return new LongMetaData(field.getName()); } } else if(arrowType instanceof ArrowType.Bool) { return new BooleanMetaData(field.getName()); } else if(arrowType instanceof ArrowType.FloatingPoint) { val floatingPointType = (ArrowType.FloatingPoint) arrowType; if(floatingPointType.getPrecision() == FloatingPointPrecision.DOUBLE) return new DoubleMetaData(field.getName()); else { return new FloatMetaData(field.getName()); } } else if(arrowType instanceof ArrowType.Binary) { return new BinaryMetaData(field.getName()); } else if(arrowType instanceof ArrowType.Utf8) { return new StringMetaData(field.getName()); } else if(arrowType instanceof ArrowType.Date) { return new TimeMetaData(field.getName()); } else { throw new IllegalStateException("Illegal type " + field.getFieldType().getType()); } }
Example 3
Source File: ArrowConverter.java From deeplearning4j with Apache License 2.0 | 5 votes |
private static ColumnMetaData metaDataFromField(Field field) { ArrowType arrowType = field.getFieldType().getType(); if(arrowType instanceof ArrowType.Int) { val intType = (ArrowType.Int) arrowType; if(intType.getBitWidth() == 32) return new IntegerMetaData(field.getName()); else { return new LongMetaData(field.getName()); } } else if(arrowType instanceof ArrowType.Bool) { return new BooleanMetaData(field.getName()); } else if(arrowType instanceof ArrowType.FloatingPoint) { val floatingPointType = (ArrowType.FloatingPoint) arrowType; if(floatingPointType.getPrecision() == FloatingPointPrecision.DOUBLE) return new DoubleMetaData(field.getName()); else { return new FloatMetaData(field.getName()); } } else if(arrowType instanceof ArrowType.Binary) { return new BinaryMetaData(field.getName()); } else if(arrowType instanceof ArrowType.Utf8) { return new StringMetaData(field.getName()); } else if(arrowType instanceof ArrowType.Date) { return new TimeMetaData(field.getName()); } else { throw new IllegalStateException("Illegal type " + field.getFieldType().getType()); } }
Example 4
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 4 votes |
private Serializer() { super(ArrowType.class, ArrowType.Bool.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.Bool.class); }
Example 6
Source File: ArrowTypeSerDe.java From aws-athena-query-federation with Apache License 2.0 | 4 votes |
@Override protected ArrowType doTypedDeserialize(JsonParser jparser, DeserializationContext ctxt) throws IOException { return new ArrowType.Bool(); }
Example 7
Source File: APIFieldDescriber.java From dremio-oss with Apache License 2.0 | 4 votes |
@Override public Void visit(ArrowType.Bool bool) { return writeString(sqlTypeNameVisitor.visit(bool)); }