c

org.apache.spark.sql.qualityFunctions

HashLongsExpression

abstract class HashLongsExpression extends Expression with CodegenFallback

A function that calculates hash value for a group of expressions. Note that the seed argument is not exposed to users and should only be set inside spark SQL.

The hash value for an expression depends on its type and seed:

  • null: seed
  • boolean: turn boolean into int, 1 for true, 0 for false, and then use murmur3 to hash this int with seed.
  • byte, short, int: use murmur3 to hash the input as int with seed.
  • long: use murmur3 to hash the long input with seed.
  • float: turn it into int: java.lang.Float.floatToIntBits(input), and hash it.
  • double: turn it into long: java.lang.Double.doubleToLongBits(input), and hash it.
  • decimal: if it's a small decimal, i.e. precision <= 18, turn it into long and hash it. Else, turn it into bytes and hash it.
  • calendar interval: hash microseconds first, and use the result as seed to hash months.
  • interval day to second: it store long value of microseconds, use murmur3 to hash the long input with seed.
  • interval year to month: it store int value of months, use murmur3 to hash the int input with seed.
  • binary: use murmur3 to hash the bytes with seed.
  • string: get the bytes of string and hash it.
  • array: The result starts with seed, then use result as seed, recursively calculate hash value for each element, and assign the element hash value to result.
  • struct: The result starts with seed, then use result as seed, recursively calculate hash value for each field, and assign the field hash value to result.

Finally we aggregate the hash values for each expression by the same way of struct.

Linear Supertypes
CodegenFallback, Expression, TreeNode[Expression], TreePatternBits, Product, Equals, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HashLongsExpression
  2. CodegenFallback
  3. Expression
  4. TreeNode
  5. TreePatternBits
  6. Product
  7. Equals
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HashLongsExpression()

Abstract Value Members

  1. abstract val asStruct: Boolean
  2. abstract def canEqual(that: Any): Boolean
    Definition Classes
    Equals
  3. abstract def children: Seq[Expression]
    Definition Classes
    TreeNode
  4. abstract def computeHash(value: Any, dataType: DataType, hash: Digest): Unit
    Attributes
    protected
  5. abstract val factory: DigestFactory
  6. abstract def hasherClassName: String
    Attributes
    protected
  7. abstract def productArity: Int
    Definition Classes
    Product
  8. abstract def productElement(n: Int): Any
    Definition Classes
    Product
  9. abstract def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression
    Attributes
    protected
    Definition Classes
    TreeNode

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 apply(number: Int): TreeNode[_]
    Definition Classes
    TreeNode
  5. def argString(maxFields: Int): String
    Definition Classes
    TreeNode
  6. def asCode: String
    Definition Classes
    TreeNode
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. lazy val canonicalized: Expression
    Definition Classes
    Expression
  9. def checkInputDataTypes(): TypeCheckResult
    Definition Classes
    HashLongsExpression → Expression
  10. def childrenResolved: Boolean
    Definition Classes
    Expression
  11. def clone(): Expression
    Definition Classes
    TreeNode → AnyRef
  12. def collect[B](pf: PartialFunction[Expression, B]): Seq[B]
    Definition Classes
    TreeNode
  13. def collectFirst[B](pf: PartialFunction[Expression, B]): Option[B]
    Definition Classes
    TreeNode
  14. def collectLeaves(): Seq[Expression]
    Definition Classes
    TreeNode
  15. def computeHash(input: String, dataType: DataType, result: String, ctx: CodegenContext): String
    Attributes
    protected
  16. final def containsAllPatterns(patterns: TreePattern*): Boolean
    Definition Classes
    TreePatternBits
  17. final def containsAnyPattern(patterns: TreePattern*): Boolean
    Definition Classes
    TreePatternBits
  18. lazy val containsChild: Set[TreeNode[_]]
    Definition Classes
    TreeNode
  19. final def containsPattern(t: TreePattern): Boolean
    Definition Classes
    TreePatternBits
    Annotations
    @inline()
  20. def copyTagsFrom(other: Expression): Unit
    Definition Classes
    TreeNode
  21. def dataType: DataType
    Definition Classes
    HashLongsExpression → Expression
  22. lazy val deterministic: Boolean
    Definition Classes
    Expression
  23. def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode
    Attributes
    protected
    Definition Classes
    CodegenFallback → Expression
  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  26. def eval(input: InternalRow = null): Any
    Definition Classes
    HashLongsExpression → Expression
  27. def fastEquals(other: TreeNode[_]): Boolean
    Definition Classes
    TreeNode
  28. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def find(f: (Expression) ⇒ Boolean): Option[Expression]
    Definition Classes
    TreeNode
  30. def flatArguments: Iterator[Any]
    Attributes
    protected
    Definition Classes
    Expression
  31. def flatMap[A](f: (Expression) ⇒ TraversableOnce[A]): Seq[A]
    Definition Classes
    TreeNode
  32. def foldable: Boolean
    Definition Classes
    HashLongsExpression → Expression
  33. def foreach(f: (Expression) ⇒ Unit): Unit
    Definition Classes
    TreeNode
  34. def foreachUp(f: (Expression) ⇒ Unit): Unit
    Definition Classes
    TreeNode
  35. def genCode(ctx: CodegenContext): ExprCode
    Definition Classes
    Expression
  36. def genHashBoolean(input: String, result: String): String
    Attributes
    protected
  37. def genHashBytes(b: String, result: String): String
    Attributes
    protected
  38. def genHashCalendarInterval(input: String, result: String): String
    Attributes
    protected
  39. def genHashDecimal(ctx: CodegenContext, d: DecimalType, input: String, result: String): String
    Attributes
    protected
  40. def genHashDouble(input: String, result: String): String
    Attributes
    protected
  41. def genHashFloat(input: String, result: String): String
    Attributes
    protected
  42. def genHashForArray(ctx: CodegenContext, input: String, result: String, elementType: DataType, containsNull: Boolean): String
    Attributes
    protected
  43. def genHashForMap(ctx: CodegenContext, input: String, result: String, keyType: DataType, valueType: DataType, valueContainsNull: Boolean): String
    Attributes
    protected
  44. def genHashForStruct(ctx: CodegenContext, input: String, result: String, fields: Array[StructField]): String
    Attributes
    protected
  45. def genHashInt(i: String, result: String): String
    Attributes
    protected
  46. def genHashLong(l: String, result: String): String
    Attributes
    protected
  47. def genHashString(input: String, result: String): String
    Attributes
    protected
  48. def genHashTimestamp(t: String, result: String): String
    Attributes
    protected
  49. def generateTreeString(depth: Int, lastChildren: Seq[Boolean], append: (String) ⇒ Unit, verbose: Boolean, prefix: String, addSuffix: Boolean, maxFields: Int, printNodeId: Boolean, indent: Int): Unit
    Definition Classes
    TreeNode
  50. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  51. def getDefaultTreePatternBits: BitSet
    Attributes
    protected
    Definition Classes
    TreeNode
  52. def getTagValue[T](tag: TreeNodeTag[T]): Option[T]
    Definition Classes
    TreeNode
  53. def hashCode(): Int
    Definition Classes
    TreeNode → AnyRef → Any
  54. def innerChildren: Seq[TreeNode[_]]
    Definition Classes
    TreeNode
  55. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  56. def isRuleIneffective(ruleId: RuleId): Boolean
    Attributes
    protected
    Definition Classes
    TreeNode
  57. def jsonFields: List[JField]
    Attributes
    protected
    Definition Classes
    TreeNode
  58. final def legacyWithNewChildren(newChildren: Seq[Expression]): Expression
    Attributes
    protected
    Definition Classes
    TreeNode
  59. def makeCopy(newArgs: Array[AnyRef]): Expression
    Definition Classes
    TreeNode
  60. def map[A](f: (Expression) ⇒ A): Seq[A]
    Definition Classes
    TreeNode
  61. def mapChildren(f: (Expression) ⇒ Expression): Expression
    Definition Classes
    TreeNode
  62. def mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]
    Attributes
    protected
    Definition Classes
    TreeNode
  63. def markRuleAsIneffective(ruleId: RuleId): Unit
    Attributes
    protected
    Definition Classes
    TreeNode
  64. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  65. def nodeName: String
    Definition Classes
    TreeNode
  66. val nodePatterns: Seq[TreePattern]
    Attributes
    protected
    Definition Classes
    TreeNode
  67. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  68. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  69. def nullSafeElementHash(input: String, index: String, nullable: Boolean, elementType: DataType, result: String, ctx: CodegenContext): String
    Attributes
    protected
  70. def nullable: Boolean
    Definition Classes
    HashLongsExpression → Expression
  71. def numberedTreeString: String
    Definition Classes
    TreeNode
  72. val origin: Origin
    Definition Classes
    TreeNode
  73. def otherCopyArgs: Seq[AnyRef]
    Attributes
    protected
    Definition Classes
    TreeNode
  74. def p(number: Int): Expression
    Definition Classes
    TreeNode
  75. def prettyJson: String
    Definition Classes
    TreeNode
  76. def prettyName: String
    Definition Classes
    Expression
  77. def productIterator: Iterator[Any]
    Definition Classes
    Product
  78. def productPrefix: String
    Definition Classes
    Product
  79. def references: AttributeSet
    Definition Classes
    Expression
  80. lazy val resolved: Boolean
    Definition Classes
    Expression
  81. final def semanticEquals(other: Expression): Boolean
    Definition Classes
    Expression
  82. def semanticHash(): Int
    Definition Classes
    Expression
  83. def setTagValue[T](tag: TreeNodeTag[T], value: T): Unit
    Definition Classes
    TreeNode
  84. def simpleString(maxFields: Int): String
    Definition Classes
    Expression → TreeNode
  85. def simpleStringWithNodeId(): String
    Definition Classes
    Expression → TreeNode
  86. def sql: String
    Definition Classes
    Expression
  87. def stringArgs: Iterator[Any]
    Attributes
    protected
    Definition Classes
    TreeNode
  88. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  89. def toJSON: String
    Definition Classes
    TreeNode
  90. def toString(): String
    Definition Classes
    Expression → TreeNode → AnyRef → Any
  91. def transform(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  92. def transformDown(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  93. def transformDownWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  94. def transformUp(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  95. def transformUpWithBeforeAndAfterRuleOnChildren(cond: (Expression) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[(Expression, Expression), Expression]): Expression
    Definition Classes
    TreeNode
  96. def transformUpWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  97. def transformWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
    Definition Classes
    TreeNode
  98. lazy val treePatternBits: BitSet
    Definition Classes
    TreeNode → TreePatternBits
  99. def treeString(append: (String) ⇒ Unit, verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): Unit
    Definition Classes
    TreeNode
  100. final def treeString(verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): String
    Definition Classes
    TreeNode
  101. final def treeString: String
    Definition Classes
    TreeNode
  102. def unsetTagValue[T](tag: TreeNodeTag[T]): Unit
    Definition Classes
    TreeNode
  103. final def verboseString(maxFields: Int): String
    Definition Classes
    Expression → TreeNode
  104. def verboseStringWithSuffix(maxFields: Int): String
    Definition Classes
    TreeNode
  105. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  106. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  107. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  108. final def withNewChildren(newChildren: Seq[Expression]): Expression
    Definition Classes
    TreeNode

Inherited from CodegenFallback

Inherited from Expression

Inherited from TreeNode[Expression]

Inherited from TreePatternBits

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped