Class Schema

java.lang.Object
org.apache.arrow.vector.types.pojo.Schema

public class Schema extends Object
An Arrow Schema.
  • Constructor Details

  • Method Details

    • findField

      public static Field findField(List<Field> fields, String name)
      Search for a field by name in given the list of fields.
      Parameters:
      fields - the list of the fields
      name - the name of the field to return
      Returns:
      the corresponding field
      Throws:
      IllegalArgumentException - if the field was not found
    • fromJSON

      public static Schema fromJSON(String json) throws IOException
      Throws:
      IOException
    • deserialize

      @Deprecated public static Schema deserialize(ByteBuffer buffer)
      Deprecated.
      Deserialize a schema that has been serialized using toByteArray().
      Parameters:
      buffer - the bytes to deserialize.
      Returns:
      The deserialized schema.
    • deserializeMessage

      public static Schema deserializeMessage(ByteBuffer buffer)
      Deserialize a schema that has been serialized as a message using serializeAsMessage().
      Parameters:
      buffer - the bytes to deserialize.
      Returns:
      The deserialized schema.
    • convertSchema

      public static Schema convertSchema(Schema schema)
      Converts a flatbuffer schema to its POJO representation.
    • getFields

      public List<Field> getFields()
    • getCustomMetadata

      public Map<String,String> getCustomMetadata()
    • findField

      public Field findField(String name)
      Search for a field by name in this Schema.
      Parameters:
      name - the name of the field to return
      Returns:
      the corresponding field
      Throws:
      IllegalArgumentException - if the field was not found
    • toJson

      public String toJson()
      Returns the JSON string representation of this schema.
    • getSchema

      public int getSchema(com.google.flatbuffers.FlatBufferBuilder builder)
      Adds this schema to the builder returning the size of the builder after adding.
    • serializeAsMessage

      public byte[] serializeAsMessage()
      Returns the serialized flatbuffer bytes of the schema wrapped in a message table. Use deserializeMessage(ByteBuffer) to rebuild the Schema.
    • toByteArray

      @Deprecated public byte[] toByteArray()
      Deprecated.
      This method does not encapsulate the schema in a Message payload which is incompatible with other languages. Use serializeAsMessage() instead.
      Returns the serialized flatbuffer representation of this schema.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object