Class VarCharFieldWriter
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.data.writers.fieldwriters.VarCharFieldWriter
-
- All Implemented Interfaces:
FieldWriter
public class VarCharFieldWriter 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 ApacheFor example of how to use this, see ExampleRecordHandler in athena-federation-sdk.
- See Also:
FieldWriter
-
-
Constructor Summary
Constructors Constructor Description VarCharFieldWriter(VarCharExtractor extractor, org.apache.arrow.vector.VarCharVector 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..)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
write(Object context, int rowNum)
Attempts to write a value to the Apache Arrow vector provided at construction time.
-
-
-
Constructor Detail
-
VarCharFieldWriter
public VarCharFieldWriter(VarCharExtractor extractor, org.apache.arrow.vector.VarCharVector 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 interfaceFieldWriter
- 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
-
-