Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ks.read_spark_io / DataFrame.to_spark_io #447

Merged
merged 7 commits into from Jun 9, 2019
Merged

Conversation

rxin
Copy link
Contributor

@rxin rxin commented Jun 8, 2019

Resolves #446

@codecov-io
Copy link

codecov-io commented Jun 8, 2019

Codecov Report

Merging #447 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #447      +/-   ##
==========================================
+ Coverage   93.06%   93.07%   +0.01%     
==========================================
  Files          27       27              
  Lines        3344     3349       +5     
==========================================
+ Hits         3112     3117       +5     
  Misses        232      232
Impacted Files Coverage Δ
databricks/koalas/namespace.py 90.3% <100%> (+0.12%) ⬆️
databricks/koalas/frame.py 94.74% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 103f1a6...e2726df. Read the comment docs.

@rxin rxin changed the title Generic Spark I/O functions ks.read_spark_io / DataFrame.to_spark_io Jun 8, 2019
@rxin
Copy link
Contributor Author

rxin commented Jun 8, 2019

@floscha want to take a look at this?

Copy link
Collaborator

@floscha floscha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is some really useful functionality to have since, in practice, I read/write most data from/to HDFS rather than a local file system.

I left some comments regarding the documentation. Since the implementation itself is pretty straightforward, I don't have any complaints there 😉

path : string, optional
Path to the data source.
format : string, optional
Name of the data source in Spark.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name sounds more like file name if you asked me. Why not instead go for "Specifies the input data source format." like the Spark docs describe it.

Also, like you did for mode, it would be great to provide a list of supported formats, namely: CSV, JDBC, JSON, ORC, and Parquet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Good point. Will do the changes.

path : string, optional
Path to the data source.
format : string, optional
Name of the data source in Spark.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on format above.


# Write out partitioned by one column
expected.to_spark_io(tmp, format='json', mode='overwrite', partition_cols='i32')
# reset column order, as once the data is written out, Spark rearranges partition
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line and 107 could start with a capital letter and end with a period, but that's rather cosmetic 😉

@softagram-bot
Copy link

Softagram Impact Report for pull/447 (head commit: e2726df)

⭐ Change Overview

Showing the changed files, dependency changes and the impact - click for full size
(Open in Softagram Desktop for full details)

📄 Full report

Give feedback on this report to support@softagram.com

@rxin rxin merged commit 4af1d34 into databricks:master Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement generic functionality to read / write Spark data source tables
4 participants