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): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  6. final def addString(b: StringBuilder, sep: String): b.type
    Definition Classes
    IterableOnceOps
    Annotations
    @inline()
  7. def addString(b: StringBuilder, start: String, sep: String, end: String): b.type
    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]) @IntrinsicCandidate() @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 find(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    IterableOnceOps
  34. def flatMap[B](f: ((InternalRow, Iterator[InternalRow])) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  35. def flatten[B](implicit ev: ((InternalRow, Iterator[InternalRow])) => IterableOnce[B]): Iterator[B]
    Definition Classes
    Iterator → IterableOnceOps
  36. def fold[A1 >: (InternalRow, Iterator[InternalRow])](z: A1)(op: (A1, A1) => A1): A1
    Definition Classes
    IterableOnceOps
  37. def foldLeft[B](z: B)(op: (B, (InternalRow, Iterator[InternalRow])) => B): B
    Definition Classes
    IterableOnceOps
  38. def foldRight[B](z: B)(op: ((InternalRow, Iterator[InternalRow]), B) => B): B
    Definition Classes
    IterableOnceOps
  39. def forall(p: ((InternalRow, Iterator[InternalRow])) => Boolean): Boolean
    Definition Classes
    IterableOnceOps
  40. def foreach[U](f: ((InternalRow, Iterator[InternalRow])) => U): Unit
    Definition Classes
    IterableOnceOps
  41. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  42. def grouped[B >: (InternalRow, Iterator[InternalRow])](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  43. 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
  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  45. def indexOf[B >: (InternalRow, Iterator[InternalRow])](elem: B, from: Int): Int
    Definition Classes
    Iterator
  46. def indexOf[B >: (InternalRow, Iterator[InternalRow])](elem: B): Int
    Definition Classes
    Iterator
  47. def indexWhere(p: ((InternalRow, Iterator[InternalRow])) => Boolean, from: Int): Int
    Definition Classes
    Iterator
  48. def isEmpty: Boolean
    Definition Classes
    Iterator → IterableOnceOps
    Annotations
    @deprecatedOverriding()
  49. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  50. def isTraversableAgain: Boolean
    Definition Classes
    IterableOnceOps
  51. final def iterator: Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → IterableOnce
    Annotations
    @inline()
  52. val keyOrdering: BaseOrdering
  53. val keyProjection: UnsafeProjection

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

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

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

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

  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. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  6. 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

  7. 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.

  8. def seq: execution.GroupedIterator.this.type
    Definition Classes
    Iterator
    Annotations
    @deprecated
    Deprecated

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

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

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

  10. 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