class SemanticComparator extends AnyRef
SemanticComparator is a tool to compare expressions semantically to a predefined sequence
of targetExpressions. Semantic comparison is based on QueryPlan.canonicalized - for
example, col1 + 1 + col2 is semantically equal to 1 + col2 + col1. To speed up slow tree
traversals and expression node field comparisons, we cache the semantic hashes (which is
simply a hash of a canonicalized subtree) and use them for O(1) indexing. If the hashes don't
match, we perform an early return. Otherwise, we invoke the heavy Expression.semanticEquals
method to make sure that expression trees are indeed identical.
- Alphabetic
- By Inheritance
- SemanticComparator
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SemanticComparator(targetExpressions: Seq[Expression])
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def collectFirst(expression: Expression): Option[Expression]
Returns the first expression in
targetExpressionsthat is semantically equal to the givenexpression.Returns the first expression in
targetExpressionsthat is semantically equal to the givenexpression. If no such expression is found, returnsNone. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists(expression: Expression): Boolean
Use the previously constructed
targetExpressionsBySemanticHashto check if the givenexpressionis semantically equal to any of the target expressions. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)