Packages

c

org.apache.spark.sql.execution.streaming

MergingSortWithSessionWindowStateIterator

class MergingSortWithSessionWindowStateIterator extends Iterator[InternalRow] with Logging

This class technically does the merge sort between input rows and existing sessions in state, to optimize the cost of sort on "input rows + existing sessions". This is based on the precondition that input rows are sorted by "group keys + start time of session window".

This only materializes the existing sessions into memory, which are tend to be not many per group key. The cost of sorting existing sessions would be also minor based on the assumption.

The output rows are sorted with "group keys + start time of session window", which is same as the sort condition on input rows.

Linear Supertypes
Logging, Iterator[InternalRow], IterableOnceOps[InternalRow, Iterator, Iterator[InternalRow]], IterableOnce[InternalRow], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MergingSortWithSessionWindowStateIterator
  2. Logging
  3. Iterator
  4. IterableOnceOps
  5. IterableOnce
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MergingSortWithSessionWindowStateIterator(iter: Iterator[InternalRow], stateManager: StreamingSessionWindowStateManager, store: ReadStateStore, groupWithoutSessionExpressions: Seq[Attribute], sessionExpression: Attribute, inputSchema: Seq[Attribute])

Type Members

  1. class GroupedIterator[B >: A] extends AbstractIterator[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. final def ++[B >: InternalRow](xs: => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @inline()
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def addString(b: StringBuilder): StringBuilder
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  6. final def addString(b: StringBuilder, sep: String): StringBuilder
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  7. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder
    Definition Classes
    IterableOnceOps
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def buffered: BufferedIterator[InternalRow]
    Definition Classes
    Iterator
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def collect[B](pf: PartialFunction[InternalRow, B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  12. def collectFirst[B](pf: PartialFunction[InternalRow, B]): Option[B]
    Definition Classes
    IterableOnceOps
  13. def concat[B >: InternalRow](xs: => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  14. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  15. def copyToArray[B >: InternalRow](xs: Array[B], start: Int, len: Int): Int
    Definition Classes
    IterableOnceOps
  16. def copyToArray[B >: InternalRow](xs: Array[B], start: Int): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  17. def copyToArray[B >: InternalRow](xs: Array[B]): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  18. def corresponds[B](that: IterableOnce[B])(p: (InternalRow, B) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  19. def count(p: (InternalRow) => Boolean): Int
    Definition Classes
    IterableOnceOps
  20. def distinct: Iterator[InternalRow]
    Definition Classes
    Iterator
  21. def distinctBy[B](f: (InternalRow) => B): Iterator[InternalRow]
    Definition Classes
    Iterator
  22. def drop(n: Int): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  23. def dropWhile(p: (InternalRow) => Boolean): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  24. def duplicate: (Iterator[InternalRow], Iterator[InternalRow])
    Definition Classes
    Iterator
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  27. def exists(p: (InternalRow) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  28. def filter(p: (InternalRow) => Boolean): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  29. def filterNot(p: (InternalRow) => Boolean): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  30. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  31. def find(p: (InternalRow) => Boolean): Option[InternalRow]
    Definition Classes
    IterableOnceOps
  32. def flatMap[B](f: (InternalRow) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  33. def flatten[B](implicit ev: (InternalRow) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  34. def fold[A1 >: InternalRow](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  35. def foldLeft[B](z: B)(op: (B, InternalRow) => B): B
    Definition Classes
    IterableOnceOps
  36. def foldRight[B](z: B)(op: (InternalRow, B) => B): B
    Definition Classes
    IterableOnceOps
  37. def forall(p: (InternalRow) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  38. def foreach[U](f: (InternalRow) => U): Unit
    Definition Classes
    IterableOnceOps
  39. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  40. def grouped[B >: InternalRow](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  41. def hasNext: Boolean
    Definition Classes
    MergingSortWithSessionWindowStateIterator → Iterator
  42. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. def indexOf[B >: InternalRow](elem: B, from: Int): Int
    Definition Classes
    Iterator
  44. def indexOf[B >: InternalRow](elem: B): Int
    Definition Classes
    Iterator
  45. def indexWhere(p: (InternalRow) => Boolean, from: Int): Int
    Definition Classes
    Iterator
  46. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  47. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  48. def isEmpty: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecatedOverriding()
  49. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  50. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  51. def isTraversableAgain: Boolean
    Definition Classes
    IterableOnceOps
  52. final def iterator: Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnce
    Annotations
    @inline()
  53. def knownSize: Int
    Definition Classes
    IterableOnce
  54. final def length: Int
    Definition Classes
    Iterator
    Annotations
    @inline()
  55. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  56. def logDebug(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  57. def logDebug(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  58. def logError(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  59. def logError(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  60. def logInfo(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  61. def logInfo(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  62. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  63. def logTrace(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  64. def logTrace(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  65. def logWarning(msg: => String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  66. def logWarning(msg: => String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  67. def map[B](f: (InternalRow) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  68. def max[B >: InternalRow](implicit ord: Ordering[B]): InternalRow
    Definition Classes
    IterableOnceOps
  69. def maxBy[B](f: (InternalRow) => B)(implicit cmp: Ordering[B]): InternalRow
    Definition Classes
    IterableOnceOps
  70. def maxByOption[B](f: (InternalRow) => B)(implicit cmp: Ordering[B]): Option[InternalRow]
    Definition Classes
    IterableOnceOps
  71. def maxOption[B >: InternalRow](implicit ord: Ordering[B]): Option[InternalRow]
    Definition Classes
    IterableOnceOps
  72. def min[B >: InternalRow](implicit ord: Ordering[B]): InternalRow
    Definition Classes
    IterableOnceOps
  73. def minBy[B](f: (InternalRow) => B)(implicit cmp: Ordering[B]): InternalRow
    Definition Classes
    IterableOnceOps
  74. def minByOption[B](f: (InternalRow) => B)(implicit cmp: Ordering[B]): Option[InternalRow]
    Definition Classes
    IterableOnceOps
  75. def minOption[B >: InternalRow](implicit ord: Ordering[B]): Option[InternalRow]
    Definition Classes
    IterableOnceOps
  76. final def mkString: String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  77. final def mkString(sep: String): String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  78. final def mkString(start: String, sep: String, end: String): String
    Definition Classes
    IterableOnceOps
  79. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  80. def next(): InternalRow
    Definition Classes
    MergingSortWithSessionWindowStateIterator → Iterator
  81. def nextOption(): Option[InternalRow]
    Definition Classes
    Iterator
  82. def nonEmpty: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  83. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  84. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  85. def padTo[B >: InternalRow](len: Int, elem: B): Iterator[B]
    Definition Classes
    Iterator
  86. def partition(p: (InternalRow) => Boolean): (Iterator[InternalRow], Iterator[InternalRow])
    Definition Classes
    Iterator
  87. def patch[B >: InternalRow](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
    Definition Classes
    Iterator
  88. def product[B >: InternalRow](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  89. def reduce[B >: InternalRow](op: (B, B) => B): B
    Definition Classes
    IterableOnceOps
  90. def reduceLeft[B >: InternalRow](op: (B, InternalRow) => B): B
    Definition Classes
    IterableOnceOps
  91. def reduceLeftOption[B >: InternalRow](op: (B, InternalRow) => B): Option[B]
    Definition Classes
    IterableOnceOps
  92. def reduceOption[B >: InternalRow](op: (B, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  93. def reduceRight[B >: InternalRow](op: (InternalRow, B) => B): B
    Definition Classes
    IterableOnceOps
  94. def reduceRightOption[B >: InternalRow](op: (InternalRow, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  95. def reversed: Iterable[InternalRow]
    Attributes
    protected
    Definition Classes
    IterableOnceOps
  96. def sameElements[B >: InternalRow](that: IterableOnce[B]): Boolean
    Definition Classes
    Iterator
  97. def scanLeft[B](z: B)(op: (B, InternalRow) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  98. def size: Int
    Definition Classes
    IterableOnceOps
  99. def slice(from: Int, until: Int): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  100. def sliceIterator(from: Int, until: Int): Iterator[InternalRow]
    Attributes
    protected
    Definition Classes
    Iterator
  101. def sliding[B >: InternalRow](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  102. def span(p: (InternalRow) => Boolean): (Iterator[InternalRow], Iterator[InternalRow])
    Definition Classes
    Iterator → IterableOnceOps
  103. def splitAt(n: Int): (Iterator[InternalRow], Iterator[InternalRow])
    Definition Classes
    IterableOnceOps
  104. def stepper[S <: Stepper[_]](implicit shape: StepperShape[InternalRow, S]): S
    Definition Classes
    IterableOnce
  105. def sum[B >: InternalRow](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  106. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  107. def take(n: Int): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  108. def takeWhile(p: (InternalRow) => Boolean): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  109. def tapEach[U](f: (InternalRow) => U): Iterator[InternalRow]
    Definition Classes
    Iterator → IterableOnceOps
  110. def to[C1](factory: Factory[InternalRow, C1]): C1
    Definition Classes
    IterableOnceOps
  111. def toArray[B >: InternalRow](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    IterableOnceOps
  112. final def toBuffer[B >: InternalRow]: Buffer[B]
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  113. def toIndexedSeq: IndexedSeq[InternalRow]
    Definition Classes
    IterableOnceOps
  114. def toList: List[InternalRow]
    Definition Classes
    IterableOnceOps
  115. def toMap[K, V](implicit ev: <:<[InternalRow, (K, V)]): Map[K, V]
    Definition Classes
    IterableOnceOps
  116. def toSeq: Seq[InternalRow]
    Definition Classes
    IterableOnceOps
  117. def toSet[B >: InternalRow]: Set[B]
    Definition Classes
    IterableOnceOps
  118. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  119. def toVector: Vector[InternalRow]
    Definition Classes
    IterableOnceOps
  120. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  121. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  122. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  123. def withFilter(p: (InternalRow) => Boolean): Iterator[InternalRow]
    Definition Classes
    Iterator
  124. def zip[B](that: IterableOnce[B]): Iterator[(InternalRow, B)]
    Definition Classes
    Iterator
  125. def zipAll[A1 >: InternalRow, B](that: IterableOnce[B], thisElem: A1, thatElem: B): Iterator[(A1, B)]
    Definition Classes
    Iterator
  126. def zipWithIndex: Iterator[(InternalRow, Int)]
    Definition Classes
    Iterator → IterableOnceOps

Deprecated Value Members

  1. final def /:[B](z: B)(op: (B, InternalRow) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldLeft instead of /:

  2. final def :\[B](z: B)(op: (InternalRow, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use foldRight instead of :\

  3. def aggregate[B](z: => B)(seqop: (B, InternalRow) => B, combop: (B, B) => B): B
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) aggregate is not relevant for sequential collections. Use foldLeft(z)(seqop) instead.

  4. final def copyToBuffer[B >: InternalRow](dest: Buffer[B]): Unit
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use dest ++= coll instead

  5. final def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) hasDefiniteSize on Iterator is the same as isEmpty

  6. def scanRight[B](z: B)(op: (InternalRow, B) => B): Iterator[B]
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Call scanRight on an Iterable instead.

  7. def seq: MergingSortWithSessionWindowStateIterator.this.type
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Iterator.seq always returns the iterator itself

  8. final def toIterator: Iterator[InternalRow]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .iterator instead of .toIterator

  9. final def toStream: Stream[InternalRow]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.13.0) Use .to(LazyList) instead of .toStream

Inherited from Logging

Inherited from Iterator[InternalRow]

Inherited from IterableOnceOps[InternalRow, Iterator, Iterator[InternalRow]]

Inherited from IterableOnce[InternalRow]

Inherited from AnyRef

Inherited from Any

Ungrouped