Packages

c

org.apache.spark.sql.execution.aggregate

MergingSessionsIterator

class MergingSessionsIterator extends AggregationIterator

This is a variant of SortAggregateIterator which merges the session windows based on the fact input rows are sorted by "group keys + the start time of session window".

When merging windows, it also applies aggregations on merged window, which eliminates the necessity on buffering inputs (which requires copying rows) and update the session spec for each input.

Linear Supertypes
AggregationIterator, Logging, Iterator[UnsafeRow], TraversableOnce[UnsafeRow], GenTraversableOnce[UnsafeRow], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MergingSessionsIterator
  2. AggregationIterator
  3. Logging
  4. Iterator
  5. TraversableOnce
  6. GenTraversableOnce
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MergingSessionsIterator(partIndex: Int, groupingExpressions: Seq[NamedExpression], sessionExpression: NamedExpression, valueAttributes: Seq[Attribute], inputIterator: Iterator[InternalRow], aggregateExpressions: Seq[AggregateExpression], aggregateAttributes: Seq[Attribute], initialInputBufferOffset: Int, resultExpressions: Seq[NamedExpression], newMutableProjection: (Seq[Expression], Seq[Attribute]) ⇒ MutableProjection, numOutputRows: SQLMetric)

Type Members

  1. class GroupedIterator[B >: A] extends AbstractIterator[Seq[B]] with Iterator[Seq[B]]
    Definition Classes
    Iterator

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++[B >: UnsafeRow](that: ⇒ GenTraversableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. def addString(b: StringBuilder): StringBuilder
    Definition Classes
    TraversableOnce
  6. def addString(b: StringBuilder, sep: String): StringBuilder
    Definition Classes
    TraversableOnce
  7. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
    Definition Classes
    TraversableOnce
  8. def aggregate[B](z: ⇒ B)(seqop: (B, UnsafeRow) ⇒ B, combop: (B, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. val aggregateFunctions: Array[AggregateFunction]
    Attributes
    protected
    Definition Classes
    AggregationIterator
  10. val allImperativeAggregateFunctionPositions: Array[Int]
    Attributes
    protected[this]
    Definition Classes
    AggregationIterator
  11. val allImperativeAggregateFunctions: Array[ImperativeAggregate]
    Attributes
    protected[this]
    Definition Classes
    AggregationIterator
  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. def buffered: BufferedIterator[UnsafeRow]
    Definition Classes
    Iterator
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  15. def collect[B](pf: PartialFunction[UnsafeRow, B]): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @migration
    Migration

    (Changed in version 2.8.0) collect has changed. The previous behavior can be reproduced with toSeq.

  16. def collectFirst[B](pf: PartialFunction[UnsafeRow, B]): Option[B]
    Definition Classes
    TraversableOnce
  17. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  18. def copyToArray[B >: UnsafeRow](xs: Array[B], start: Int, len: Int): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  19. def copyToArray[B >: UnsafeRow](xs: Array[B]): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  20. def copyToArray[B >: UnsafeRow](xs: Array[B], start: Int): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  21. def copyToBuffer[B >: UnsafeRow](dest: Buffer[B]): Unit
    Definition Classes
    TraversableOnce
  22. def corresponds[B](that: GenTraversableOnce[B])(p: (UnsafeRow, B) ⇒ Boolean): Boolean
    Definition Classes
    Iterator
  23. def count(p: (UnsafeRow) ⇒ Boolean): Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  24. def drop(n: Int): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  25. def dropWhile(p: (UnsafeRow) ⇒ Boolean): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  26. def duplicate: (Iterator[UnsafeRow], Iterator[UnsafeRow])
    Definition Classes
    Iterator
  27. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  29. def exists(p: (UnsafeRow) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  30. val expressionAggInitialProjection: MutableProjection
    Attributes
    protected[this]
    Definition Classes
    AggregationIterator
  31. def filter(p: (UnsafeRow) ⇒ Boolean): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  32. def filterNot(p: (UnsafeRow) ⇒ Boolean): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  33. def find(p: (UnsafeRow) ⇒ Boolean): Option[UnsafeRow]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  34. def flatMap[B](f: (UnsafeRow) ⇒ GenTraversableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  35. def fold[A1 >: UnsafeRow](z: A1)(op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  36. def foldLeft[B](z: B)(op: (B, UnsafeRow) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  37. def foldRight[B](z: B)(op: (UnsafeRow, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  38. def forall(p: (UnsafeRow) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  39. def foreach[U](f: (UnsafeRow) ⇒ U): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  40. val generateOutput: (UnsafeRow, InternalRow) ⇒ UnsafeRow
    Attributes
    protected
    Definition Classes
    AggregationIterator
  41. def generateProcessRow(expressions: Seq[AggregateExpression], functions: Seq[AggregateFunction], inputAttributes: Seq[Attribute]): (InternalRow, InternalRow) ⇒ Unit
    Attributes
    protected
    Definition Classes
    AggregationIterator
  42. def generateResultProjection(): (UnsafeRow, InternalRow) ⇒ UnsafeRow
    Attributes
    protected
    Definition Classes
    AggregationIterator
  43. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  44. def grouped[B >: UnsafeRow](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  45. val groupingAttributes: Seq[Attribute]
    Attributes
    protected
    Definition Classes
    AggregationIterator
  46. val groupingProjection: UnsafeProjection
    Attributes
    protected
    Definition Classes
    AggregationIterator
  47. val groupingWithoutSession: Seq[NamedExpression]
  48. val groupingWithoutSessionAttributes: Seq[Attribute]
  49. def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  50. final def hasNext: Boolean
    Definition Classes
    MergingSessionsIterator → Iterator
  51. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  52. def indexOf[B >: UnsafeRow](elem: B, from: Int): Int
    Definition Classes
    Iterator
  53. def indexOf[B >: UnsafeRow](elem: B): Int
    Definition Classes
    Iterator
  54. def indexWhere(p: (UnsafeRow) ⇒ Boolean, from: Int): Int
    Definition Classes
    Iterator
  55. def indexWhere(p: (UnsafeRow) ⇒ Boolean): Int
    Definition Classes
    Iterator
  56. def initialize(): Unit
    Attributes
    protected
  57. def initializeAggregateFunctions(expressions: Seq[AggregateExpression], startingInputBufferOffset: Int): Array[AggregateFunction]
    Attributes
    protected
    Definition Classes
    AggregationIterator
  58. def initializeBuffer(buffer: InternalRow): Unit

    Initializes buffer values for all aggregate functions.

    Initializes buffer values for all aggregate functions.

    Attributes
    protected
    Definition Classes
    AggregationIterator
  59. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  60. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  61. def isEmpty: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  62. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  63. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  64. def isTraversableAgain: Boolean
    Definition Classes
    Iterator → GenTraversableOnce
  65. def length: Int
    Definition Classes
    Iterator
  66. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  67. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  68. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  69. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  70. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  71. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  72. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  73. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  74. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  75. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  76. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  77. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  78. def map[B](f: (UnsafeRow) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  79. def max[B >: UnsafeRow](implicit cmp: Ordering[B]): UnsafeRow
    Definition Classes
    TraversableOnce → GenTraversableOnce
  80. def maxBy[B](f: (UnsafeRow) ⇒ B)(implicit cmp: Ordering[B]): UnsafeRow
    Definition Classes
    TraversableOnce → GenTraversableOnce
  81. def min[B >: UnsafeRow](implicit cmp: Ordering[B]): UnsafeRow
    Definition Classes
    TraversableOnce → GenTraversableOnce
  82. def minBy[B](f: (UnsafeRow) ⇒ B)(implicit cmp: Ordering[B]): UnsafeRow
    Definition Classes
    TraversableOnce → GenTraversableOnce
  83. def mkString: String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. def mkString(sep: String): String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  85. def mkString(start: String, sep: String, end: String): String
    Definition Classes
    TraversableOnce → GenTraversableOnce
  86. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  87. final def next(): UnsafeRow
    Definition Classes
    MergingSessionsIterator → Iterator
  88. def nonEmpty: Boolean
    Definition Classes
    TraversableOnce → GenTraversableOnce
  89. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  90. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  91. def outputForEmptyGroupingKeyWithoutInput(): UnsafeRow
  92. def padTo[A1 >: UnsafeRow](len: Int, elem: A1): Iterator[A1]
    Definition Classes
    Iterator
  93. def partition(p: (UnsafeRow) ⇒ Boolean): (Iterator[UnsafeRow], Iterator[UnsafeRow])
    Definition Classes
    Iterator
  94. def patch[B >: UnsafeRow](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
    Definition Classes
    Iterator
  95. def processCurrentSortedGroup(): Unit

    Processes rows in the current group.

    Processes rows in the current group. It will stop when it find a new group.

    Attributes
    protected
  96. val processRow: (InternalRow, InternalRow) ⇒ Unit
    Attributes
    protected
    Definition Classes
    AggregationIterator
  97. def product[B >: UnsafeRow](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  98. def reduce[A1 >: UnsafeRow](op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  99. def reduceLeft[B >: UnsafeRow](op: (B, UnsafeRow) ⇒ B): B
    Definition Classes
    TraversableOnce
  100. def reduceLeftOption[B >: UnsafeRow](op: (B, UnsafeRow) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  101. def reduceOption[A1 >: UnsafeRow](op: (A1, A1) ⇒ A1): Option[A1]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  102. def reduceRight[B >: UnsafeRow](op: (UnsafeRow, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  103. def reduceRightOption[B >: UnsafeRow](op: (UnsafeRow, B) ⇒ B): Option[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  104. def reversed: List[UnsafeRow]
    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  105. def sameElements(that: Iterator[_]): Boolean
    Definition Classes
    Iterator
  106. def scanLeft[B](z: B)(op: (B, UnsafeRow) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  107. def scanRight[B](z: B)(op: (UnsafeRow, B) ⇒ B): Iterator[B]
    Definition Classes
    Iterator
  108. def seq: Iterator[UnsafeRow]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  109. def size: Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  110. def sizeHintIfCheap: Int
    Attributes
    protected[collection]
    Definition Classes
    GenTraversableOnce
  111. def slice(from: Int, until: Int): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  112. def sliceIterator(from: Int, until: Int): Iterator[UnsafeRow]
    Attributes
    protected
    Definition Classes
    Iterator
  113. def sliding[B >: UnsafeRow](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  114. def span(p: (UnsafeRow) ⇒ Boolean): (Iterator[UnsafeRow], Iterator[UnsafeRow])
    Definition Classes
    Iterator
  115. def sum[B >: UnsafeRow](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  116. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  117. def take(n: Int): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  118. def takeWhile(p: (UnsafeRow) ⇒ Boolean): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  119. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, UnsafeRow, Col[UnsafeRow]]): Col[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  120. def toArray[B >: UnsafeRow](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  121. def toBuffer[B >: UnsafeRow]: Buffer[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  122. def toIndexedSeq: IndexedSeq[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  123. def toIterable: Iterable[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  124. def toIterator: Iterator[UnsafeRow]
    Definition Classes
    Iterator → GenTraversableOnce
  125. def toList: List[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  126. def toMap[T, U](implicit ev: <:<[UnsafeRow, (T, U)]): Map[T, U]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  127. def toSeq: Seq[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  128. def toSet[B >: UnsafeRow]: Set[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  129. def toStream: Stream[UnsafeRow]
    Definition Classes
    Iterator → GenTraversableOnce
  130. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  131. def toTraversable: Traversable[UnsafeRow]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  132. def toVector: Vector[UnsafeRow]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  133. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  134. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  135. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  136. def withFilter(p: (UnsafeRow) ⇒ Boolean): Iterator[UnsafeRow]
    Definition Classes
    Iterator
  137. def zip[B](that: Iterator[B]): Iterator[(UnsafeRow, B)]
    Definition Classes
    Iterator
  138. def zipAll[B, A1 >: UnsafeRow, B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]
    Definition Classes
    Iterator
  139. def zipWithIndex: Iterator[(UnsafeRow, Int)]
    Definition Classes
    Iterator

Deprecated Value Members

  1. def /:[B](z: B)(op: (B, UnsafeRow) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.12.10) Use foldLeft instead of /:

  2. def :\[B](z: B)(op: (UnsafeRow, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.12.10) Use foldRight instead of :\

  3. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AggregationIterator

Inherited from Logging

Inherited from Iterator[UnsafeRow]

Inherited from TraversableOnce[UnsafeRow]

Inherited from GenTraversableOnce[UnsafeRow]

Inherited from AnyRef

Inherited from Any

Ungrouped