def project_second(self, *fields): """ Initiates a ProjectJoin transformation. Projects the second join input. If the second join input is a Tuple DataSet, fields can be selected by their index. If the second join input is not a Tuple DataSet, no parameters should be passed. :param fields: The indexes of the selected fields. :return: An incomplete JoinProjection. """ if self._info[_Fields.DISCARD2]:#key-selector usedused self._info[_Fields.OTHER][_Fields.OPERATOR]._pair = False type = self._info[_Fields.OTHER][_Fields.TYPES] self._info[_Fields.OTHER][_Fields.TYPES] = concat(type[0], type[1]) if len(fields) == 0:#adjust index return self.project_second(1) else: fields = tuple(map(lambda x: x+1, fields)) self._info[_Fields.PROJECTIONS].append(("second", fields)) return self
def _collect_append(self, value): self._collector.collect(concat(self.get_key(value), value))
def _run_append(self): collector = self._collector for value in self._iterator: collector.collect(concat(self.get_key(value), value)) collector._close()