Packages

class GroupedIterator extends Iterator[(InternalRow, Iterator[InternalRow])]

Iterates over a presorted set of rows, chunking it up by the grouping expression. Each call to next will return a pair containing the current group and an iterator that will return all the elements of that group. Iterators for each group are lazily constructed by extracting rows from the input iterator. As such, full groups are never materialized by this class.

Example input:

Input: [a, 1], [b, 2], [b, 3]
Grouping: x#1
InputSchema: x#1, y#2

Result:

First call to next():  ([a], Iterator([a, 1])
Second call to next(): ([b], Iterator([b, 2], [b, 3])

Note, the class does not handle the case of an empty input for simplicity of implementation. Use the factory to construct a new instance.

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

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, Iterator[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, Iterator[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, Iterator[InternalRow]), B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  12. def collectFirst[B](pf: PartialFunction[(InternalRow, Iterator[InternalRow]), B]): Option[B]
    Definition Classes
    IterableOnceOps
  13. def concat[B >: (InternalRow, Iterator[InternalRow])](xs: => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  14. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  15. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B], start: Int, len: Int): Int
    Definition Classes
    IterableOnceOps
  16. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B], start: Int): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  17. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B]): Int
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  18. def corresponds[B](that: IterableOnce[B])(p: ((InternalRow, Iterator[InternalRow]), B) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  19. def count(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Int
    Definition Classes
    IterableOnceOps
  20. var currentGroup: InternalRow

    Holds a copy of an input row that is in the current group.

  21. var currentIterator: Iterator[InternalRow]
  22. var currentRow: InternalRow

    Holds null or the row that will be returned on next call to next() in the inner iterator.

  23. def distinct: Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  24. def distinctBy[B](f: ((InternalRow, Iterator[InternalRow])) => B): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  25. def drop(n: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  26. def dropWhile(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  27. def duplicate: (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    Definition Classes
    Iterator
  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  30. def exists(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  31. def filter(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  32. def filterNot(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  33. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  34. def find(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  35. def flatMap[B](f: ((InternalRow, Iterator[InternalRow])) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  36. def flatten[B](implicit ev: ((InternalRow, Iterator[InternalRow])) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  37. def fold[A1 >: (InternalRow, Iterator[InternalRow])](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  38. def foldLeft[B](z: B)(op: (B, (InternalRow, Iterator[InternalRow])) => B): B
    Definition Classes
    IterableOnceOps
  39. def foldRight[B](z: B)(op: ((InternalRow, Iterator[InternalRow]), B) => B): B
    Definition Classes
    IterableOnceOps
  40. def forall(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  41. def foreach[U](f: ((InternalRow, Iterator[InternalRow])) => U): Unit
    Definition Classes
    IterableOnceOps
  42. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. def grouped[B >: (InternalRow, Iterator[InternalRow])](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  44. def hasNext: Boolean

    Return true if we already have the next iterator or fetching a new iterator is successful.

    Return true if we already have the next iterator or fetching a new iterator is successful.

    Note that, if we get the iterator by next, we should consume it before call hasNext, because we will consume the input data to skip to next group while fetching a new iterator, thus make the previous iterator empty.

    Definition Classes
    GroupedIterator → Iterator
  45. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  46. def indexOf[B >: (InternalRow, Iterator[InternalRow])](elem: B, from: Int): Int
    Definition Classes
    Iterator
  47. def indexOf[B >: (InternalRow, Iterator[InternalRow])](elem: B): Int
    Definition Classes
    Iterator
  48. def indexWhere(p: ((InternalRow, Iterator[InternalRow])) => Boolean, from: Int): Int
    Definition Classes
    Iterator
  49. def isEmpty: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecatedOverriding()
  50. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  51. def isTraversableAgain: Boolean
    Definition Classes
    IterableOnceOps
  52. final def iterator: Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnce
    Annotations
    @inline()
  53. val keyOrdering: BaseOrdering
  54. val keyProjection: UnsafeProjection

    Creates a row containing only the key for a given input row.

  55. def knownSize: Int
    Definition Classes
    IterableOnce
  56. final def length: Int
    Definition Classes
    Iterator
    Annotations
    @inline()
  57. def map[B](f: ((InternalRow, Iterator[InternalRow])) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  58. def max[B >: (InternalRow, Iterator[InternalRow])](implicit ord: Ordering[B]): (InternalRow, Iterator[InternalRow])
    Definition Classes
    IterableOnceOps
  59. def maxBy[B](f: ((InternalRow, Iterator[InternalRow])) => B)(implicit cmp: Ordering[B]): (InternalRow, Iterator[InternalRow])
    Definition Classes
    IterableOnceOps
  60. def maxByOption[B](f: ((InternalRow, Iterator[InternalRow])) => B)(implicit cmp: Ordering[B]): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  61. def maxOption[B >: (InternalRow, Iterator[InternalRow])](implicit ord: Ordering[B]): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  62. def min[B >: (InternalRow, Iterator[InternalRow])](implicit ord: Ordering[B]): (InternalRow, Iterator[InternalRow])
    Definition Classes
    IterableOnceOps
  63. def minBy[B](f: ((InternalRow, Iterator[InternalRow])) => B)(implicit cmp: Ordering[B]): (InternalRow, Iterator[InternalRow])
    Definition Classes
    IterableOnceOps
  64. def minByOption[B](f: ((InternalRow, Iterator[InternalRow])) => B)(implicit cmp: Ordering[B]): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  65. def minOption[B >: (InternalRow, Iterator[InternalRow])](implicit ord: Ordering[B]): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  66. final def mkString: String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  67. final def mkString(sep: String): String
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  68. final def mkString(start: String, sep: String, end: String): String
    Definition Classes
    IterableOnceOps
  69. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  70. def next(): (InternalRow, Iterator[InternalRow])
    Definition Classes
    GroupedIterator → Iterator
  71. def nextOption(): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  72. def nonEmpty: Boolean
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecatedOverriding()
  73. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  74. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  75. def padTo[B >: (InternalRow, Iterator[InternalRow])](len: Int, elem: B): Iterator[B]
    Definition Classes
    Iterator
  76. def partition(p: ((InternalRow, Iterator[InternalRow])) => Boolean): (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    Definition Classes
    Iterator
  77. def patch[B >: (InternalRow, Iterator[InternalRow])](from: Int, patchElems: Iterator[B], replaced: Int): Iterator[B]
    Definition Classes
    Iterator
  78. def product[B >: (InternalRow, Iterator[InternalRow])](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  79. def reduce[B >: (InternalRow, Iterator[InternalRow])](op: (B, B) => B): B
    Definition Classes
    IterableOnceOps
  80. def reduceLeft[B >: (InternalRow, Iterator[InternalRow])](op: (B, (InternalRow, Iterator[InternalRow])) => B): B
    Definition Classes
    IterableOnceOps
  81. def reduceLeftOption[B >: (InternalRow, Iterator[InternalRow])](op: (B, (InternalRow, Iterator[InternalRow])) => B): Option[B]
    Definition Classes
    IterableOnceOps
  82. def reduceOption[B >: (InternalRow, Iterator[InternalRow])](op: (B, B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  83. def reduceRight[B >: (InternalRow, Iterator[InternalRow])](op: ((InternalRow, Iterator[InternalRow]), B) => B): B
    Definition Classes
    IterableOnceOps
  84. def reduceRightOption[B >: (InternalRow, Iterator[InternalRow])](op: ((InternalRow, Iterator[InternalRow]), B) => B): Option[B]
    Definition Classes
    IterableOnceOps
  85. def reversed: Iterable[(InternalRow, Iterator[InternalRow])]
    Attributes
    protected
    Definition Classes
    IterableOnceOps
  86. def sameElements[B >: (InternalRow, Iterator[InternalRow])](that: IterableOnce[B]): Boolean
    Definition Classes
    Iterator
  87. def scanLeft[B](z: B)(op: (B, (InternalRow, Iterator[InternalRow])) => B): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  88. def size: Int
    Definition Classes
    IterableOnceOps
  89. def slice(from: Int, until: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  90. def sliceIterator(from: Int, until: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Attributes
    protected
    Definition Classes
    Iterator
  91. def sliding[B >: (InternalRow, Iterator[InternalRow])](size: Int, step: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  92. val sortOrder: Seq[SortOrder]

    Compares two input rows and returns 0 if they are in the same group.

  93. def span(p: ((InternalRow, Iterator[InternalRow])) => Boolean): (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    Definition Classes
    Iterator → IterableOnceOps
  94. def splitAt(n: Int): (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    Definition Classes
    IterableOnceOps
  95. def stepper[S <: Stepper[_]](implicit shape: StepperShape[(InternalRow, Iterator[InternalRow]), S]): S
    Definition Classes
    IterableOnce
  96. def sum[B >: (InternalRow, Iterator[InternalRow])](implicit num: Numeric[B]): B
    Definition Classes
    IterableOnceOps
  97. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  98. def take(n: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  99. def takeWhile(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  100. def tapEach[U](f: ((InternalRow, Iterator[InternalRow])) => U): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnceOps
  101. def to[C1](factory: Factory[(InternalRow, Iterator[InternalRow]), C1]): C1
    Definition Classes
    IterableOnceOps
  102. def toArray[B >: (InternalRow, Iterator[InternalRow])](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    IterableOnceOps
  103. final def toBuffer[B >: (InternalRow, Iterator[InternalRow])]: Buffer[B]
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  104. def toIndexedSeq: IndexedSeq[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  105. def toList: List[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  106. def toMap[K, V](implicit ev: <:<[(InternalRow, Iterator[InternalRow]), (K, V)]): Map[K, V]
    Definition Classes
    IterableOnceOps
  107. def toSeq: Seq[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  108. def toSet[B >: (InternalRow, Iterator[InternalRow])]: Set[B]
    Definition Classes
    IterableOnceOps
  109. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  110. def toVector: Vector[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  111. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  112. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  113. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  114. def withFilter(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  115. def zip[B](that: IterableOnce[B]): Iterator[((InternalRow, Iterator[InternalRow]), B)]
    Definition Classes
    Iterator
  116. def zipAll[A1 >: (InternalRow, Iterator[InternalRow]), B](that: IterableOnce[B], thisElem: A1, thatElem: B): Iterator[(A1, B)]
    Definition Classes
    Iterator
  117. def zipWithIndex: Iterator[((InternalRow, Iterator[InternalRow]), Int)]
    Definition Classes
    Iterator → IterableOnceOps

Deprecated Value Members

  1. final def /:[B](z: B)(op: (B, (InternalRow, Iterator[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, Iterator[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, Iterator[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, Iterator[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, Iterator[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: execution.GroupedIterator.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, 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, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
    Annotations
    @deprecated @inline()
    Deprecated

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

Inherited from Iterator[(InternalRow, Iterator[InternalRow])]

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

Inherited from IterableOnce[(InternalRow, Iterator[InternalRow])]

Inherited from AnyRef

Inherited from Any

Ungrouped