Class TinyIntFieldWriter

  • All Implemented Interfaces:
    FieldWriter

    public class TinyIntFieldWriter
    extends Object
    implements FieldWriter
    Used to write a value and apply constraints for a particular column to the row currently being processed. This interface enables the use of a pseudo-code generator for RowWriter which reduces object and branching overhead when translating from your source system to Apache

    For example of how to use this, see ExampleRecordHandler in athena-federation-sdk.

    See Also:
    FieldWriter
    • Constructor Detail

      • TinyIntFieldWriter

        public TinyIntFieldWriter​(TinyIntExtractor extractor,
                                  org.apache.arrow.vector.TinyIntVector vector,
                                  ConstraintProjector rawConstraint)
        Creates a new instance of this FieldWriter and configures is such that writing a value required minimal branching or secondary operations (metadata lookups, etc..)
        Parameters:
        extractor - The Extractor that can be used to obtain the value for the required column from the context.
        vector - The ApacheArrow vector to write the value to.
        rawConstraint - The Constraint to apply to the value when returning if the value was valid.
    • Method Detail

      • write

        public boolean write​(Object context,
                             int rowNum)
                      throws Exception
        Attempts to write a value to the Apache Arrow vector provided at construction time.
        Specified by:
        write in interface FieldWriter
        Parameters:
        context - The context (specific to the extractor) from which to extract a value.
        rowNum - The row to write the value into.
        Returns:
        True if the value passed constraints and should be considered valid, False otherwise.
        Throws:
        Exception - internal exception