Class

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

CodeGenContext

Related Doc: package codegen

Permalink

class CodeGenContext extends AnyRef

A context for codegen, which is used to bookkeeping the expressions those are not supported by codegen, then they are evaluated directly. The unsupported expression is appended at the end of references, the position of it is kept in the code, used to access and evaluate it.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CodeGenContext
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CodeGenContext()

    Permalink

Type Members

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

    Permalink

Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final val INPUT_ROW: String("i")

    Permalink

    The variable name of the input row in generated code.

  5. final val JAVA_BOOLEAN: String("boolean")

    Permalink
  6. final val JAVA_BYTE: String("byte")

    Permalink
  7. final val JAVA_DOUBLE: String("double")

    Permalink
  8. final val JAVA_FLOAT: String("float")

    Permalink
  9. final val JAVA_INT: String("int")

    Permalink
  10. final val JAVA_LONG: String("long")

    Permalink
  11. final val JAVA_SHORT: String("short")

    Permalink
  12. def addMutableState(javaType: String, variableName: String, initCode: String): Unit

    Permalink
  13. def addNewFunction(funcName: String, funcCode: String): Unit

    Permalink
  14. val addedFunctions: Map[String, String]

    Permalink

    Holding all the functions those will be added into generated class.

  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. def boxedType(dt: DataType): String

    Permalink
  17. def boxedType(jt: String): String

    Permalink

    Returns the boxed type in Java.

  18. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. def defaultValue(dt: DataType): String

    Permalink
  20. def defaultValue(jt: String): String

    Permalink

    Returns the representation of default value for a given Java Type.

  21. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. val equivalentExpressions: EquivalentExpressions

    Permalink

    Holds expressions that are equivalent.

    Holds expressions that are equivalent. Used to perform subexpression elimination during codegen.

    For expressions that appear more than once, generate additional code to prevent recomputing the value.

    For example, consider two exprsesion generated from this SQL statement: SELECT (col1 + col2), (col1 + col2) / col3.

    equivalentExpressions will match the tree containing col1 + col2 and it will only be evaluated once.

  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def freshName(prefix: String): String

    Permalink

    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.)

  26. def genComp(dataType: DataType, c1: String, c2: String): String

    Permalink

    Generates code for comparing two expressions.

    Generates code for comparing two expressions.

    dataType

    data type of the expressions

    c1

    name of the variable of expression 1's output

    c2

    name of the variable of expression 2's output

  27. def genEqual(dataType: DataType, c1: String, c2: String): String

    Permalink

    Generates code for equal expression in Java.

  28. def genGreater(dataType: DataType, c1: String, c2: String): String

    Permalink

    Generates code for greater of two expressions.

    Generates code for greater of two expressions.

    dataType

    data type of the expressions

    c1

    name of the variable of expression 1's output

    c2

    name of the variable of expression 2's output

  29. def generateExpressions(expressions: Seq[Expression], doSubexpressionElimination: Boolean = false): Seq[GeneratedExpressionCode]

    Permalink

    Generates code for expressions.

    Generates code for expressions. If doSubexpressionElimination is true, subexpression elimination will be performed. Subexpression elimination assumes that the code will for each expression will be combined in the expressions order.

  30. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  31. def getPlaceHolderToComments(): Map[String, String]

    Permalink

    get a map of the pair of a place holder and a corresponding comment

  32. def getValue(input: String, dataType: DataType, ordinal: String): String

    Permalink

    Returns the specialized code to access a value from inputRow at ordinal.

  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  34. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  35. def isPrimitiveType(dt: DataType): Boolean

    Permalink
  36. def isPrimitiveType(jt: String): Boolean

    Permalink

    Returns true if the Java type has a special accessor and setter in InternalRow.

  37. def javaType(dt: DataType): String

    Permalink

    Returns the Java type for a DataType.

  38. val mutableStates: ArrayBuffer[(String, String, String)]

    Permalink

    Holding expressions' mutable states like MonotonicallyIncreasingID.count as a 3-tuple: java type, variable name, code to init it.

    Holding expressions' mutable states like MonotonicallyIncreasingID.count as a 3-tuple: java type, variable name, code to init it. As an example, ("int", "count", "count = 0;") will produce code:

    private int count;

    as a member variable, and add

    count = 0;

    to the constructor.

    They will be kept as member variables in generated classes like SpecificProjection.

  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. def primitiveTypeName(dt: DataType): String

    Permalink
  43. def primitiveTypeName(jt: String): String

    Permalink

    Returns the name used in accessor and setter for a Java primitive type.

  44. val primitiveTypes: Seq[String]

    Permalink

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

  45. val references: ArrayBuffer[Expression]

    Permalink

    Holding all the expressions those do not support codegen, will be evaluated directly.

  46. def registerComment(text: String): String

    Permalink

    Register a comment and return the corresponding place holder

  47. def setColumn(row: String, dataType: DataType, ordinal: Int, value: String): String

    Permalink

    Returns the code to update a column in Row for a given DataType.

  48. def splitExpressions(row: String, expressions: Seq[String]): String

    Permalink

    Splits the generated code of expressions into multiple functions, because function has 64kb code size limit in JVM

    Splits the generated code of expressions into multiple functions, because function has 64kb code size limit in JVM

    row

    the variable name of row that is used by expressions

    expressions

    the codes to evaluate expressions.

  49. val subExprEliminationExprs: HashMap[Expression, SubExprEliminationState]

    Permalink
  50. val subExprResetVariables: ArrayBuffer[String]

    Permalink
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  53. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped