UnsafeProjection¶
UnsafeProjection
is an extension of the Projection abstraction for projection functions from InternalRows to (produce) UnsafeRows.
UnsafeProjection: InternalRow => UnsafeRow
UnsafeProjection
is created for code generated and interpreted code evaluation paths (using UnsafeProjection factory object).
Contract¶
Encoding InternalRow as UnsafeRow¶
apply(
row: InternalRow): UnsafeRow
Encodes the given InternalRow to an UnsafeRow
Implementations¶
InterpretedUnsafeProjection
CodeGeneratorWithInterpretedFallback¶
UnsafeProjection
factory object is a CodeGeneratorWithInterpretedFallback of UnsafeProjection
s (based on Expressions).
CodeGeneratorWithInterpretedFallback[Seq[Expression], UnsafeProjection]
createCodeGeneratedObject¶
CodeGeneratorWithInterpretedFallback
createCodeGeneratedObject(
in: Seq[Expression]): UnsafeProjection
createCodeGeneratedObject
is part of the CodeGeneratorWithInterpretedFallback abstraction.
createCodeGeneratedObject
generates an UnsafeProjection for the given Expressions (possibly with Subexpression Elimination based on spark.sql.subexpressionElimination.enabled configuration property).
createInterpretedObject¶
CodeGeneratorWithInterpretedFallback
createInterpretedObject(
in: Seq[Expression]): UnsafeProjection
createInterpretedObject
is part of the CodeGeneratorWithInterpretedFallback abstraction.
createInterpretedObject
creates an UnsafeProjection
for the given Expressions.
Creating UnsafeProjection¶
create(
fields: Array[DataType]): UnsafeProjection
create(
expr: Expression): UnsafeProjection
create(
exprs: Seq[Expression]): UnsafeProjection // (1)!
create(
exprs: Seq[Expression],
inputSchema: Seq[Attribute]): UnsafeProjection
create(
schema: StructType): UnsafeProjection
- The main
create
that the other variants depend on
create
creates an UnsafeProjection for the given Expressions.
create
is used when:
ExpressionEncoder
is requested to create a serializerV2Aggregator
is requested for aninputProjection
- SerializeFromObjectExec physical operator is executed
SortExec
physical operator is requested to create an UnsafeExternalRowSorterHashAggregateExec
physical operator is requested to create a hash map and getEmptyAggregationBufferAggregationIterator
is created and requested to generateResultProjectionTungstenAggregationIterator
is requested to create an aggregation bufferScalaAggregator
is requested for the inputProjection- others