Esempio n. 1
0
 def next(self) -> RecordBatch:
     while True:
         try:
             batch = self._reader.read_next_batch()
         except StopIteration:
             break
         yield RecordBatch(batch)
Esempio n. 2
0
    def next(self) -> Iterable[RecordBatch]:
        for batch in self._parent_operator.next():
            if not self.agg_obj:
                self._init_agg_obj(batch)

            self.agg_obj.next(batch.get_batch())

        if self.agg_obj:
            yield RecordBatch(self.agg_obj.result())

        del self.agg_obj
Esempio n. 3
0
    def next(self) -> Iterable[RecordBatch]:
        for batch in self._parent_operator.next():
            self._process_arguments(self._arguments, batch=batch)
            col_names = tuple(i[0] for i in self._expressions)
            exprs = tuple(i[1] for i in self._expressions)
            batch = RecordBatch.from_arrays(
                tuple(chain(batch.columns, exprs)),
                tuple(chain(batch.column_names, col_names))
            )

            # Remove, once sorting by boolean columns is supported by Arrow
            self._verify_bool_columns(batch.get_schema())

            self._sort_op.next(batch.get_batch())
            self._expressions.clear()

        yield RecordBatch(self._sort_op.sorted())

        del self._sort_op
Esempio n. 4
0
 def next(self) -> RecordBatch:
     while True:
         batch = self._reader.next()
         if batch is None:
             break
         yield RecordBatch(batch)