Object

mimir.algebra

ExpressionUtils

Related Doc: package algebra

Permalink

object ExpressionUtils

Utility methods for manipulating expressions

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExpressionUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def boolToOneZero(e: Expression): Expression

    Permalink

    Convert a boolean-valued expression into a 1 for true, 0 for false

  6. def boolsToBitVector(bv: Seq[Expression]): Expression

    Permalink

    Create a bit vector

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def foldConditionalsToCase(e: Expression): (Seq[(Expression, Expression)], Expression)

    Permalink

    Inverse of makeCaseExpression.

    Inverse of makeCaseExpression. For rewrite simplicity, Mimir uses If-Then-Else clauses. To get back to SQL's CASE statements, we need to find a specific pattern in the expression structure: if(A){ if(B) { W } else { X } } else { if(C){ Y } else { Z } } becomes: CASE WHEN A AND B THEN W WHEN A THEN X WHEN C THEN Y ELSE Z END

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getColumns(e: Expression): Set[String]

    Permalink

    Extract the set of Var() terms (column references) in the specified expression

  14. def getConjuncts(e: Expression): Seq[Expression]

    Permalink

    Flatten a hierarchy of AND operators into a list.

    Flatten a hierarchy of AND operators into a list. For example: AND(A, AND(AND(B, C), D) becomes [A, B, C, D]

  15. def getDisjuncts(e: Expression): Seq[Expression]

    Permalink

    Flatten a hierarchy of OR operators into a list.

    Flatten a hierarchy of OR operators into a list. For example: OR(A, OR(OR(B, C), D) becomes [A, B, C, D]

  16. def getFunctions(e: Expression): Set[String]

    Permalink

    Extract the set of Function() names referenced in the specified expression

  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. def isDataDependent(e: Expression): Boolean

    Permalink

    Return true if the specified expression depends on data

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def makeAnd(el: TraversableOnce[Expression]): Expression

    Permalink

    Optimizing AND constructor that dynamically folds in Boolean constants.

    Optimizing AND constructor that dynamically folds in Boolean constants. For example: makeAnd(true, X) returns X

  21. def makeAnd(a: Expression, b: Expression): Expression

    Permalink

    Optimizing AND constructor that dynamically folds in Boolean constants.

    Optimizing AND constructor that dynamically folds in Boolean constants. For example: makeAnd(true, X) returns X

  22. def makeBitOr(a: Expression, b: Expression): Expression

    Permalink

    Create a bitwise-or from two values, ignoring zeroes

  23. def makeBitOr(el: TraversableOnce[Expression]): Expression

    Permalink

    Create a bitwise-or from an arbitrary list

  24. def makeCaseExpression(testClause: Expression, whenThenClauses: TraversableOnce[(Expression, Expression)], elseClause: Expression): Expression

    Permalink

    SQL CASE expresions in form 2: CASE Q WHEN A THEN X WHEN B THEN Y ELSE Z END This gets represented as: ( Q, [(A, X), (B, Y)], Z ) This utility method converts a case expression into the equivalent chain of Mimir's If-Then-Else clauses: if(Q=A){ X } else { if(Q=B){ Y } else { Z } }

  25. def makeCaseExpression(whenThenClauses: List[(Expression, Expression)], elseClause: Expression): Expression

    Permalink

    SQL CASE expresions in form 1: CASE WHEN A THEN X WHEN B THEN Y ELSE Z END This gets represented as: ( [(A, X), (B, Y)], Z ) This utility method converts a case expression into the equivalent chain of Mimir's If-Then-Else clauses: if(A){ X } else { if(B){ Y } else { Z } }

  26. def makeInTest(lhs: Expression, cases: Seq[Expression]): Expression

    Permalink

    Create an IN test (i.e., X IN (A, B, C, ...))

  27. def makeNot(e: Expression): Expression

    Permalink

    Optimizing NOT constructor that dynamically folds in Boolean constants, ANDs and ORs using demorgan's laws, and reverses terminals like comparators For example: makeNot(X>2 AND true) returns X<=2

  28. def makeOr(el: TraversableOnce[Expression]): Expression

    Permalink

    Optimizing OR constructor that dynamically folds in Boolean constants.

    Optimizing OR constructor that dynamically folds in Boolean constants. For example: makeOr(true, X) returns true

  29. def makeOr(a: Expression, b: Expression): Expression

    Permalink

    Optimizing OR constructor that dynamically folds in Boolean constants.

    Optimizing OR constructor that dynamically folds in Boolean constants. For example: makeOr(true, X) returns true

  30. def makeSum(a: Expression, b: Expression): Expression

    Permalink

    Create a sum from two values, ignoring zeroes

  31. def makeSum(el: TraversableOnce[Expression]): Expression

    Permalink

    Create a sum from an arbitrary list

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

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

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

    Permalink
    Definition Classes
    AnyRef
  35. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped