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 hashmonths
. - 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 useresult
as seed, recursively calculate hash value for each element, and assign the element hash value toresult
. - struct: The
result
starts with seed, then useresult
as seed, recursively calculate hash value for each field, and assign the field hash value toresult
.
Finally we aggregate the hash values for each expression by the same way of struct.
Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
- Alphabetic
- By Inheritance
Inherited
- HashLongsExpression
- CodegenFallback
- Expression
- TreeNode
- TreePatternBits
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
- new HashLongsExpression()
Abstract Value Members
- abstract val asStruct: Boolean
-
abstract
def
canEqual(that: Any): Boolean
- Definition Classes
- Equals
-
abstract
def
children: Seq[Expression]
- Definition Classes
- TreeNode
-
abstract
def
computeHash(value: Any, dataType: DataType, hash: Digest): Unit
- Attributes
- protected
- abstract val factory: DigestFactory
-
abstract
def
hasherClassName: String
- Attributes
- protected
-
abstract
def
productArity: Int
- Definition Classes
- Product
-
abstract
def
productElement(n: Int): Any
- Definition Classes
- Product
-
abstract
def
withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression
- Attributes
- protected
- Definition Classes
- TreeNode
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(number: Int): TreeNode[_]
- Definition Classes
- TreeNode
-
def
argString(maxFields: Int): String
- Definition Classes
- TreeNode
-
def
asCode: String
- Definition Classes
- TreeNode
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
lazy val
canonicalized: Expression
- Definition Classes
- Expression
-
def
checkInputDataTypes(): TypeCheckResult
- Definition Classes
- HashLongsExpression → Expression
-
def
childrenResolved: Boolean
- Definition Classes
- Expression
-
def
clone(): Expression
- Definition Classes
- TreeNode → AnyRef
-
def
collect[B](pf: PartialFunction[Expression, B]): Seq[B]
- Definition Classes
- TreeNode
-
def
collectFirst[B](pf: PartialFunction[Expression, B]): Option[B]
- Definition Classes
- TreeNode
-
def
collectLeaves(): Seq[Expression]
- Definition Classes
- TreeNode
-
def
computeHash(input: String, dataType: DataType, result: String, ctx: CodegenContext): String
- Attributes
- protected
-
final
def
containsAllPatterns(patterns: TreePattern*): Boolean
- Definition Classes
- TreePatternBits
-
final
def
containsAnyPattern(patterns: TreePattern*): Boolean
- Definition Classes
- TreePatternBits
-
lazy val
containsChild: Set[TreeNode[_]]
- Definition Classes
- TreeNode
-
final
def
containsPattern(t: TreePattern): Boolean
- Definition Classes
- TreePatternBits
- Annotations
- @inline()
-
def
copyTagsFrom(other: Expression): Unit
- Definition Classes
- TreeNode
-
def
dataType: DataType
- Definition Classes
- HashLongsExpression → Expression
-
lazy val
deterministic: Boolean
- Definition Classes
- Expression
-
def
doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode
- Attributes
- protected
- Definition Classes
- CodegenFallback → Expression
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
eval(input: InternalRow = null): Any
- Definition Classes
- HashLongsExpression → Expression
-
def
fastEquals(other: TreeNode[_]): Boolean
- Definition Classes
- TreeNode
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
find(f: (Expression) ⇒ Boolean): Option[Expression]
- Definition Classes
- TreeNode
-
def
flatArguments: Iterator[Any]
- Attributes
- protected
- Definition Classes
- Expression
-
def
flatMap[A](f: (Expression) ⇒ TraversableOnce[A]): Seq[A]
- Definition Classes
- TreeNode
-
def
foldable: Boolean
- Definition Classes
- HashLongsExpression → Expression
-
def
foreach(f: (Expression) ⇒ Unit): Unit
- Definition Classes
- TreeNode
-
def
foreachUp(f: (Expression) ⇒ Unit): Unit
- Definition Classes
- TreeNode
-
def
genCode(ctx: CodegenContext): ExprCode
- Definition Classes
- Expression
-
def
genHashBoolean(input: String, result: String): String
- Attributes
- protected
-
def
genHashBytes(b: String, result: String): String
- Attributes
- protected
-
def
genHashCalendarInterval(input: String, result: String): String
- Attributes
- protected
-
def
genHashDecimal(ctx: CodegenContext, d: DecimalType, input: String, result: String): String
- Attributes
- protected
-
def
genHashDouble(input: String, result: String): String
- Attributes
- protected
-
def
genHashFloat(input: String, result: String): String
- Attributes
- protected
-
def
genHashForArray(ctx: CodegenContext, input: String, result: String, elementType: DataType, containsNull: Boolean): String
- Attributes
- protected
-
def
genHashForMap(ctx: CodegenContext, input: String, result: String, keyType: DataType, valueType: DataType, valueContainsNull: Boolean): String
- Attributes
- protected
-
def
genHashForStruct(ctx: CodegenContext, input: String, result: String, fields: Array[StructField]): String
- Attributes
- protected
-
def
genHashInt(i: String, result: String): String
- Attributes
- protected
-
def
genHashLong(l: String, result: String): String
- Attributes
- protected
-
def
genHashString(input: String, result: String): String
- Attributes
- protected
-
def
genHashTimestamp(t: String, result: String): String
- Attributes
- protected
-
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
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDefaultTreePatternBits: BitSet
- Attributes
- protected
- Definition Classes
- TreeNode
-
def
getTagValue[T](tag: TreeNodeTag[T]): Option[T]
- Definition Classes
- TreeNode
-
def
hashCode(): Int
- Definition Classes
- TreeNode → AnyRef → Any
-
def
innerChildren: Seq[TreeNode[_]]
- Definition Classes
- TreeNode
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isRuleIneffective(ruleId: RuleId): Boolean
- Attributes
- protected
- Definition Classes
- TreeNode
-
def
jsonFields: List[JField]
- Attributes
- protected
- Definition Classes
- TreeNode
-
final
def
legacyWithNewChildren(newChildren: Seq[Expression]): Expression
- Attributes
- protected
- Definition Classes
- TreeNode
-
def
makeCopy(newArgs: Array[AnyRef]): Expression
- Definition Classes
- TreeNode
-
def
map[A](f: (Expression) ⇒ A): Seq[A]
- Definition Classes
- TreeNode
-
def
mapChildren(f: (Expression) ⇒ Expression): Expression
- Definition Classes
- TreeNode
-
def
mapProductIterator[B](f: (Any) ⇒ B)(implicit arg0: ClassTag[B]): Array[B]
- Attributes
- protected
- Definition Classes
- TreeNode
-
def
markRuleAsIneffective(ruleId: RuleId): Unit
- Attributes
- protected
- Definition Classes
- TreeNode
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nodeName: String
- Definition Classes
- TreeNode
-
val
nodePatterns: Seq[TreePattern]
- Attributes
- protected
- Definition Classes
- TreeNode
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
nullSafeElementHash(input: String, index: String, nullable: Boolean, elementType: DataType, result: String, ctx: CodegenContext): String
- Attributes
- protected
-
def
nullable: Boolean
- Definition Classes
- HashLongsExpression → Expression
-
def
numberedTreeString: String
- Definition Classes
- TreeNode
-
val
origin: Origin
- Definition Classes
- TreeNode
-
def
otherCopyArgs: Seq[AnyRef]
- Attributes
- protected
- Definition Classes
- TreeNode
-
def
p(number: Int): Expression
- Definition Classes
- TreeNode
-
def
prettyJson: String
- Definition Classes
- TreeNode
-
def
prettyName: String
- Definition Classes
- Expression
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
-
def
references: AttributeSet
- Definition Classes
- Expression
-
lazy val
resolved: Boolean
- Definition Classes
- Expression
-
final
def
semanticEquals(other: Expression): Boolean
- Definition Classes
- Expression
-
def
semanticHash(): Int
- Definition Classes
- Expression
-
def
setTagValue[T](tag: TreeNodeTag[T], value: T): Unit
- Definition Classes
- TreeNode
-
def
simpleString(maxFields: Int): String
- Definition Classes
- Expression → TreeNode
-
def
simpleStringWithNodeId(): String
- Definition Classes
- Expression → TreeNode
-
def
sql: String
- Definition Classes
- Expression
-
def
stringArgs: Iterator[Any]
- Attributes
- protected
- Definition Classes
- TreeNode
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toJSON: String
- Definition Classes
- TreeNode
-
def
toString(): String
- Definition Classes
- Expression → TreeNode → AnyRef → Any
-
def
transform(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformDown(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformDownWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformUp(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformUpWithBeforeAndAfterRuleOnChildren(cond: (Expression) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[(Expression, Expression), Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformUpWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
def
transformWithPruning(cond: (TreePatternBits) ⇒ Boolean, ruleId: RuleId)(rule: PartialFunction[Expression, Expression]): Expression
- Definition Classes
- TreeNode
-
lazy val
treePatternBits: BitSet
- Definition Classes
- TreeNode → TreePatternBits
-
def
treeString(append: (String) ⇒ Unit, verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): Unit
- Definition Classes
- TreeNode
-
final
def
treeString(verbose: Boolean, addSuffix: Boolean, maxFields: Int, printOperatorId: Boolean): String
- Definition Classes
- TreeNode
-
final
def
treeString: String
- Definition Classes
- TreeNode
-
def
unsetTagValue[T](tag: TreeNodeTag[T]): Unit
- Definition Classes
- TreeNode
-
final
def
verboseString(maxFields: Int): String
- Definition Classes
- Expression → TreeNode
-
def
verboseStringWithSuffix(maxFields: Int): String
- Definition Classes
- TreeNode
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
withNewChildren(newChildren: Seq[Expression]): Expression
- Definition Classes
- TreeNode