Class SchemaConverter


  • public class SchemaConverter
    extends Object
    Logic to convert Parquet and Arrow Schemas back and forth and maintain the mapping
    • Constructor Detail

      • SchemaConverter

        public SchemaConverter()
        For when we'll need this to be configurable
      • SchemaConverter

        public SchemaConverter​(boolean convertInt96ToArrowTimestamp)
    • Method Detail

      • fromArrow

        public SchemaMapping fromArrow​(org.apache.arrow.vector.types.pojo.Schema arrowSchema)
        Creates a Parquet Schema from an Arrow one and returns the mapping
        Parameters:
        arrowSchema - the provided Arrow Schema
        Returns:
        the mapping between the 2
      • fromParquet

        public SchemaMapping fromParquet​(org.apache.parquet.schema.MessageType parquetSchema)
        Creates an Arrow Schema from an Parquet one and returns the mapping
        Parameters:
        parquetSchema - the provided Parquet Schema
        Returns:
        the mapping between the 2
      • map

        public SchemaMapping map​(org.apache.arrow.vector.types.pojo.Schema arrowSchema,
                                 org.apache.parquet.schema.MessageType parquetSchema)
        Maps a Parquet and Arrow Schema For now does not validate primitive type compatibility
        Parameters:
        arrowSchema - an Arrow schema
        parquetSchema - a Parquet message type
        Returns:
        the mapping between the 2