Skip to content

Commit

Permalink
Use to_spark()
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed Sep 6, 2019
1 parent e9becfc commit f813bb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions databricks/koalas/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,12 @@ def to_json(self, path=None, compression='uncompressed', num_files=None, **kwarg
kdf = self
if isinstance(self, ks.Series):
kdf = self._kdf
sdf = kdf._sdf
sdf = kdf.to_spark()

if num_files is not None:
sdf = sdf.repartition(num_files)

builder = sdf.select(self._internal.data_columns).write.mode("overwrite")
builder = sdf.write.mode("overwrite")
OptionUtils._set_opts(builder, compression=compression)
builder.options(**kwargs).format("json").save(path)

Expand Down

0 comments on commit f813bb7

Please sign in to comment.