Skip to content

Conversation

@felixcheung
Copy link
Member

What changes were proposed in this pull request?

additional options were not passed down in write.df.

How was this patch tested?

unit tests
@falaki @shivaram

# writing csv file
csvPath2 <- tempfile(pattern = "csvtest2", fileext = ".csv")
write.df(df2, path = csvPath2, "csv", header = "true")
df3 <- read.df(csvPath2, "csv", header = "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

We could do this - but I was thinking we could also check if R's read.csv is able to read back the file correctly with headers ?

Copy link
Member Author

@felixcheung felixcheung Sep 8, 2016

Choose a reason for hiding this comment

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

need full path to work

> read.csv(file = csvPath2)
Error in read.table(file = file, header = header, sep = sep, quote = quote,  :
  no lines available in input

> read.csv(file = paste0(csvPath2, "/", "part-r-00000-bf045be1-500f-4e77-8957-b6d256166ca7.csv"))
  year  make       model                            comment blank
1 2012 Tesla           S                         No comment Empty
2 1997  Ford        E350 Go get one now they are going fast Empty
3 2015 Chevy        Volt
4   NA Dummy Placeholder

Copy link
Contributor

Choose a reason for hiding this comment

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

The path is interpreted as a directory by write.df. It then puts in a part-0000 or a sequence of such files inside the directory

Copy link
Member Author

Choose a reason for hiding this comment

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

right, read.csv doesn't work with wildcard it seems.
testing a fix.

@SparkQA
Copy link

SparkQA commented Sep 8, 2016

Test build #65077 has finished for PR 15010 at commit 45a7a76.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@shivaram
Copy link
Contributor

shivaram commented Sep 8, 2016

Thanks - the new test looks good

@SparkQA
Copy link

SparkQA commented Sep 8, 2016

Test build #65080 has finished for PR 15010 at commit 43b3471.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@shivaram
Copy link
Contributor

shivaram commented Sep 8, 2016

LGTM - @falaki any more comments ?

@falaki
Copy link
Contributor

falaki commented Sep 8, 2016

Hey just saw. This looks good to me too.

@shivaram
Copy link
Contributor

shivaram commented Sep 8, 2016

Merging into master, branch-2.0

@asfgit asfgit closed this in f0d21b7 Sep 8, 2016
asfgit pushed a commit that referenced this pull request Sep 8, 2016
… to data source

## What changes were proposed in this pull request?

additional options were not passed down in write.df.

## How was this patch tested?

unit tests
falaki shivaram

Author: Felix Cheung <felixcheung_m@hotmail.com>

Closes #15010 from felixcheung/testreadoptions.

(cherry picked from commit f0d21b7)
Signed-off-by: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
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.

4 participants