Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoLaval committed Mar 19, 2024
1 parent be80392 commit 9e09a69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Default option values:

Any CSV option can be defined or overridden thanks to url parameters (values have to be encoded).

For instance, to read a CSV content where delimiter is `|` and quote is `'`:
For instance, to read a CSV content where delimiter is `|` and quote is `'`:

`loadCSV(...?delimiter=%7C&quote=%27)`

Expand All @@ -50,4 +50,4 @@ Any CSV option can be defined or overridden thanks to url parameters (values hav

For instance, to write a CSV with a content delimited by `|` and quoted by `'`:

`writeCSV(...?delimiter=%7C&quote=%27)`
`writeCSV(...?delimiter=%7C&quote=%27)`
4 changes: 3 additions & 1 deletion src/test/java/CSVTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public void readCSVDatasetTest() throws Exception {
SparkSession.builder().appName("test").master("local").getOrCreate()) {
Dataset ds1 = SparkUtils.readCSVDataset(spark, "src/test/resources/ds1.csv");
assertThat(ds1.getDataPoints().get(1).get("name")).isEqualTo("B");
Dataset ds2 = SparkUtils.readCSVDataset(spark, "src/test/resources/ds2.csv?delimiter=%7C&quote=%27");
Dataset ds2 =
SparkUtils.readCSVDataset(
spark, "src/test/resources/ds2.csv?delimiter=%7C&quote=%27");
assertThat(ds2.getDataPoints().get(1).get("name")).isEqualTo("G");
}
}
Expand Down

0 comments on commit 9e09a69

Please sign in to comment.