def _write_text(self, path, write_mode): child = OperationInfo() child.identifier = _Identifier.SINK_TEXT child.parent = self._info child.path = path child.write_mode = write_mode self._info.sinks.append(child) self._env._sinks.append(child)
def _write_csv(self, path, line_delimiter, field_delimiter, write_mode): child = OperationInfo() child.identifier = _Identifier.SINK_CSV child.path = path child.parent = self._info child.delimiter_field = field_delimiter child.delimiter_line = line_delimiter child.write_mode = write_mode self._info.sinks.append(child) self._env._sinks.append(child)
def _write_text(self, path, write_mode): child = OperationInfo() child_set = DataSink(self._env, child) child.identifier = _Identifier.SINK_TEXT child.parent = self._info child.path = path child.write_mode = write_mode self._info.parallelism = child.parallelism self._info.sinks.append(child) self._env._sinks.append(child) return child_set
def write_text(self, path, write_mode=WriteMode.NO_OVERWRITE): """ Writes a DataSet as a text file to the specified location. :param path: he path pointing to the location the text file is written to. :param write_mode: OutputFormat.WriteMode value, indicating whether files should be overwritten """ child = OperationInfo() child.identifier = _Identifier.SINK_TEXT child.parent = self._info child.path = path child.write_mode = write_mode self._info.sinks.append(child) self._env._sinks.append(child)
def write_csv(self, path, line_delimiter="\n", field_delimiter=',', write_mode=WriteMode.NO_OVERWRITE): """ Writes a Tuple DataSet as a CSV file to the specified location. Note: Only a Tuple DataSet can written as a CSV file. :param path: The path pointing to the location the CSV file is written to. :param write_mode: OutputFormat.WriteMode value, indicating whether files should be overwritten """ child = OperationInfo() child.identifier = _Identifier.SINK_CSV child.path = path child.parent = self._info child.delimiter_field = field_delimiter child.delimiter_line = line_delimiter child.write_mode = write_mode self._info.sinks.append(child) self._env._sinks.append(child)