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])], TraversableOnce[(InternalRow, Iterator[InternalRow])], GenTraversableOnce[(InternalRow, Iterator[InternalRow])], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GroupedIterator
  2. Iterator
  3. TraversableOnce
  4. GenTraversableOnce
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 >: (InternalRow, Iterator[InternalRow])](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, (InternalRow, Iterator[InternalRow])) ⇒ B, combop: (B, B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def buffered: BufferedIterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  12. def collect[B](pf: PartialFunction[(InternalRow, Iterator[InternalRow]), 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.

  13. def collectFirst[B](pf: PartialFunction[(InternalRow, Iterator[InternalRow]), B]): Option[B]
    Definition Classes
    TraversableOnce
  14. def contains(elem: Any): Boolean
    Definition Classes
    Iterator
  15. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B], start: Int, len: Int): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  16. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B]): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  17. def copyToArray[B >: (InternalRow, Iterator[InternalRow])](xs: Array[B], start: Int): Unit
    Definition Classes
    TraversableOnce → GenTraversableOnce
  18. def copyToBuffer[B >: (InternalRow, Iterator[InternalRow])](dest: Buffer[B]): Unit
    Definition Classes
    TraversableOnce
  19. def corresponds[B](that: GenTraversableOnce[B])(p: ((InternalRow, Iterator[InternalRow]), B) ⇒ Boolean): Boolean
    Definition Classes
    Iterator
  20. def count(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Int
    Definition Classes
    TraversableOnce → GenTraversableOnce
  21. var currentGroup: InternalRow

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

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

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

  24. def drop(n: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  25. def dropWhile(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  26. def duplicate: (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    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: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  30. def filter(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  31. def filterNot(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  32. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  33. def find(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Option[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  34. def flatMap[B](f: ((InternalRow, Iterator[InternalRow])) ⇒ GenTraversableOnce[B]): Iterator[B]
    Definition Classes
    Iterator
  35. def fold[A1 >: (InternalRow, Iterator[InternalRow])](z: A1)(op: (A1, A1) ⇒ A1): A1
    Definition Classes
    TraversableOnce → GenTraversableOnce
  36. def foldLeft[B](z: B)(op: (B, (InternalRow, Iterator[InternalRow])) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  37. def foldRight[B](z: B)(op: ((InternalRow, Iterator[InternalRow]), B) ⇒ B): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  38. def forall(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  39. def foreach[U](f: ((InternalRow, Iterator[InternalRow])) ⇒ U): Unit
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  40. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  41. def grouped[B >: (InternalRow, Iterator[InternalRow])](size: Int): GroupedIterator[B]
    Definition Classes
    Iterator
  42. def hasDefiniteSize: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  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
    @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 indexWhere(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Int
    Definition Classes
    Iterator
  49. def isEmpty: Boolean
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  50. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  51. def isTraversableAgain: Boolean
    Definition Classes
    Iterator → GenTraversableOnce
  52. val keyOrdering: BaseOrdering
  53. val keyProjection: UnsafeProjection

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

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

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

  89. def span(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): (Iterator[(InternalRow, Iterator[InternalRow])], Iterator[(InternalRow, Iterator[InternalRow])])
    Definition Classes
    Iterator
  90. def sum[B >: (InternalRow, Iterator[InternalRow])](implicit num: Numeric[B]): B
    Definition Classes
    TraversableOnce → GenTraversableOnce
  91. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  92. def take(n: Int): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  93. def takeWhile(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  94. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, (InternalRow, Iterator[InternalRow]), Col[(InternalRow, Iterator[InternalRow])]]): Col[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  95. def toArray[B >: (InternalRow, Iterator[InternalRow])](implicit arg0: ClassTag[B]): Array[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  96. def toBuffer[B >: (InternalRow, Iterator[InternalRow])]: Buffer[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  97. def toIndexedSeq: IndexedSeq[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  98. def toIterable: Iterable[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  99. def toIterator: Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → GenTraversableOnce
  100. def toList: List[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  101. def toMap[T, U](implicit ev: <:<[(InternalRow, Iterator[InternalRow]), (T, U)]): Map[T, U]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  102. def toSeq: Seq[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  103. def toSet[B >: (InternalRow, Iterator[InternalRow])]: Set[B]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  104. def toStream: Stream[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → GenTraversableOnce
  105. def toString(): String
    Definition Classes
    Iterator → AnyRef → Any
  106. def toTraversable: Traversable[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator → TraversableOnce → GenTraversableOnce
  107. def toVector: Vector[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    TraversableOnce → GenTraversableOnce
  108. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  110. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  111. def withFilter(p: ((InternalRow, Iterator[InternalRow])) ⇒ Boolean): Iterator[(InternalRow, Iterator[InternalRow])]
    Definition Classes
    Iterator
  112. def zip[B](that: Iterator[B]): Iterator[((InternalRow, Iterator[InternalRow]), B)]
    Definition Classes
    Iterator
  113. def zipAll[B, A1 >: (InternalRow, Iterator[InternalRow]), B1 >: B](that: Iterator[B], thisElem: A1, thatElem: B1): Iterator[(A1, B1)]
    Definition Classes
    Iterator
  114. def zipWithIndex: Iterator[((InternalRow, Iterator[InternalRow]), Int)]
    Definition Classes
    Iterator

Deprecated Value Members

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

    (Since version 2.12.10) Use foldLeft instead of /:

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

    (Since version 2.12.10) Use foldRight instead of :\

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped