Save

class optimus.engines.base.io.save.BaseSave(root: DataFrameType)[source]
csv(path, *args, **kwargs)[source]

Save data frame to a CSV file. :param path: path where the spark will be saved. :param mode: ‘rb’, ‘wt’, etc it uses the default value. :return: Dataframe in a CSV format in the specified path.

database_table(table, db, *args, **kwargs)[source]
Parameters
  • table

  • db

  • args

  • kwargs

Returns

excel(path, mode='w', *args, **kwargs)[source]

Save data frame to a CSV file. :param path: File path or object :param mode: Python write mode, default ‘w’. it uses the default value. :return: Dataframe in a CSV format in the specified path.

file(path: str, *args, **kwargs)[source]
Parameters
  • path

  • args

  • kwargs

Returns

hdf5(path, *args, **kwargs)[source]
Parameters
  • path

  • args

  • kwargs

Returns

json(path, *args, **kwargs)[source]

Save data frame in a json file :param path: path where the spark will be saved. :param mode: Specifies the behavior of the save operation when data already exists.

“append”: Append contents of this DataFrame to existing data. “overwrite” (default case): Overwrite existing data. “ignore”: Silently ignore this operation if data already exists. “error”: Throw an exception if data already exists.

Parameters

num_partitions – the number of partitions of the DataFrame

Returns

orc(path, *args, **kwargs)[source]
Parameters
  • path

  • args

  • kwargs

Returns

parquet(path, mode='w', num_partitions=1, *args, **kwargs)[source]

Save data frame to a parquet file :param path: File path or object :param mode: Specifies the behavior of the save operation when data already exists.

“append”: Append contents of this DataFrame to existing data. “overwrite” (default case): Overwrite existing data. “ignore”: Silently ignore this operation if data already exists. “error”: Throw an exception if data already exists.

Parameters

num_partitions – the number of partitions of the DataFrame

Returns

xml(filename: Optional[str] = None, mode: str = 'w')[source]
Parameters
  • filename

  • mode

Returns