def to_delta(self, path: str, mode: str='w', partition_cols: Optional[Union[(str, List[str])]]=None, index_col: Optional[Union[(str, List[str])]]=None, **options: 'OptionalPrimitiveType') -> None:
    '\n        Write the DataFrame out as a Delta Lake table.\n\n        Parameters\n        ----------\n        path : str, required\n            Path to write to.\n        mode : str\n            Python write mode, default \'w\'.\n\n            .. note:: mode can accept the strings for Spark writing mode.\n                Such as \'append\', \'overwrite\', \'ignore\', \'error\', \'errorifexists\'.\n\n                - \'append\' (equivalent to \'a\'): Append the new data to existing data.\n                - \'overwrite\' (equivalent to \'w\'): Overwrite existing data.\n                - \'ignore\': Silently ignore this operation if data already exists.\n                - \'error\' or \'errorifexists\': Throw an exception if data already exists.\n\n        partition_cols : str or list of str, optional, default None\n            Names of partitioning columns\n        index_col: str or list of str, optional, default: None\n            Column names to be used in Spark to represent pandas-on-Spark\'s index. The index name\n            in pandas-on-Spark is ignored. By default, the index is always lost.\n        options : dict\n            All other options passed directly into Delta Lake.\n\n        See Also\n        --------\n        read_delta\n        DataFrame.to_parquet\n        DataFrame.to_table\n        DataFrame.to_spark_io\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame(dict(\n        ...    date=list(pd.date_range(\'2012-1-1 12:00:00\', periods=3, freq=\'M\')),\n        ...    country=[\'KR\', \'US\', \'JP\'],\n        ...    code=[1, 2 ,3]), columns=[\'date\', \'country\', \'code\'])\n        >>> df\n                         date country  code\n        0 2012-01-31 12:00:00      KR     1\n        1 2012-02-29 12:00:00      US     2\n        2 2012-03-31 12:00:00      JP     3\n\n        Create a new Delta Lake table, partitioned by one column:\n\n        >>> df.to_delta(\'%s/to_delta/foo\' % path, partition_cols=\'date\')  # doctest: +SKIP\n\n        Partitioned by two columns:\n\n        >>> df.to_delta(\'%s/to_delta/bar\' % path,\n        ...             partition_cols=[\'date\', \'country\'])  # doctest: +SKIP\n\n        Overwrite an existing table\'s partitions, using the \'replaceWhere\' capability in Delta:\n\n        >>> df.to_delta(\'%s/to_delta/bar\' % path,\n        ...             mode=\'overwrite\', replaceWhere=\'date >= "2012-01-01"\')  # doctest: +SKIP\n        '
    if (index_col is None):
        log_advice('If `index_col` is not specified for `to_delta`, the existing index is lost when converting to Delta.')
    if (('options' in options) and isinstance(options.get('options'), dict) and (len(options) == 1)):
        options = options.get('options')
    mode = validate_mode(mode)
    self.spark.to_spark_io(path=path, mode=mode, format='delta', partition_cols=partition_cols, index_col=index_col, **options)
Write the DataFrame out as a Delta Lake table.

Parameters
----------
path : str, required
    Path to write to.
mode : str
    Python write mode, default 'w'.

    .. note:: mode can accept the strings for Spark writing mode.
        Such as 'append', 'overwrite', 'ignore', 'error', 'errorifexists'.

        - 'append' (equivalent to 'a'): Append the new data to existing data.
        - 'overwrite' (equivalent to 'w'): Overwrite existing data.
        - 'ignore': Silently ignore this operation if data already exists.
        - 'error' or 'errorifexists': Throw an exception if data already exists.

partition_cols : str or list of str, optional, default None
    Names of partitioning columns
index_col: str or list of str, optional, default: None
    Column names to be used in Spark to represent pandas-on-Spark's index. The index name
    in pandas-on-Spark is ignored. By default, the index is always lost.
options : dict
    All other options passed directly into Delta Lake.

See Also
--------
read_delta
DataFrame.to_parquet
DataFrame.to_table
DataFrame.to_spark_io

Examples
--------

>>> df = ps.DataFrame(dict(
...    date=list(pd.date_range('2012-1-1 12:00:00', periods=3, freq='M')),
...    country=['KR', 'US', 'JP'],
...    code=[1, 2 ,3]), columns=['date', 'country', 'code'])
>>> df
                 date country  code
0 2012-01-31 12:00:00      KR     1
1 2012-02-29 12:00:00      US     2
2 2012-03-31 12:00:00      JP     3

Create a new Delta Lake table, partitioned by one column:

>>> df.to_delta('%s/to_delta/foo' % path, partition_cols='date')  # doctest: +SKIP

Partitioned by two columns:

>>> df.to_delta('%s/to_delta/bar' % path,
...             partition_cols=['date', 'country'])  # doctest: +SKIP

Overwrite an existing table's partitions, using the 'replaceWhere' capability in Delta:

>>> df.to_delta('%s/to_delta/bar' % path,
...             mode='overwrite', replaceWhere='date >= "2012-01-01"')  # doctest: +SKIP
def to_delta(self, path: str, mode: str='w', partition_cols: Optional[Union[(str, List[str])]]=None, index_col: Optional[Union[(str, List[str])]]=None, **options: 'OptionalPrimitiveType') -> None:
    '\n        Write the DataFrame out as a Delta Lake table.\n\n        Parameters\n        ----------\n        path : str, required\n            Path to write to.\n        mode : str\n            Python write mode, default \'w\'.\n\n            .. note:: mode can accept the strings for Spark writing mode.\n                Such as \'append\', \'overwrite\', \'ignore\', \'error\', \'errorifexists\'.\n\n                - \'append\' (equivalent to \'a\'): Append the new data to existing data.\n                - \'overwrite\' (equivalent to \'w\'): Overwrite existing data.\n                - \'ignore\': Silently ignore this operation if data already exists.\n                - \'error\' or \'errorifexists\': Throw an exception if data already exists.\n\n        partition_cols : str or list of str, optional, default None\n            Names of partitioning columns\n        index_col: str or list of str, optional, default: None\n            Column names to be used in Spark to represent pandas-on-Spark\'s index. The index name\n            in pandas-on-Spark is ignored. By default, the index is always lost.\n        options : dict\n            All other options passed directly into Delta Lake.\n\n        See Also\n        --------\n        read_delta\n        DataFrame.to_parquet\n        DataFrame.to_table\n        DataFrame.to_spark_io\n\n        Examples\n        --------\n\n        >>> df = ps.DataFrame(dict(\n        ...    date=list(pd.date_range(\'2012-1-1 12:00:00\', periods=3, freq=\'M\')),\n        ...    country=[\'KR\', \'US\', \'JP\'],\n        ...    code=[1, 2 ,3]), columns=[\'date\', \'country\', \'code\'])\n        >>> df\n                         date country  code\n        0 2012-01-31 12:00:00      KR     1\n        1 2012-02-29 12:00:00      US     2\n        2 2012-03-31 12:00:00      JP     3\n\n        Create a new Delta Lake table, partitioned by one column:\n\n        >>> df.to_delta(\'%s/to_delta/foo\' % path, partition_cols=\'date\')  # doctest: +SKIP\n\n        Partitioned by two columns:\n\n        >>> df.to_delta(\'%s/to_delta/bar\' % path,\n        ...             partition_cols=[\'date\', \'country\'])  # doctest: +SKIP\n\n        Overwrite an existing table\'s partitions, using the \'replaceWhere\' capability in Delta:\n\n        >>> df.to_delta(\'%s/to_delta/bar\' % path,\n        ...             mode=\'overwrite\', replaceWhere=\'date >= "2012-01-01"\')  # doctest: +SKIP\n        '
    if (index_col is None):
        log_advice('If `index_col` is not specified for `to_delta`, the existing index is lost when converting to Delta.')
    if (('options' in options) and isinstance(options.get('options'), dict) and (len(options) == 1)):
        options = options.get('options')
    mode = validate_mode(mode)
    self.spark.to_spark_io(path=path, mode=mode, format='delta', partition_cols=partition_cols, index_col=index_col, **options)