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

Development for save_as_text_file #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gnilrets
Copy link

So I want to contribute to this project and thought I'd start with something simple like saveAsTextFile. Here's a spec that tries to save an RDD to a text file. The thing I don't understand is that when the RDD is created from a text file, it works fine. However, when the RDD is created from a parallelize command, the data that is written to the file becomes garbage. Can you please help provide some insight into what's going wrong here?

1) Spark::RDD .save_as_text_file saves the par_rdd
   Failure/Error: expect(result).to eq (0..5).collect { |i| i.to_s }

   expected: ["0", "1", "2", "3", "4", "5"]
        got: ["[B@2e293b50", "[B@14f518dd", "[B@67335fea", "[B@6b4b2ad1", "[B@13e8365f", "[B@7249a12e"]

   (compared using ==)
 # ./spec/lib/save_spec.rb:34:in `block (4 levels) in <top (required)>'
 # ./spec/lib/save_spec.rb:30:in `block (3 levels) in <top (required)>'

# rdd.save_as_text_file(path)
#
def save_as_text_file(path)
jrdd.saveAsTextFile(path)
Copy link
Owner

Choose a reason for hiding this comment

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

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.

2 participants