Package

org.apache.spark.sql.catalyst.expressions

codegen

Permalink

package codegen

A collection of generators that build custom bytecode at runtime for performing the evaluation of catalyst expression.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. codegen
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class BaseMutableProjection extends MutableProjection

    Permalink
  2. class BaseOrdering extends Ordering[InternalRow]

    Permalink

    Inherits some default implementation for Java from Ordering[Row]

  3. abstract class BaseProjection extends Projection

    Permalink

    Java can not access Projection (in package object)

  4. class BufferHolder extends AnyRef

    Permalink
  5. class CodeAndComment extends Serializable

    Permalink

    A wrapper for the source code to be compiled by CodeGenerator.

  6. abstract class CodeGenerator[InType <: AnyRef, OutType <: AnyRef] extends Logging

    Permalink

    A base class for generators of byte code to perform expression evaluation.

    A base class for generators of byte code to perform expression evaluation. Includes a set of helpers for referring to Catalyst types and building trees that perform evaluation of individual expressions.

  7. class CodegenContext extends AnyRef

    Permalink

    A context for codegen, tracking a list of objects that could be passed into generated Java function.

  8. trait CodegenFallback extends Expression

    Permalink

    A trait that can be used to provide a fallback mode for expression code generation.

  9. case class ExprCode(code: String, isNull: String, value: String) extends Product with Serializable

    Permalink

    Java source for evaluating an Expression given a InternalRow of input.

    Java source for evaluating an Expression given a InternalRow of input.

    code

    The sequence of statements required to evaluate the expression. It should be empty string, if isNull and value are already existed, or no code needed to evaluate them (literals).

    isNull

    A term that holds a boolean value representing whether the expression evaluated to null.

    value

    A term for a (possibly primitive) value of the result of the evaluation. Not valid if isNull is set to true.

  10. abstract class GeneratedClass extends AnyRef

    Permalink

    A wrapper for generated class, defines a generate method so that we can pass extra objects into generated class.

  11. class LazilyGeneratedOrdering extends Ordering[InternalRow] with KryoSerializable

    Permalink

    A lazily generated row ordering comparator.

  12. abstract class Predicate extends AnyRef

    Permalink

    Interface for generated predicate

  13. case class SubExprCodes(codes: Seq[String], states: Map[Expression, SubExprEliminationState]) extends Product with Serializable

    Permalink

    Codes and common subexpressions mapping used for subexpression elimination.

    Codes and common subexpressions mapping used for subexpression elimination.

    codes

    Strings representing the codes that evaluate common subexpressions.

    states

    Foreach expression that is participating in subexpression elimination, the state to use.

  14. case class SubExprEliminationState(isNull: String, value: String) extends Product with Serializable

    Permalink

    State used for subexpression elimination.

    State used for subexpression elimination.

    isNull

    A term that holds a boolean value representing whether the expression evaluated to null.

    value

    A term for a value of a common sub-expression. Not valid if isNull is set to true.

  15. class UnsafeArrayWriter extends AnyRef

    Permalink
  16. abstract class UnsafeRowJoiner extends AnyRef

    Permalink
  17. class UnsafeRowWriter extends AnyRef

    Permalink

Value Members

  1. object CodeFormatter

    Permalink

    An utility class that indents a block of code based on the curly braces and parentheses.

    An utility class that indents a block of code based on the curly braces and parentheses. This is used to prettify generated code when in debug mode (or exceptions).

    Written by Matei Zaharia.

  2. object CodeGenerator extends Logging

    Permalink
  3. object DumpByteCode

    Permalink

    Dumps the bytecode from a class to the screen using javap.

  4. object ExpressionCanonicalizer extends RuleExecutor[Expression]

    Permalink

    Canonicalizes an expression so those that differ only by names can reuse the same code.

  5. object GenerateMutableProjection extends CodeGenerator[Seq[Expression], MutableProjection]

    Permalink

    Generates byte code that produces a InternalRow object that can update itself based on a new input InternalRow for a fixed set of Expressions.

    Generates byte code that produces a InternalRow object that can update itself based on a new input InternalRow for a fixed set of Expressions. It exposes a target method, which is used to set the row that will be updated. The internal InternalRow object created internally is used only when target is not used.

  6. object GenerateOrdering extends CodeGenerator[Seq[SortOrder], Ordering[InternalRow]] with Logging

    Permalink

    Generates bytecode for an Ordering of rows for a given set of expressions.

  7. object GeneratePredicate extends CodeGenerator[Expression, Predicate]

    Permalink

    Generates bytecode that evaluates a boolean Expression on a given input InternalRow.

  8. object GenerateSafeProjection extends CodeGenerator[Seq[Expression], Projection]

    Permalink

    Generates byte code that produces a InternalRow object (not an UnsafeRow) that can update itself based on a new input InternalRow for a fixed set of Expressions.

  9. object GenerateUnsafeProjection extends CodeGenerator[Seq[Expression], UnsafeProjection]

    Permalink

    Generates a Projection that returns an UnsafeRow.

    Generates a Projection that returns an UnsafeRow.

    It generates the code for all the expressions, compute the total length for all the columns (can be accessed via variables), and then copy the data into a scratch buffer space in the form of UnsafeRow (the scratch buffer will grow as needed).

    Note: The returned UnsafeRow will be pointed to a scratch buffer inside the projection.

  10. object GenerateUnsafeRowJoiner extends CodeGenerator[(StructType, StructType), UnsafeRowJoiner]

    Permalink

    A code generator for concatenating two UnsafeRows into a single UnsafeRow.

    A code generator for concatenating two UnsafeRows into a single UnsafeRow.

    The high level algorithm is:

    1. Concatenate the two bitsets together into a single one, taking padding into account. 2. Move fixed-length data. 3. Move variable-length data. 4. Update the offset position (i.e. the upper 32 bits in the fixed length part) for all variable-length data.

  11. object LazilyGeneratedOrdering extends Serializable

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped