org.apache.spark.sql.catalyst.expressions.codegen

CodeGenerator

Related Doc: package codegen

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

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.

Linear Supertypes
Logging, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CodeGenerator
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CodeGenerator()

Type Members

  1. case class EvaluatedExpression(code: Seq[scala.reflect.api.JavaUniverse.Tree], nullTerm: scala.reflect.api.JavaUniverse.TermName, primitiveTerm: scala.reflect.api.JavaUniverse.TermName, objectTerm: scala.reflect.api.JavaUniverse.TermName) extends Product with Serializable

    Scala ASTs for evaluating an Expression given a Row of input.

    Scala ASTs for evaluating an Expression given a Row of input.

    code

    The sequence of statements required to evaluate the expression.

    nullTerm

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

    primitiveTerm

    A term for a possible primitive value of the result of the evaluation. Not valid if nullTerm is set to true.

    objectTerm

    A possibly boxed version of the result of evaluating this expression.

    Attributes
    protected

Abstract Value Members

  1. abstract def bind(in: InType, inputSchema: Seq[Attribute]): InType

    Binds an input expression to a given input schema

    Binds an input expression to a given input schema

    Attributes
    protected
  2. abstract def canonicalize(in: InType): InType

    Canonicalizes an input expression.

    Canonicalizes an input expression. Used to avoid double caching expressions that differ only cosmetically.

    Attributes
    protected
  3. abstract def create(in: InType): OutType

    Generates a class for a given input expression.

    Generates a class for a given input expression. Called when there is not cached code already available.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def accessorForType(dt: DataType): scala.reflect.api.JavaUniverse.TermName

    Attributes
    protected
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. val cache: LoadingCache[InType, OutType]

    A cache of generated classes.

    A cache of generated classes.

    From the Guava Docs: A Cache is similar to ConcurrentMap, but not quite the same. The most fundamental difference is that a ConcurrentMap persists all elements that are added to it until they are explicitly removed. A Cache on the other hand is generally configured to evict entries automatically, in order to constrain its memory footprint. Note that this cache does not use weak keys/values and thus does not respond to memory pressure.

    Attributes
    protected
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. var debugLogging: Boolean

    Can be flipped on manually in the console to add (expensive) expression evaluation trace code.

  9. def defaultPrimitive(dt: DataType): scala.reflect.api.JavaUniverse.Tree

    Attributes
    protected
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def expressionEvaluator(e: Expression): EvaluatedExpression

    Given an expression tree returns an EvaluatedExpression, which contains Scala trees that can be used to determine the result of evaluating the expression on an input row.

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def freshName(prefix: String): scala.reflect.api.JavaUniverse.TermName

    Returns a term name that is unique within this instance of a CodeGenerator.

    Returns a term name that is unique within this instance of a CodeGenerator.

    (Since we aren't in a macro context we do not seem to have access to the built in freshName function.)

    Attributes
    protected
  15. def generate(expressions: InType): OutType

    Generates the requested evaluator given already bound expression(s).

  16. def generate(expressions: InType, inputSchema: Seq[Attribute]): OutType

    Generates the requested evaluator binding the given expression(s) to the inputSchema.

  17. val genericMutableRowType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  18. val genericRowType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  19. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  20. def getColumn(inputRow: scala.reflect.api.JavaUniverse.TermName, dataType: DataType, ordinal: Int): scala.reflect.api.JavaUniverse.Tree

    Attributes
    protected
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. def hashSetForType(dt: DataType): scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. def isNativeType(dt: DataType): Boolean

    Returns true if the data type has a special accessor and setter in Row.

    Returns true if the data type has a special accessor and setter in Row.

    Attributes
    protected
  25. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  26. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  27. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  28. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  29. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  30. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  31. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  32. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  33. def logName: String

    Attributes
    protected
    Definition Classes
    Logging
  34. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  35. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  36. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  37. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  38. val mutableProjectionType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  39. val mutableRowType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  40. def mutatorForType(dt: DataType): scala.reflect.api.JavaUniverse.TermName

    Attributes
    protected
  41. val nativeTypes: Seq[AtomicType with Product with Serializable]

    List of data types that have special accessors and setters in Row.

    List of data types that have special accessors and setters in Row.

    Attributes
    protected
  42. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  43. final def notify(): Unit

    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  45. def primitiveForType(dt: DataType): String

    Attributes
    protected
  46. val projectionType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  47. val rowType: scala.reflect.api.JavaUniverse.Type

    Attributes
    protected
  48. def setColumn(destinationRow: scala.reflect.api.JavaUniverse.TermName, dataType: DataType, ordinal: Int, value: scala.reflect.api.JavaUniverse.TermName): scala.reflect.api.JavaUniverse.Tree

    Attributes
    protected
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  50. def termForType(dt: DataType): scala.reflect.api.JavaUniverse.TypeTag[_98] forSome {type _98 >: termForType.n.type.InternalType, val n: AtomicType}

    Attributes
    protected
  51. def toString(): String

    Definition Classes
    AnyRef → Any
  52. val toolBox: ToolBox[universe.type]

    Attributes
    protected
  53. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped