Java Code Examples for org.apache.arrow.vector.types.pojo.ArrowType#Map

The following examples show how to use org.apache.arrow.vector.types.pojo.ArrowType#Map . 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: SqlTypeNameToArrowType.java    From dremio-flight-connector with Apache License 2.0 4 votes vote down vote up
public static ArrowType toArrowType(UserProtos.ResultColumnMetadata type) {
  String typeName = type.getDataType();
  switch (typeName) {
    case "NULL":
      return new Null();
    case "MAP":
      return new ArrowType.Map(false); //todo inner type?
    case "ARRAY":
      return new ArrowType.List(); //todo inner type?
    case "UNION":
      throw new UnsupportedOperationException("have not implemented unions");
      //return new Union(); //todo inner type?
    case "TINYINT":
      return new Int(8, true);
    case "SMALLINT":
      return new Int(16, true);
    case "INTEGER":
      return new Int(32, true);
    case "BIGINT":
      return new Int(64, true);
    case "FLOAT":
      return new FloatingPoint(FloatingPointPrecision.SINGLE);
    case "DOUBLE":
      return new FloatingPoint(FloatingPointPrecision.DOUBLE);
    case "CHARACTER VARYING":
      return new Utf8();
    case "BINARY VARYING":
      return new Binary();
    case "BOOLEAN":
      return new Bool();
    case "DECIMAL":
      return new Decimal(type.getPrecision(), type.getScale());
    case "DATE":
      return new Date(DateUnit.MILLISECOND);
    case "TIME":
      return new Time(TimeUnit.MICROSECOND, 64);
    case "TIMESTAMP":
      return new Timestamp(TimeUnit.MICROSECOND, "UTC");
    case "INTERVAL DAY TO SECOND":
      return new Interval(IntervalUnit.DAY_TIME);
    case "INTERVAL YEAR TO MONTH":
      return new Interval(IntervalUnit.YEAR_MONTH);
    case "BINARY":
      return new ArrowType.FixedSizeBinary(50);
    default:
      throw new IllegalStateException("unable to find arrow type for " + typeName);
  }
}
 
Example 2
Source File: AbstractArrowTypeVisitor.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public T visit(ArrowType.Map type) {
  throw new UnsupportedOperationException("Dremio does not support map yet.");
}
 
Example 3
Source File: Describer.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public String visit(ArrowType.Map type) {
  throw new UnsupportedOperationException("Dremio does not support map yet.");
}
 
Example 4
Source File: SqlDisplaySizeVisitor.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public Integer visit(ArrowType.Map paramDuration) {
  throw new UnsupportedOperationException("Dremio does not support map.");
}
 
Example 5
Source File: SqlTypeNameVisitor.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public String visit(ArrowType.Map paramDuration) {
  throw new UnsupportedOperationException("Dremio does not support map.");
}
 
Example 6
Source File: APIFieldDescriber.java    From dremio-oss with Apache License 2.0 4 votes vote down vote up
@Override
public Void visit(ArrowType.Map interval) {
  throw new UnsupportedOperationException("Map arrow type is not supported");
}