Class

org.apache.spark.sql.catalyst.expressions

RefParamLiteral

Related Doc: package expressions

Permalink

final class RefParamLiteral extends ParamLiteral

This class is used as a substitution for ParamLiteral when two ParamLiterals have same constant values during parsing. This behaves like being equal to the ParamLiteral it points to in all respects but will be different from other ParamLiterals. Two RefParamLiterals will be equal iff their respective ParamLiterals are.

The above policy allows an expression like "a = 4 and b = 4" to be equal to "a = 5 and b = 5" after tokenization but will be different from "a = 5 and b = 6". This distinction is required because former can lead to a different execution plan after common-subexpression processing etc that can apply on because the actual values for the two tokenized values are equal in this instance. Hence it can lead to a different plan in case where actual constants are different, so after tokenization they should act as different expressions. See TPCH Q19 for an example where equal values in two different positions lead to an optimized plan due to common-subexpression being pulled out of OR conditions as a separate AND condition which leads to further filter push down which is not possible if the actual values are different.

Note: This class maintains its own copy of value since it can change in execution (e.g. ROUND can change precision of underlying Decimal value) which should not lead to a change of value of referenced ParamLiteral or vice-versa. However, during planning, code generation and other phases before runJob, the value and dataType should match exactly which is checked by referenceEquals. After deserialization on remote executor, the class no longer maintains a reference and falls back to behaving like a regular ParamLiteral since the required analysis and other phases are already done, and final code generation requires a copy of the values.

Linear Supertypes
ParamLiteral, Serializable, Serializable, KryoSerializable, TokenizedLiteral, DynamicReplacableConstant, LeafExpression, Expression, TreeNode[Expression], Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RefParamLiteral
  2. ParamLiteral
  3. Serializable
  4. Serializable
  5. KryoSerializable
  6. TokenizedLiteral
  7. DynamicReplacableConstant
  8. LeafExpression
  9. Expression
  10. TreeNode
  11. Product
  12. Equals
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RefParamLiteral(param: ParamLiteral, _value: Any, _dataType: DataType, _pos: Int)

    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 var _foldable: Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    TokenizedLiteral
  5. def apply(number: Int): TreeNode[_]

    Permalink
    Definition Classes
    TreeNode
  6. def argString: String

    Permalink
    Definition Classes
    TreeNode
  7. def asCode: String

    Permalink
    Definition Classes
    TreeNode
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def asLiteral: TokenLiteral

    Permalink
    Definition Classes
    ParamLiteral
  10. lazy val canonicalized: Expression

    Permalink
    Definition Classes
    Expression
  11. def checkInputDataTypes(): TypeCheckResult

    Permalink
    Definition Classes
    Expression
  12. final def children: Seq[Expression]

    Permalink
    Definition Classes
    LeafExpression → TreeNode
  13. def childrenResolved: Boolean

    Permalink
    Definition Classes
    Expression
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def collect[B](pf: PartialFunction[Expression, B]): Seq[B]

    Permalink
    Definition Classes
    TreeNode
  16. def collectFirst[B](pf: PartialFunction[Expression, B]): Option[B]

    Permalink
    Definition Classes
    TreeNode
  17. def collectLeaves(): Seq[Expression]

    Permalink
    Definition Classes
    TreeNode
  18. lazy val containsChild: Set[TreeNode[_]]

    Permalink
    Definition Classes
    TreeNode
  19. var dataType: DataType

    Permalink
    Definition Classes
    ParamLiteral → Expression
  20. final def deterministic: Boolean

    Permalink
    Definition Classes
    DynamicReplacableConstant → Expression
  21. final def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode

    Permalink
    Definition Classes
    DynamicReplacableConstant → Expression
  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def equals(obj: Any): Boolean

    Permalink
    Definition Classes
    RefParamLiteralParamLiteral → Equals → AnyRef → Any
  24. def eval(input: InternalRow): Any

    Permalink
    Definition Classes
    ParamLiteral → Expression
  25. def fastEquals(other: TreeNode[_]): Boolean

    Permalink
    Definition Classes
    TreeNode
  26. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. def find(f: (Expression) ⇒ Boolean): Option[Expression]

    Permalink
    Definition Classes
    TreeNode
  28. def flatArguments: Iterator[Any]

    Permalink
    Attributes
    protected
    Definition Classes
    Expression
  29. def flatMap[A](f: (Expression) ⇒ TraversableOnce[A]): Seq[A]

    Permalink
    Definition Classes
    TreeNode
  30. final def foldable: Boolean

    Permalink
    Definition Classes
    TokenizedLiteral → Expression
  31. def foreach(f: (Expression) ⇒ Unit): Unit

    Permalink
    Definition Classes
    TreeNode
  32. def foreachUp(f: (Expression) ⇒ Unit): Unit

    Permalink
    Definition Classes
    TreeNode
  33. def genCode(ctx: CodegenContext): ExprCode

    Permalink
    Definition Classes
    Expression
  34. def generateTreeString(depth: Int, lastChildren: Seq[Boolean], builder: StringBuilder, verbose: Boolean, prefix: String): StringBuilder

    Permalink
    Definition Classes
    TreeNode
  35. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int

    Permalink
    Definition Classes
    RefParamLiteralParamLiteral → TreeNode → AnyRef → Any
  37. def innerChildren: Seq[TreeNode[_]]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  38. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  39. def jsonFields: List[JField]

    Permalink
    Attributes
    protected[org.apache.spark.sql]
    Definition Classes
    ParamLiteral → TreeNode
  40. final def makeCopy(newArgs: Array[AnyRef]): Expression

    Permalink
    Definition Classes
    TokenizedLiteral → TreeNode
  41. def map[A](f: (Expression) ⇒ A): Seq[A]

    Permalink
    Definition Classes
    TreeNode
  42. def mapChildren(f: (Expression) ⇒ Expression): Expression

    Permalink
    Definition Classes
    TreeNode
  43. def mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  44. final def markFoldable(b: Boolean): TokenizedLiteral

    Permalink
    Definition Classes
    TokenizedLiteral
  45. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  46. def nodeName: String

    Permalink
    Definition Classes
    ParamLiteral → TreeNode
  47. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  49. def nullable: Boolean

    Permalink
    Definition Classes
    ParamLiteral → Expression
  50. def numberedTreeString: String

    Permalink
    Definition Classes
    TreeNode
  51. val origin: Origin

    Permalink
    Definition Classes
    TreeNode
  52. def otherCopyArgs: Seq[AnyRef]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  53. def p(number: Int): Expression

    Permalink
    Definition Classes
    TreeNode
  54. val param: ParamLiteral

    Permalink
  55. var pos: Int

    Permalink
    Definition Classes
    ParamLiteral
  56. def prettyJson: String

    Permalink
    Definition Classes
    TreeNode
  57. def prettyName: String

    Permalink
    Definition Classes
    ParamLiteral → Expression
  58. def read(kryo: Kryo, input: Input): Unit

    Permalink
    Definition Classes
    ParamLiteral → KryoSerializable
  59. def references: AttributeSet

    Permalink
    Definition Classes
    Expression
  60. lazy val resolved: Boolean

    Permalink
    Definition Classes
    Expression
  61. def semanticEquals(other: Expression): Boolean

    Permalink
    Definition Classes
    ParamLiteral → Expression
  62. def semanticHash(): Int

    Permalink
    Definition Classes
    Expression
  63. def simpleString: String

    Permalink
    Definition Classes
    Expression → TreeNode
  64. def sql: String

    Permalink
    Definition Classes
    ParamLiteral → Expression
  65. def stringArgs: Iterator[Any]

    Permalink
    Attributes
    protected
    Definition Classes
    TreeNode
  66. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  67. def toJSON: String

    Permalink
    Definition Classes
    TreeNode
  68. def toString(): String

    Permalink
    Definition Classes
    ParamLiteral → Expression → TreeNode → AnyRef → Any
  69. def transform(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  70. def transformDown(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  71. def transformUp(rule: PartialFunction[Expression, Expression]): Expression

    Permalink
    Definition Classes
    TreeNode
  72. def treeString(verbose: Boolean): String

    Permalink
    Definition Classes
    TreeNode
  73. def treeString: String

    Permalink
    Definition Classes
    TreeNode
  74. var value: Any

    Permalink
  75. def valueString: String

    Permalink
    Definition Classes
    ParamLiteralTokenizedLiteral
  76. final def verboseString: String

    Permalink
    Definition Classes
    Expression → TreeNode
  77. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. final def withNewChildren(newChildren: Seq[Expression]): Expression

    Permalink
    Definition Classes
    TokenizedLiteral → TreeNode
  81. def write(kryo: Kryo, output: Output): Unit

    Permalink
    Definition Classes
    ParamLiteral → KryoSerializable

Inherited from ParamLiteral

Inherited from Serializable

Inherited from Serializable

Inherited from KryoSerializable

Inherited from TokenizedLiteral

Inherited from DynamicReplacableConstant

Inherited from LeafExpression

Inherited from Expression

Inherited from TreeNode[Expression]

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped